aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.cc
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2023-02-01 11:46:18 -0500
committerAndrew MacLeod <amacleod@redhat.com>2023-02-03 14:42:46 -0500
commit093e2e1b201c0f324e0d8bfe6487aa2d470a13e7 (patch)
tree59daf97769e66402dfe7cbf4467c3e545cbf0864 /gcc/tree-vrp.cc
parent27ac6a707e7438c3cec79c24f5d53de79493e2f8 (diff)
downloadgcc-093e2e1b201c0f324e0d8bfe6487aa2d470a13e7.zip
gcc-093e2e1b201c0f324e0d8bfe6487aa2d470a13e7.tar.gz
gcc-093e2e1b201c0f324e0d8bfe6487aa2d470a13e7.tar.bz2
Reset SCEV before removing unreachable globals.
SCEV should be reset in VRP before trying to remove unreachable globals to avoid triggering issues with it's cache. PR tree-optimization/107570 gcc/ * tree-vrp.cc (remove_and_update_globals): Reset SCEV. gcc/testsuite/ * gcc.dg/pr107570.c: New.
Diffstat (limited to 'gcc/tree-vrp.cc')
-rw-r--r--gcc/tree-vrp.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc
index 3c43176..95547e5 100644
--- a/gcc/tree-vrp.cc
+++ b/gcc/tree-vrp.cc
@@ -121,6 +121,10 @@ remove_unreachable::remove_and_update_globals (bool final_p)
if (m_list.length () == 0)
return false;
+ // Ensure the cache in SCEV has been cleared before processing
+ // globals to be removed.
+ scev_reset ();
+
bool change = false;
tree name;
unsigned i;