aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-02-16 08:16:17 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-02-16 08:16:17 +0000
commit4cf55739fd30044f489c728aaacd7cae69adef59 (patch)
tree4380c4aa5bbdb48c445fa6d19a49572086ffa275 /gcc
parentbd74f4d876ffa7090603bb5d317d7b6e52df43c0 (diff)
downloadgcc-4cf55739fd30044f489c728aaacd7cae69adef59.zip
gcc-4cf55739fd30044f489c728aaacd7cae69adef59.tar.gz
gcc-4cf55739fd30044f489c728aaacd7cae69adef59.tar.bz2
re PR tree-optimization/84399 ([graphite] ICE in set_codegen_error, at graphite-isl-ast-to-gimple.c:206)
2018-02-16 Richard Biener <rguenther@suse.de> PR tree-optimization/84399 * graphite-scop-detection.c (scop_detection::stmt_simple_for_scop_p): For operands we can analyze at their definition make sure we can analyze them at each use as well. * gcc.dg/graphite/pr84399.c: New testcase. From-SVN: r257723
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/graphite-scop-detection.c18
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr84399.c23
4 files changed, 52 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8ca7fba..f97986b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2018-02-16 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/84399
+ * graphite-scop-detection.c (scop_detection::stmt_simple_for_scop_p):
+ For operands we can analyze at their definition make sure we can
+ analyze them at each use as well.
+
+2018-02-16 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/84190
* tree-ssa.c (non_rewritable_mem_ref_base): Do not touch
volatile accesses if the decl isn't volatile.
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 43716f1..70cb773 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -1027,7 +1027,23 @@ scop_detection::stmt_simple_for_scop_p (sese_l scop, gimple *stmt,
case GIMPLE_ASSIGN:
case GIMPLE_CALL:
- return true;
+ {
+ tree op;
+ ssa_op_iter i;
+ /* Verify that if we can analyze operands at their def site we
+ also can represent them when analyzed at their uses. */
+ FOR_EACH_SSA_TREE_OPERAND (op, stmt, i, SSA_OP_USE)
+ if (scev_analyzable_p (op, scop)
+ && !graphite_can_represent_expr (scop, bb->loop_father, op))
+ {
+ DEBUG_PRINT (dp << "[scop-detection-fail] "
+ << "Graphite cannot represent stmt:\n";
+ print_gimple_stmt (dump_file, stmt, 0,
+ TDF_VOPS | TDF_MEMSYMS));
+ return false;
+ }
+ return true;
+ }
default:
/* These nodes cut a new scope. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8c0e0f0..772879f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2018-02-16 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/84399
+ * gcc.dg/graphite/pr84399.c: New testcase.
+
+2018-02-16 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/84190
* g++.dg/torture/pr84190.C: New testcase.
diff --git a/gcc/testsuite/gcc.dg/graphite/pr84399.c b/gcc/testsuite/gcc.dg/graphite/pr84399.c
new file mode 100644
index 0000000..4b142df
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr84399.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-nest-optimize -fno-tree-loop-im --param scev-max-expr-size=1" } */
+
+void
+h8 (int cv, int od)
+{
+ for (;;)
+ {
+ int ih = (__UINTPTR_TYPE__)&od;
+ if (cv == 0)
+ while (od < 1)
+ {
+ int lq;
+
+ for (lq = 0; lq < 3; ++lq)
+ for (ih = 0; ih < 4; ++ih)
+ od += lq;
+ }
+ while (ih < 1)
+ {
+ }
+ }
+}