[Bug middle-end/61409] [5/6/7 regression] -Wmaybe-uninitialized false-positive with -O2

aldyh at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Aug 25 18:18:00 GMT 2016


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

--- Comment #22 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Created attachment 39499
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39499&action=edit
untested patch v1

I think I see what Jeff is getting at.

Here is an untested patch exploring the idea of ignoring unguarded uses if we
can prove that the guards for such uses are invalidated by the uninitialized
operand paths being executed.

Preliminary tests show that it fixes the testcase in the PR without introducing
any regressions in the rest of the uninit tests:

     make check-gcc RUNTESTFLAGS=dg.exp=uninit*

As the "NOTE:" in the code states, we could be much smarter when invalidating
predicates, but for now let's do straight negation which works for the simple
case.

Does this seem like a reasonable approach?


More information about the Gcc-bugs mailing list