[Bug c++/81928] if(!this) optimization leads to possible errors without warnings

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Aug 23 09:52:00 GMT 2017


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2017-08-23
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Not sure what you are asking for?  We cannot reject the program, the undefined
behavior only exists when this is NULL at runtime.  We already warn about the
pointless comparison.

Are you asking to optimize the test away even when not optimizing?


More information about the Gcc-bugs mailing list