This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/36360] Apparent optimization bug, possible regression
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 May 2008 22:25:52 -0000
- Subject: [Bug c/36360] Apparent optimization bug, possible regression
- References: <bug-36360-6736@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-05-28 22:25 -------
Constructs like
((struct sockaddr_in *)(&svaddr))->sin_port
violate C aliasing rules if svaddr is not of type struct sockaddr_in.
You can either use -fno-strict-aliasing or do the type-punning via
memcpy or by using unions.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36360