re PR tree-optimization/81369 (ICE in generate_code_for_partition)
authorBin Cheng <bin.cheng@arm.com>
Mon, 17 Jul 2017 11:38:15 +0000 (11:38 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Mon, 17 Jul 2017 11:38:15 +0000 (11:38 +0000)
PR target/81369
* tree-loop-distribution.c (merge_dep_scc_partitions): Sink call to
function sort_partitions_by_post_order.

gcc/testsuite
* gcc.dg/tree-ssa/pr81369.c: New.

From-SVN: r250269

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr81369.c [new file with mode: 0644]
gcc/tree-loop-distribution.c

index 841f22616f1082d4510a068cb870d8d1f44b3119..1b826782150e5f733f19a7bd3cff648a50f2d3de 100644 (file)
@@ -1,3 +1,9 @@
+2017-07-17  Bin Cheng  <bin.cheng@arm.com>
+
+       PR target/81369
+       * tree-loop-distribution.c (merge_dep_scc_partitions): Sink call to
+       function sort_partitions_by_post_order.
+
 2017-07-17  Bin Cheng  <bin.cheng@arm.com>
 
        PR tree-optimization/81374
index 68c718ed5c299e996ff16aa9cda140e750d5433b..22f6fdb18101e86b3213de4b0234010ca3758fd0 100644 (file)
@@ -1,3 +1,8 @@
+2017-07-17  Bin Cheng  <bin.cheng@arm.com>
+
+       PR target/81369
+       * gcc.dg/tree-ssa/pr81369.c: New.
+
 2017-07-17  Claudiu Zissulescu  <claziss@synopsys.com>
 
        * gcc.target/arc/pr9000674901.c: New file.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr81369.c b/gcc/testsuite/gcc.dg/tree-ssa/pr81369.c
new file mode 100644 (file)
index 0000000..b40477b
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution" } */
+
+typedef __PTRDIFF_TYPE__ intptr_t;
+int wo;
+
+void
+sy (long int *as)
+{
+  for (;;)
+    {
+      *as = wo;
+      while (as < (long int *) (void *) 2)
+        {
+          int *y9;
+
+          if (wo != 0)
+            *y9 = (int) (intptr_t) &wo;
+          wo /= (wo != 0 && *y9 != 0);
+          ++as;
+        }
+    }
+}
index 5c8f29dc36fb825c8c68f891258b784905fb6599..9363c1de683dcbda0e47ec28776bc46eff54bd58 100644 (file)
@@ -1997,8 +1997,9 @@ merge_dep_scc_partitions (struct graph *rdg,
                data->partition = NULL;
              }
        }
-      sort_partitions_by_post_order (pg, partitions);
     }
+
+  sort_partitions_by_post_order (pg, partitions);
   gcc_assert (partitions->length () == (unsigned)num_sccs);
   free_partition_graph_vdata (pg);
   free_graph (pg);