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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As for the missed -Wuninitialized at -O0, wonder if we couldn't do something
about it for GCC 7.

volatile int v;
void bar (void)
{
  int x;
  v++;
  for (; x < 100; x++) v++;
  v++;
}

Here, we have
  # x_1 = PHI <x_7(D)(2), x_11(3)>
  if (x_1 <= 99)
in an always_executed basic block, normally we don't look at PHIs in the early
uninit pass at all, but wonder if for always_executed bbs we couldn't make an
exception - if the uninited value is from the immediate dominator of the bb and
the PHI result is used in an always_executed basic block, it IMHO means a clear
case where the use is always uninitialized (if the function is ever called, but
other must uninitialized warnings are making the same assumption).

Reply via email to