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

law at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 13 15:51:13 GMT 2021


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

--- Comment #21 from Jeffrey A. Law <law at gcc dot gnu.org> ---
I don't think there's anything inherently wrong with treating 0 + small offset
similarly to 0 when it comes to -fdelete-null-pointer-checks.   I suspect it'll
break some poorly written low level code, though we fixed up some of that a
year or so ago in response to some of Martin's diagnostic work which was
flagging 0 + offset as problematical.


More information about the Gcc-bugs mailing list