public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-9855] middle-end/114604 - ranger allocates bitmap without initialized obstack
Date: Tue,  9 Apr 2024 06:46:38 +0000 (GMT)	[thread overview]
Message-ID: <20240409064638.EB8BD3858CD1@sourceware.org> (raw)

https://gcc.gnu.org/g:d76df699b8ff792575e9df4d214c21fed0ed3b6b

commit r14-9855-gd76df699b8ff792575e9df4d214c21fed0ed3b6b
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Apr 8 10:50:18 2024 +0200

    middle-end/114604 - ranger allocates bitmap without initialized obstack
    
    The following fixes ranger bitmap allocation when invoked from IPA
    context where the global bitmap obstack possibly isn't initialized.
    Instead of trying to use one of the ranger obstacks the following
    simply initializes the global bitmap obstack around an active ranger.
    
            PR middle-end/114604
            * gimple-range.cc (enable_ranger): Initialize the global
            bitmap obstack.
            (disable_ranger): Release it.

Diff:
---
 gcc/gimple-range.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
index c16b776c1e3..4d3b1ce8588 100644
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -689,6 +689,8 @@ enable_ranger (struct function *fun, bool use_imm_uses)
 {
   gimple_ranger *r;
 
+  bitmap_obstack_initialize (NULL);
+
   gcc_checking_assert (!fun->x_range_query);
   r = new gimple_ranger (use_imm_uses);
   fun->x_range_query = r;
@@ -705,6 +707,8 @@ disable_ranger (struct function *fun)
   gcc_checking_assert (fun->x_range_query);
   delete fun->x_range_query;
   fun->x_range_query = NULL;
+
+  bitmap_obstack_release (NULL);
 }
 
 // ------------------------------------------------------------------------

                 reply	other threads:[~2024-04-09  6:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240409064638.EB8BD3858CD1@sourceware.org \
    --to=rguenth@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).