This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/42907] New: -fstrict-aliasing breaks valid code
- From: "fejj at novell dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jan 2010 21:10:09 -0000
- Subject: [Bug c/42907] New: -fstrict-aliasing breaks valid code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When compiling the attached C code with gcc 4.4.1 [gcc-4_4-branch revision
150839] w/ -O2 -fstrict-aliasing, gcc outputs broken machine code.
>From what I can gather by stepping thru the generated program with gdb, gcc has
dropped a number of statements that are required for the code to properly
function. For example, it has dropped:
- the initialization of list
- the initialization of tail
- the updating of the tail pointer after each iteration thru the loop (if you
pretend like gcc didn't unroll the loop)
- the comparison of list to NULL after the loop
I'll also attach my gdb session.
--
Summary: -fstrict-aliasing breaks valid code
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fejj at novell dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42907