https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106119
--- Comment #2 from Tom Cosgrove ---
Further addendum:
If you use a `void *` to save the value of the pointer, you don't get the
warning!
See https://gcc.godbolt.org/z/fof8a747z
i.e. this code does not generate the warning:
#include
#inclu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106119
--- Comment #1 from Tom Cosgrove ---
Note that the command lines just need -Wall, i.e.
gcc-12 $ gcc -O2 -Wall -o foo -c foo.c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106119
Bug ID: 106119
Summary: Bogus use-after-free warning triggered by optimizer
Product: gcc
Version: 12.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Compo