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

2022-01-29 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0

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

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 --- Comment #7 from Martin Sebor --- The kernel false positive is discussed in bug 104069 comment 13. I don't think it's related to this issue but you're of course right that this warning isn't immune to false positives. That's true for all

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

2022-01-25 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 --- Comment #6 from rguenther at suse dot de --- On Tue, 25 Jan 2022, msebor at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 > > --- Comment #5 from Martin Sebor --- > To "use" means to evaluate. The strict C

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

2022-01-25 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 --- Comment #5 from Martin Sebor --- To "use" means to evaluate. The strict C semantics are that the realloc() argument becomes indeterminate after the function has returned non-null, whether or not the returned pointer is the same as the

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

2022-01-25 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 --- Comment #4 from rguenther at suse dot de --- > Am 25.01.2022 um 19:20 schrieb msebor at gcc dot gnu.org > : > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 > > --- Comment #3 from Martin Sebor --- > I meant to say "C++ made it

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

2022-01-25 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 --- Comment #3 from Martin Sebor --- I meant to say "C++ made it implementation-defined to use a pointer made indeterminate by the pointee's lifetime having ended."

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

2022-01-25 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 --- Comment #2 from Martin Sebor --- 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

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

2022-01-25 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104215 Richard Biener changed: What|Removed |Added CC||rguenth at gcc dot gnu.org ---