[Bug c/109123] Bogus warning: pointer used after 'realloc' -Wuse-after-free with -O2

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 15 08:16:22 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109123

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 54668
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54668&action=edit
patch

The diagnostic pass (pass_warn_access) is already split into two modes,
unfortunately the -Wuse-after-free part only runs on the late optimized IL
(for whatever reasons ...).

Enabling it only for the early passes regresses a few cases but also resolves
some XFAILs (and your testcase), so it might be the best thing to do.

I'm testing the attached.


More information about the Gcc-bugs mailing list