[Bug c/115770] Undefined arm instruction (udf #255) is generated when optimizer is on O2
rearnsha at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jul 3 12:47:56 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115770
Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
Address 0 is the same as the null pointer value and you haven't told the
compiler you're operating in a 'stand-alone' environment (in a hosted
environment dereferencing null is considered undefined behaviour). If you
change the address to 4, you'll see what I mean.
You can add -ffreestanding to force the compiler to treat 0 as a valid address,
but this has other side-effects on the compilation as well.
More information about the Gcc-bugs
mailing list