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

jzwinck at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Jun 27 00:20:08 GMT 2020


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

--- Comment #11 from John Zwinck <jzwinck at gmail dot com> ---
Jeffrey, when I compile with -fno-isolate-erroneous-paths-dereference I am
asking the compiler not to insert traps.  I filed this issue in hopes that GCC
can better optimize when it is told not to insert traps.

I think the default behavior of inserting a trap is sort of OK ("sort of"
because it seems pointless to trap when not trapping would dereference 0x0,
which in my mind is also a good way to end a program that dereferences a null
pointer).  But when I tell GCC not to insert traps, I definitely want the
simplest, fastest code.


More information about the Gcc-bugs mailing list