This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56080] Incorrect code generated when changing lvalue of pointer and using inline code and optimizations.
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 Jan 2013 21:57:37 +0000
- Subject: [Bug c++/56080] Incorrect code generated when changing lvalue of pointer and using inline code and optimizations.
- Auto-submitted: auto-generated
- References: <bug-56080-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56080
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |INVALID
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-01-22 21:57:37 UTC ---
++(*((uint32_t**)&d));
You are violating C/C++ aliasing rules. You are accessing d via void* and also
uint32_t*. To write this correctly is:
d = ((uint32_t*)d)+1;