aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2021-10-08 15:42:42 +0200
committerAldy Hernandez <aldyh@redhat.com>2021-10-08 16:36:00 +0200
commit946486ab4f84a5380e1a18e37e4fb9614f5d7992 (patch)
tree0a0de84d1d3afb1d1ecad7daf066e25196e4659e
parent4d9070315aac4065a6ece3a6cffd83c386f01dd9 (diff)
downloadgcc-946486ab4f84a5380e1a18e37e4fb9614f5d7992.zip
gcc-946486ab4f84a5380e1a18e37e4fb9614f5d7992.tar.gz
gcc-946486ab4f84a5380e1a18e37e4fb9614f5d7992.tar.bz2
Grow non_null_ref bitmap when num_ssa_names increases.
The strlen pass changes the IL as it works with the ranger. This causes the non_null_ref code to sometimes get asked questions about new SSA names. Tested on x86-64 Linux. gcc/ChangeLog: * gimple-range-cache.cc (non_null_ref::non_null_deref_p): Grow bitmap if needed.
-rw-r--r--gcc/gimple-range-cache.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc
index 7d99479..9cbc63d 100644
--- a/gcc/gimple-range-cache.cc
+++ b/gcc/gimple-range-cache.cc
@@ -61,6 +61,9 @@ non_null_ref::non_null_deref_p (tree name, basic_block bb, bool search_dom)
return false;
unsigned v = SSA_NAME_VERSION (name);
+ if (v >= m_nn.length ())
+ m_nn.safe_grow_cleared (num_ssa_names + 1);
+
if (!m_nn[v])
process_name (name);