This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/42907] -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:33:19 -0000
- Subject: [Bug c/42907] -fstrict-aliasing breaks valid code
- References: <bug-42907-18727@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from fejj at novell dot com 2010-01-30 21:33 -------
gcc should do what I've asked it to do.
if I change the cast to:
tail = (Node *) ((char *) &list);
it works, even with -fstrict-aliasing.
In other words, if I trick gcc into not being "smart", it works. gcc shouldn't
try to outsmart the programmer - that is just wrong.
--
fejj at novell dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42907