[Bug c++/38297] O2 causes invalid code
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Nov 28 02:22:00 GMT 2008
------- Comment #4 from pinskia at gcc dot gnu dot org 2008-11-28 02:20 -------
Yep you are violating C++ aliasing rules as you are accessing a char * as an
unsigned char*. It would be ok if you accessed a char as an unsigned char but
you are accessing the pointers instead.
It is not the size which matters but rather the types which are being accessed
here.
*** This bug has been marked as a duplicate of 21920 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38297
More information about the Gcc-bugs
mailing list