re PR tree-optimization/69574 (gcc ICE at -O2 and -O3 on x86_64-linux-gnu in hide_evo...
authorRichard Biener <rguenther@suse.de>
Mon, 1 Feb 2016 15:38:08 +0000 (15:38 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 1 Feb 2016 15:38:08 +0000 (15:38 +0000)
2016-02-01  Richard Biener  <rguenther@suse.de>

PR tree-optimization/69574
* tree-chrec.c (hide_evolution_in_other_loops_than_loop): Instead
of asserting return chrec_dont_know.

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

From-SVN: r233039

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr69574.c [new file with mode: 0644]
gcc/tree-chrec.c

index a38044049e316f34f2c64b4819493b90c6dac574..15baad3a186899f19470ed648d06ac116850e139 100644 (file)
@@ -1,3 +1,9 @@
+2016-02-01  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/69574
+       * tree-chrec.c (hide_evolution_in_other_loops_than_loop): Instead
+       of asserting return chrec_dont_know.
+
 2016-02-01  Martin Liska  <mliska@suse.cz>
 
        * mem-stats-traits.h: Add copyright header.
index 0c1df5e3aa65383a79c1fc34448d5d8664f8b323..68278d13f851863d0f24bbdefcb2acad64d774c1 100644 (file)
@@ -1,3 +1,8 @@
+2016-02-01  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/69574
+       * gcc.dg/torture/pr69574.c: New testcase.
+
 2016-02-01  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/69579
diff --git a/gcc/testsuite/gcc.dg/torture/pr69574.c b/gcc/testsuite/gcc.dg/torture/pr69574.c
new file mode 100644 (file)
index 0000000..feaac24
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+typedef unsigned mytype;
+
+struct S {
+    mytype *pu;
+};
+
+mytype f(struct S *e)
+{
+  mytype x;
+  if(&x != e->pu)
+    __builtin_memcpy(&x, e->pu, sizeof(unsigned));
+  return x;
+}
index 264c1050c8c9b42d8a78c9a17f19025f6b21b1d5..7a2e10004d3dcf3a6c75da26ed6a5ce6a099cd95 100644 (file)
@@ -728,12 +728,12 @@ hide_evolution_in_other_loops_than_loop (tree chrec,
        /* There is no evolution in this loop.  */
        return initial_condition (chrec);
 
+      else if (flow_loop_nested_p (loop, chloop))
+       return hide_evolution_in_other_loops_than_loop (CHREC_LEFT (chrec),
+                                                       loop_num);
+
       else
-       {
-         gcc_assert (flow_loop_nested_p (loop, chloop));
-         return hide_evolution_in_other_loops_than_loop (CHREC_LEFT (chrec),
-                                                         loop_num);
-       }
+       return chrec_dont_know;
 
     default:
       return chrec;