The following valid code snippet triggers an ICE on mainline
when compiled with "gcc -O -Wall -Werror" on i686-pc-linux-gnu.

=====================================================
int F0 (int);
int F1 (int t) { return F0(t); }
int F2 (int t) { return F0(t); }

extern int X[];
static inline int foo(int i)
{
  return X[i];
}

int bar(int* p)
{
  int i;

  while ( ({ if (foo(*p) && foo(*p)); p; }) );

  return i;
}
=====================================================

cc1: warnings being treated as errors
bug.c: In function 'bar':
bug.c:17: error: 'i' is used uninitialized in this function
bug.c:12: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

Although the first functions aren't used in bar where the ICE happens,
they're needed to reproduce the ICE.

I can trace the bug back to at least 2007-05-13.

Janis, a regression hunt might be useful here.
Would you mind running one?


-- 
           Summary: [4.3 regression] ICE with uninitialized variable and -
                    Werror
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, monitored
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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

Reply via email to