[Bug c/66090] Wrong loop code generation with -O2 on ARM
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun May 10 21:43:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66090
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Since the pointer is wrapping to null, you need to use
-fno-delete-null-pointer-checks to disable removing of checks of null pointers
or rather it enables allowing pointers to wrap to become null.
In C, once a pointer is non-null, it can't become null by adding a value to it.
So GCC enables an optimization around that case (and
fno-delete-null-pointer-checks disables that optimization).
So no GCC bug, just wrongly assuming pointers can't become null pointers if
they were not null pointers.
More information about the Gcc-bugs
mailing list