]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ranger: Grow BBs in relation oracle as needed [PR113735]
authorAldy Hernandez <aldyh@redhat.com>
Tue, 6 Feb 2024 09:22:30 +0000 (10:22 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Thu, 8 Feb 2024 13:21:17 +0000 (14:21 +0100)
The relation oracle grows the internal vector of SSAs as needed, but
due to an oversight was not growing the basic block vector.  This
fixes the oversight.

PR tree-optimization/113735

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/pr113735.c: New test.

gcc/ChangeLog:

* value-relation.cc (equiv_oracle::add_equiv_to_block): Call
limit_check().

gcc/testsuite/gcc.dg/tree-ssa/pr113735.c [new file with mode: 0644]
gcc/value-relation.cc

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr113735.c b/gcc/testsuite/gcc.dg/tree-ssa/pr113735.c
new file mode 100644 (file)
index 0000000..7b86499
--- /dev/null
@@ -0,0 +1,19 @@
+// { dg-do compile { target bitint } }
+// { dg-options "-O1" }
+
+char b;
+void bar (void);
+
+#if __BITINT_MAXWIDTH__ >= 6110
+void
+foo (_BitInt(6110) j)
+{
+  for (;;)
+    {
+      _BitInt(10) k = b % j;
+      for (j = 6; j; --j)
+        if (k)
+          bar ();
+    }
+}
+#endif
index 27f9ad61c0ec042a43372f068a87a46106447a0d..619ee5f08673a69c4fc795a43697ff1d2b03eb66 100644 (file)
@@ -718,6 +718,7 @@ equiv_oracle::add_equiv_to_block (basic_block bb, bitmap equiv_set)
 
   // Check if this is the first time a block has an equivalence added.
   // and create a header block. And set the summary for this block.
+  limit_check (bb);
   if (!m_equiv[bb->index])
     {
       ptr = (equiv_chain *) obstack_alloc (&m_chain_obstack,