struct S { int i, j; };

int foo (int l)
{
  struct S s;
  s.j = l - 22;
  return s.i + s.j;
}

with -O2 -W -Wall in 4.4 this used to warn:
v.c: In function 'foo':
v.c:6: warning: 's.i' is used uninitialized in this function
but with 4.5+ it warns:
v.c: In function 'foo':
v.c:6:11: warning: '({anonymous})' is used uninitialized in this function
[-Wuninitialized]

For:
struct S { int i, j; };

int foo (int l)
{
  struct S s;
  if (l > 126)
    {
      s.j = l - 22;
      return s.i + s.j;
    }
  s.i = 12;
  s.j = l + 40;
  return s.i + s.j;
}
the warning is ok in both 4.4 and 4.5+.

I'd say that SRA should add the D.XXXX = s$i; stmts, perhaps right before
D.XXXX uses.


-- 
           Summary: [4.5/4.6 Regression] Uninit warning regression with new
                    SRA
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44133

Reply via email to