From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 738 invoked by alias); 17 Apr 2012 08:15:52 -0000 Received: (qmail 707 invoked by uid 22791); 17 Apr 2012 08:15:48 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_CP X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Apr 2012 08:14:54 +0000 From: "mikpe at it dot uu.se" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/53016] memcpy optimization can cause unaligned access on ARM Date: Tue, 17 Apr 2012 08:15:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mikpe at it dot uu.se X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg01361.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53016 --- Comment #1 from Mikael Pettersson 2012-04-17 08:14:49 UTC --- Created attachment 27175 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27175 reduced test case Gets alignment faults with both -mthumb and -marm (+ -march=armv5te -O1) using gcc 4.4.7 and 4.5.3, but not with 4.6.3 or 4.7.0. With -marm I get alignment faults that the kernel fixes up. With -mthumb I get a fatal SIGBUS and a kernel message like the following: Alignment trap: a.out (10263) PC=0x0000834e Instr=0xc331ca31 Address=0xbea0b335 FSR 0x001 Alignment trap: not handling instruction c331ca31 at [<0000834e>] Unhandled fault: alignment exception (0x001) at 0xbea0b335 I'm not sure if that's due to a kernel bug or because I've neglected to enable some Thumb1-specific support in my kernel (I normally only run pure ARM code).