[COMMITTED] Grow non_null_ref bitmap when num_ssa_names increases.

Message ID 20211008143518.34497-2-aldyh@redhat.com
State Committed
Commit 946486ab4f84a5380e1a18e37e4fb9614f5d7992
Headers
Series [COMMITTED] Grow non_null_ref bitmap when num_ssa_names increases. |

Commit Message

Aldy Hernandez Oct. 8, 2021, 2:35 p.m. UTC
  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 | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc
index 7d994798e52..9cbc63d8a40 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);