[Bug c/106119] Bogus use-after-free warning triggered by optimizer
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
[Bug c/106119] Bogus use-after-free warning triggered by optimizer
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