[Bug c/106119] Bogus use-after-free warning triggered by optimizer

2022-06-29 Thread tom.cosgrove at arm dot com via Gcc-bugs
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

2022-06-28 Thread tom.cosgrove at arm dot com via Gcc-bugs
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

[Bug c/106119] New: Bogus use-after-free warning triggered by optimizer

2022-06-28 Thread tom.cosgrove at arm dot com via Gcc-bugs
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