This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/3] [graphite] fix PR68493: bail out when codegen_error is set


---
 gcc/graphite-isl-ast-to-gimple.c        |  2 ++
 gcc/testsuite/gcc.dg/graphite/pr68493.c | 34 +++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/pr68493.c

diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index 30c3a21..2783ac4 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -2760,6 +2760,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;
     }
 }
 
diff --git a/gcc/testsuite/gcc.dg/graphite/pr68493.c b/gcc/testsuite/gcc.dg/graphite/pr68493.c
new file mode 100644
index 0000000..95f3699
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr68493.c
@@ -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;
+}
-- 
1.9.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]