This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81720] [arm] Invalid code generation
- From: "oarias at knights dot ucf.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 Aug 2017 16:18:50 +0000
- Subject: [Bug target/81720] [arm] Invalid code generation
- Auto-submitted: auto-generated
- References: <bug-81720-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81720
Orlando Arias <oarias at knights dot ucf.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |---
--- Comment #3 from Orlando Arias <oarias at knights dot ucf.edu> ---
(In reply to Andrew Pinski from comment #2)
> Use -fno-delete-null-pointer-checks as this is a null pointer and
> deferencing null pointers are undefined in C.
Greetings,
Except that for bare metal targets, address 0 can actually point to a valid
object. As such, the dereference is legal by the C standard itself. What you
are requesting your users to do here is to issue a compiler flag so that code
that they expect to work one way actually performs the way they expect it to.
Furthermore, this particular piece of code worked as expected in previous
versions of the compiler.
As such, instead of closing this as invalid, my suggestion is to actually
disable this option by default on bare metal targets [which GCC has a quite a
few of, by the way]. Thank you.
Cheers,
Orlando.