public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH PR81369/01]Sort partitions by post order for all cases
@ 2017-07-14 14:32 Bin Cheng
  2017-07-17 10:11 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Bin Cheng @ 2017-07-14 14:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd

[-- Attachment #1: Type: text/plain, Size: 580 bytes --]

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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-pr81369-1.txt.patch --]
[-- Type: text/x-patch; name="0001-pr81369-1.txt.patch", Size: 1588 bytes --]

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH PR81369/01]Sort partitions by post order for all cases
  2017-07-14 14:32 [PATCH PR81369/01]Sort partitions by post order for all cases Bin Cheng
@ 2017-07-17 10:11 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2017-07-17 10:11 UTC (permalink / raw)
  To: Bin Cheng; +Cc: gcc-patches, nd

On Fri, Jul 14, 2017 at 4:31 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> 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?

Ok.

Richard.

> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-17 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-14 14:32 [PATCH PR81369/01]Sort partitions by post order for all cases Bin Cheng
2017-07-17 10:11 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).