* [PATCH] Fix PR83238
@ 2017-12-04 8:25 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2017-12-04 8:25 UTC (permalink / raw)
To: gcc-patches
This fixes PR83238, biitstrapped and tested on x86_64-unknown-linux-gnu,
applied.
Richard.
2017-12-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/83238
* graphite-scop-detection.c (scop_detection::merge_sese): Make
code match comment, rejecting invalid SESE regions.
* gcc.dg/graphite/pr83238.c: New testcase.
Index: gcc/graphite-scop-detection.c
===================================================================
--- gcc/graphite-scop-detection.c (revision 255309)
+++ gcc/graphite-scop-detection.c (working copy)
@@ -570,8 +570,7 @@ scop_detection::merge_sese (sese_l first
which post-dominates dom, until it stabilizes. Also, ENTRY->SRC and
EXIT->DEST should be in the same loop nest. */
if (!dominated_by_p (CDI_DOMINATORS, pdom, dom)
- || loop_depth (entry->src->loop_father)
- != loop_depth (exit->dest->loop_father))
+ || entry->src->loop_father != exit->dest->loop_father)
return invalid_sese;
/* For now we just bail out when there is a loop exit in the region
Index: gcc/testsuite/gcc.dg/graphite/pr83238.c
===================================================================
--- gcc/testsuite/gcc.dg/graphite/pr83238.c (nonexistent)
+++ gcc/testsuite/gcc.dg/graphite/pr83238.c (working copy)
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-parallelize-all" } */
+
+void
+vw (int *dk, int zd, int jb)
+{
+ int sq;
+ int *kv = &sq;
+
+ for (sq = 0; sq < 2; ++sq)
+ {
+ int u1;
+
+ for (u1 = 0; u1 < 5; ++u1)
+ if (zd == 0)
+ return;
+ }
+
+ for (;;)
+ {
+ ++zd;
+ if (zd == 0)
+ while (jb != 0)
+ kv = &jb;
+
+ while (*dk < 1)
+ {
+ for (jb = 0; jb < 2; ++jb)
+ {
+ }
+ ++*dk;
+ }
+
+ for (*kv = 0; *kv < 2; ++*kv)
+ for (*dk = 0; *dk < 2; ++*dk)
+ {
+ }
+ }
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-12-04 8:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-04 8:25 [PATCH] Fix PR83238 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).