public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/56341] New: GCC produces unaligned data access
@ 2013-02-15 13:09 bernd.edlinger at hotmail dot de
  2013-02-15 13:13 ` [Bug c/56341] " bernd.edlinger at hotmail dot de
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: bernd.edlinger at hotmail dot de @ 2013-02-15 13:09 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56341

             Bug #: 56341
           Summary: GCC produces unaligned data access
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bernd.edlinger@hotmail.de


Created attachment 29464
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29464
test program produces alignment faults

Hello,

The attached test program causes two problems when compiled with GCC 4.6.3 for
ARM:

1. test() fails to write the high word of an unaligned volatile struct member.

2. test1() crashes because it uses an unaligned word access.

This code did compile and execute correctly with GCC 4.3.2

As a workaround, the bug goes away if the code is compiled with
-fno-strict-volatile-bitfields,
but this is probably less efficient code.


The attached patch is a backport of the following patch, and seems to resolve
this issue:

http://gcc.gnu.org/ml/gcc-patches/2012-08/msg01449.html

the original patch ignored the alignment of the target, and fixed only the
first test case, but not the crash in the second test case.

Regards
Bernd Edlinger


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2014-02-27  7:28 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-15 13:09 [Bug c/56341] New: GCC produces unaligned data access bernd.edlinger at hotmail dot de
2013-02-15 13:13 ` [Bug c/56341] " bernd.edlinger at hotmail dot de
2013-02-15 14:19 ` mikpe at it dot uu.se
2013-02-15 14:47 ` bernd.edlinger at hotmail dot de
2013-02-15 15:26 ` [Bug middle-end/56341] " pinskia at gcc dot gnu.org
2013-02-18 11:21 ` rguenth at gcc dot gnu.org
2013-02-18 15:31 ` sandra at codesourcery dot com
2013-02-18 18:42 ` bernd.edlinger at hotmail dot de
2013-02-20  1:38 ` bernd.edlinger at hotmail dot de
2013-02-26 18:25 ` bernd.edlinger at hotmail dot de
2013-03-27 10:37 ` bernd.edlinger at hotmail dot de
2013-06-03  4:11 ` sandra at codesourcery dot com
2013-06-03 13:01 ` bernd.edlinger at hotmail dot de
2013-06-14  3:01 ` sandra at codesourcery dot com
2013-10-07 15:41 ` sandra at codesourcery dot com
2013-10-30 17:08 ` ramana at gcc dot gnu.org
2013-12-11 16:50 ` edlinger at gcc dot gnu.org
2013-12-11 16:59 ` edlinger at gcc dot gnu.org
2014-01-07 13:43 ` bernd.edlinger at hotmail dot de
2014-02-27  7:28 ` jye2 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).