Reset scev before invoking array_checker.
authorAndrew MacLeod <amacleod@redhat.com>
Tue, 26 Oct 2021 18:43:33 +0000 (14:43 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 28 Oct 2021 14:48:38 +0000 (10:48 -0400)
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

index 38ea503..dc3e250 100644 (file)
@@ -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 ();
     }