re PR middle-end/89677 (internal compiler error: in wide_int_to_tree_1, at tree.c...
authorRichard Biener <rguenther@suse.de>
Wed, 13 Mar 2019 11:32:11 +0000 (11:32 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 13 Mar 2019 11:32:11 +0000 (11:32 +0000)
2019-03-13  Richard Biener  <rguenther@suse.de>

PR middle-end/89677
* tree-scalar-evolution.c (simplify_peeled_chrec): Do not
throw FP expressions at tree-affine.

* gcc.dg/torture/pr89677.c: New testcase.

From-SVN: r269646

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr89677.c [new file with mode: 0644]
gcc/tree-scalar-evolution.c

index 73b62b2c91795c9188a587fb9428eae08869c26e..86e210b4e272e60747431d48b1188e0bade5d1c8 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-13  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/89677
+       * tree-scalar-evolution.c (simplify_peeled_chrec): Do not
+       throw FP expressions at tree-affine.
+
 2019-03-14  Richard Biener  <rguenther@suse.de>
 
        * tree-pretty-print.c (dump_generic_node): For -gimple properly
index 2439836d647417b6f74d25a1ed8cb4fa0d56af2f..a61b668d2e1b167f13723b9edaa41461b836719f 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-13  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/89677
+       * gcc.dg/torture/pr89677.c: New testcase.
+
 2019-03-13  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/85558
diff --git a/gcc/testsuite/gcc.dg/torture/pr89677.c b/gcc/testsuite/gcc.dg/torture/pr89677.c
new file mode 100644 (file)
index 0000000..a45ca1f
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+
+int a, b, d;
+unsigned c;
+float e, f, g;
+void h() {
+    float *i = &g;
+    for (; c < 10; c += 3)
+      for (; d; d += 3) {
+         a = *i;
+         g = f + 0;
+         f = b + *i + (b - e + 305219) + -b + 3;
+      }
+}
index 3de559047dae8e7ac881c9520b242ac99e1344e2..c814437c2393c3948127df63ce8e0ef820a97125 100644 (file)
@@ -1456,6 +1456,11 @@ simplify_peeled_chrec (struct loop *loop, tree arg, tree init_cond)
       return build_polynomial_chrec (loop->num, init_cond, right);
     }
 
+  /* The affine code only deals with pointer and integer types.  */
+  if (!POINTER_TYPE_P (type)
+      && !INTEGRAL_TYPE_P (type))
+    return chrec_dont_know;
+
   /* Try harder to check if they are equal.  */
   tree_to_aff_combination_expand (left, type, &aff1, &peeled_chrec_map);
   tree_to_aff_combination_expand (step_val, type, &aff2, &peeled_chrec_map);