public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] tree-optimization/102940 - Reset scev before invoking array_checker.
@ 2021-10-28 14:50 Andrew MacLeod
  0 siblings, 0 replies; only message in thread
From: Andrew MacLeod @ 2021-10-28 14:50 UTC (permalink / raw)
  To: gcc-patches

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

As pointed out, we need to reset scev before invoking the array-checker 
in execute_ranger_vrp.

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

Andrew



[-- Attachment #2: 0001-Reset-scev-before-invoking-array_checker.patch --]
[-- Type: text/x-patch, Size: 1213 bytes --]

From d46aeb5906b8ed7ee255cfbacc5cf9d2f56b850c Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <amacleod@redhat.com>
Date: Tue, 26 Oct 2021 14:43:33 -0400
Subject: [PATCH 1/3] Reset scev before invoking array_checker.

Before invoking the array_checker, we need to reset scev so it will not try to
access any ssa_names that the substitute and fold engine has freed.

	PR tree-optimization/102940
	* tree-vrp.c (execute_ranger_vrp): Reset scev.
---
 gcc/tree-vrp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 38ea50303e0..dc3e250537a 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -4351,7 +4351,6 @@ execute_ranger_vrp (struct function *fun, bool warn_array_bounds_p)
   if (dump_file && (dump_flags & TDF_DETAILS))
     ranger->dump (dump_file);
 
-
   if (warn_array_bounds && warn_array_bounds_p)
     {
       // Set all edges as executable, except those ranger says aren't.
@@ -4367,6 +4366,7 @@ execute_ranger_vrp (struct function *fun, bool warn_array_bounds_p)
 	    else
 	      e->flags |= EDGE_EXECUTABLE;
 	}
+      scev_reset ();
       array_bounds_checker array_checker (fun, ranger);
       array_checker.check ();
     }
-- 
2.17.2


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

only message in thread, other threads:[~2021-10-28 14:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 14:50 [COMMITTED] tree-optimization/102940 - Reset scev before invoking array_checker Andrew MacLeod

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