This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/56080] Incorrect code generated when changing lvalue of pointer and using inline code and optimizations.


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]