]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Grow non_null_ref bitmap when num_ssa_names increases.
authorAldy Hernandez <aldyh@redhat.com>
Fri, 8 Oct 2021 13:42:42 +0000 (15:42 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Fri, 8 Oct 2021 14:36:00 +0000 (16:36 +0200)
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.

gcc/gimple-range-cache.cc

index 7d994798e523b141cdba58f421a4a1b02a4e42b1..9cbc63d8a405f45aa3a6cd478c5b73add5800d10 100644 (file)
@@ -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);