This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH PR81369/01]Sort partitions by post order for all cases
- From: Bin Cheng <Bin dot Cheng at arm dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: nd <nd at arm dot com>
- Date: Fri, 14 Jul 2017 14:31:54 +0000
- Subject: [PATCH PR81369/01]Sort partitions by post order for all cases
- Authentication-results: sourceware.org; auth=none
- Authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi,
This patch fixes ICE reported by PR81369. It simply sinks call to
sort_partitions_by_post_order so that it's executed for all cases.
This is necessary to schedule reduction partition as the last one.
Bootstrap and test on x86_64 and AArch64. Is it OK?
Thanks,
bin
2017-07-12 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.
gcc/testsuite/ChangeLog
2017-07-12 Bin Cheng <bin.cheng@arm.com>
PR target/81369
* gcc.dg/tree-ssa/pr81369.c: New.
From 685bab237e38544375dcc9a950ae2816b8e4385b Mon Sep 17 00:00:00 2001
From: Bin Cheng <binche01@e108451-lin.cambridge.arm.com>
Date: Wed, 12 Jul 2017 12:04:49 +0100
Subject: [PATCH 1/2] pr81369-1.txt
---
gcc/testsuite/gcc.dg/tree-ssa/pr81369.c | 23 +++++++++++++++++++++++
gcc/tree-loop-distribution.c | 3 ++-
2 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr81369.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr81369.c b/gcc/testsuite/gcc.dg/tree-ssa/pr81369.c
new file mode 100644
index 0000000..b40477b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr81369.c
@@ -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;
+ }
+ }
+}
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index be0a660..fe678a5 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -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);
--
1.9.1