public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] tree-optimization/95856 fix vect_stmt_dominates_stmt_p at BB region boundary
@ 2020-06-24 10:58 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2020-06-24 10:58 UTC (permalink / raw)
  To: gcc-patches

The following adjusts vect_stmt_dominates_stmt_p to honor out-of-region
stmts we run into which have UID -1u.

Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.

Richard.

2020-06-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/95856
	* tree-vectorizer.c (vect_stmt_dominates_stmt_p): Honor
	region marker -1u.

	* gcc.dg/vect/pr95856.c: New testcase.
---
 gcc/testsuite/gcc.dg/vect/pr95856.c | 20 ++++++++++++++++++++
 gcc/tree-vectorizer.c               |  4 ++++
 2 files changed, 24 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/vect/pr95856.c

diff --git a/gcc/testsuite/gcc.dg/vect/pr95856.c b/gcc/testsuite/gcc.dg/vect/pr95856.c
new file mode 100644
index 00000000000..19a86a62d95
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr95856.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+typedef struct {
+  float xmin, xmax;
+} rctf;
+
+typedef struct {
+  rctf tot;
+} View2D;
+
+View2D graph_main_area_draw_v2d;
+
+void get_graph_keyframe_extents();
+
+void
+graph_main_area_draw() {
+  get_graph_keyframe_extents();
+  graph_main_area_draw_v2d.tot.xmin -= 10.0f;
+  graph_main_area_draw_v2d.tot.xmax += 10.0f;
+}
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index e262ba0580e..78d9da689c8 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -752,6 +752,8 @@ vect_stmt_dominates_stmt_p (gimple *s1, gimple *s2)
       if (gsi_stmt (gsi1) == s2)
 	return true;
     }
+  if (gimple_uid (gsi_stmt (gsi1)) == -1u)
+    return false;
 
   gimple_stmt_iterator gsi2 = gsi_for_stmt (s2);
   while (gimple_uid (gsi_stmt (gsi2)) == 0)
@@ -762,6 +764,8 @@ vect_stmt_dominates_stmt_p (gimple *s1, gimple *s2)
       if (gsi_stmt (gsi2) == s1)
 	return true;
     }
+  if (gimple_uid (gsi_stmt (gsi2)) == -1u)
+    return false;
 
   if (gimple_uid (gsi_stmt (gsi1)) <= gimple_uid (gsi_stmt (gsi2)))
     return true;
-- 
2.26.2

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-24 10:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 10:58 [PATCH] tree-optimization/95856 fix vect_stmt_dominates_stmt_p at BB region boundary 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).