public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: GCC patches <gcc-patches@gcc.gnu.org>
Cc: Jakub Jelinek <jakub@redhat.com>,
	Andrew MacLeod <amacleod@redhat.com>,
	Aldy Hernandez <aldyh@redhat.com>
Subject: [PATCH] ranger: Grow BBs in relation oracle as needed [PR113735]
Date: Tue,  6 Feb 2024 13:28:06 +0100	[thread overview]
Message-ID: <20240206122820.223856-1-aldyh@redhat.com> (raw)

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.

OK for trunk?

	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 | 19 +++++++++++++++++++
 gcc/value-relation.cc                    |  1 +
 2 files changed, 20 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr113735.c

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr113735.c b/gcc/testsuite/gcc.dg/tree-ssa/pr113735.c
new file mode 100644
index 00000000000..7b864999277
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr113735.c
@@ -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
diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc
index 27f9ad61c0e..619ee5f0867 100644
--- a/gcc/value-relation.cc
+++ b/gcc/value-relation.cc
@@ -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,
-- 
2.43.0


             reply	other threads:[~2024-02-06 12:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 12:28 Aldy Hernandez [this message]
2024-02-07 15:30 ` Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240206122820.223856-1-aldyh@redhat.com \
    --to=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).