diff mbox series

PR tree-optimization/116588 - Before running fast VRP, make sure all edges have, EXECUTABLE set.

Message ID 53b44a35-fdf6-47bd-ac06-ee1b584d6dd3@redhat.com
State New
Headers show
Series PR tree-optimization/116588 - Before running fast VRP, make sure all edges have, EXECUTABLE set. | expand

Commit Message

Andrew MacLeod Sept. 7, 2024, 5:58 p.m. UTC
It appears when we run the fast VRP algorithm, I was neglecting to set 
all the edges to executable before starting, so a little garbage was 
sneaking in once in a while...

Fixed by calling the same routine regular VRP calls to do this.

Bootstraps on x86_64-pc-linux-gnu with no regressions.   Pushed.

Andrew
diff mbox series

Patch

From 73356860e2e96cf3319de8f11eed74fd9ff80c65 Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <amacleod@redhat.com>
Date: Fri, 6 Sep 2024 11:42:14 -0400
Subject: [PATCH 5/5] Before running fast VRP, make sure all edges have
 EXECUTABLE set.

	PR tree-optimization/116588
	gcc/
	* tree-vrp.cc (execute_fast_vrp): Start with all edges executable.
	gcc/testsuite/
	* gcc.dg/pr116588.c: New.
---
 gcc/testsuite/gcc.dg/pr116588.c | 31 +++++++++++++++++++++++++++++++
 gcc/tree-vrp.cc                 |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/pr116588.c

diff --git a/gcc/testsuite/gcc.dg/pr116588.c b/gcc/testsuite/gcc.dg/pr116588.c
new file mode 100644
index 00000000000..677964dd1d6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr116588.c
@@ -0,0 +1,31 @@ 
+/* PR tree-optimization/116588 */
+/* { dg-do run { target bitint575 } } */
+/* { dg-options "-O2 -fno-vect-cost-model -fno-tree-dominator-opts -fno-tree-fre --param=vrp-block-limit=0  -DDEBUG -fdump-tree-vrp2-details" } */
+
+int a;
+__int128 b, c;
+
+__int128
+foo (_BitInt (129) e)
+{
+  _BitInt (129) f = e << (128 - c);
+  __builtin_memset (&b, a, 4);
+  __int128 r = e + f;
+  return r;
+}
+
+int
+main ()
+{
+  __int128 x = foo (0);
+#ifdef DEBUG
+  for (unsigned i = 0; i < sizeof (x); i++)
+    __builtin_printf ("%02x", i[(volatile unsigned char *) &x]);
+  __builtin_printf("\n");
+#else
+  if (x)
+    __builtin_abort();
+#endif
+}
+
+/* { dg-final { scan-tree-dump-not "0 != 0" "vrp2" } } */
diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc
index e184e9af51e..975e71f7725 100644
--- a/gcc/tree-vrp.cc
+++ b/gcc/tree-vrp.cc
@@ -1258,6 +1258,7 @@  execute_fast_vrp (struct function *fun, bool final_p)
   fvrp_folder folder (&dr, final_p);
 
   gcc_checking_assert (!fun->x_range_query);
+  set_all_edges_as_executable (fun);
   fun->x_range_query = &dr;
   // Create a relation oracle without transitives.
   get_range_query (fun)->create_relation_oracle (false);
-- 
2.45.0