static int a = 0;
extern int foo (void);
extern int *bar (void) __attribute__ ((__const__));

void
test (int x)
{
  int b = 10;
  while (foo () == -1 && *bar () == 4 && b > 0)
    --b;
  a = x;
}

ICEs on i386 and x86_64 with -O2 -funroll-loops (and e.g. -O3
-fomit-frame-pointer -funroll-loops too).
The ICE is in dse2 pass, when compute_immediate_uses_for_phi sees a PHI node
with NULL 3rd argument:
  # aD.1460_16 = PHI <aD.1460_13(2), aD.1460_17(3), (1)>;
Before cddce pass that PHI node looked correctly:
  # aD.1460_16 = PHI <aD.1460_13(2), aD.1460_17(4), aD.1460_11(5)>;

-- 
           Summary: [4.0 Regression] ICE on NULL PHI_ARG_DEF
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: critical
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i386-linux, x86_64-linux


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

Reply via email to