[Bug middle-end/106578] spurious -Wuse-after-free=2 after conditional free() when not optimizing

2022-08-11 Thread gcc.gnu.org at aydos dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106578 --- Comment #4 from Gökçe Aydos --- Just to clarify my entry: In my opinion gcc should not fire a warning in my first example. In case `realloc` was not successful, then `realloc` does not touch its argument. I should be able to use its

[Bug middle-end/106578] spurious -Wuse-after-free=2 after conditional free() when not optimizing

2022-08-10 Thread gcc.gnu.org at aydos dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106578 --- Comment #3 from Gökçe Aydos --- > using 'tmp' instead makes it properly fire. Dear Richard, maybe I misunderstood what you meant with *fire*. If `tmp` is used then gcc does not *fire* any warning and works correctly, right?