fix PR68493: bail out when codegen_error is set
authorAditya Kumar <aditya.k7@samsung.com>
Mon, 23 Nov 2015 19:31:00 +0000 (19:31 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Mon, 23 Nov 2015 19:31:00 +0000 (19:31 +0000)
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r230772

gcc/ChangeLog
gcc/graphite-isl-ast-to-gimple.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/pr68493.c [new file with mode: 0644]

index 76f2474aba361b4d0f869a39ae5174400ce11846..27f4d792820e074440543ce3c0351d5ad003b529 100644 (file)
@@ -1,3 +1,10 @@
+2015-11-23  Aditya Kumar  <aditya.k7@samsung.com>
+           Sebastian Pop  <s.pop@samsung.com>
+
+       PR tree-optimization/68493
+       * graphite-isl-ast-to-gimple.c (translate_pending_phi_nodes): Add
+       missing early return when codegen_error is set.
+
 2015-11-23  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
 
index d421c08964021a703e7a4c1f4d3b7a933a8a485b..1d986f85905cebfadd46774710dda49c49cdae1b 100644 (file)
@@ -2761,6 +2761,8 @@ translate_isl_ast_to_gimple::translate_pending_phi_nodes ()
          fprintf (dump_file, "[codegen] to new-phi: ");
          print_gimple_stmt (dump_file, new_phi, 0, 0);
        }
+      if (codegen_error)
+       return;
     }
 }
 
index 19fa7024246941be23a3e52e731051ad1fe08ad2..560b239f5115fee1bb9e3e840149833dd6d80c69 100644 (file)
@@ -1,8 +1,14 @@
+2015-11-23  Aditya Kumar  <aditya.k7@samsung.com>
+           Sebastian Pop  <s.pop@samsung.com>
+
+       PR tree-optimization/68493
+       * gcc.dg/graphite/pr68493.c: New.
+
 2015-11-23  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
 
        PR tree-optimization/68279
-       * testsuite/gfortran.dg/graphite/pr68279.f90: New.
+       * gfortran.dg/graphite/pr68279.f90: New.
 
 2015-11-23  Marek Polacek  <polacek@redhat.com>
 
diff --git a/gcc/testsuite/gcc.dg/graphite/pr68493.c b/gcc/testsuite/gcc.dg/graphite/pr68493.c
new file mode 100644 (file)
index 0000000..95f3699
--- /dev/null
@@ -0,0 +1,34 @@
+/* { dg-options "-O1 -floop-nest-optimize" } */
+
+int ce[2];
+int o5;
+int p7;
+
+int foo (void)
+{
+  int j1;
+  ce[0] = 0;
+  for (j1 = 0; j1 < 2; ++j1)
+    for (o5 = 1; o5 >= 0; --o5)
+      p7 += ce[o5];
+  return 0;
+}
+
+int du;
+
+int bar (void)
+{
+  int u7[2];
+  int ar;
+
+  for (ar = 0; ar < 2; ++ar) {
+    int xo;
+
+    for (xo = 0; xo < 2; ++xo) {
+      du += u7[ar];
+      u7[0] = 0;
+    }
+  }
+
+  return 0;
+}