[Bug tree-optimization/95663] static_cast checks for null even when the pointer is dereferenced

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 15 12:54:58 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95663

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
So yes, the static_cast should evaluate to zero, but if it's followed by a
dereference then it seems reasonable to expect -fdelete-null-pointer-checks to
optimize away the handling for zero.


More information about the Gcc-bugs mailing list