[Bug tree-optimization/104215] bogus -Wuse-after-free=3 due to forwprop moving a pointer test after realloc

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 25 18:17:22 GMT 2022


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

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
The use in your example is undefined in C (as is any other use of an
indeterminate pointer value).  C++ made using pointers made it
implementation-defined a few years ago while still allowing for it to crash,
which is still effectively undefined.  The warning for your example (equality)
only triggers at level 3 (which is not the default in -Wall) to accommodate the
C++ decision.


More information about the Gcc-bugs mailing list