[Bug c/105449] suspicious optimization since GCC 10.1.0 from -O2
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon May 2 00:00:03 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105449
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You are violating C/C++ aliasing rules.
You have a store as "void*" but then access it as an "int*"
void * bogus = (void*) 1;
int *p = (int *) &bogus;
...
if (p[pos] == 1) {
More information about the Gcc-bugs
mailing list