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.

Reply via email to