public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/114604] New: Ranger allocates from uninitialized bitmap_default_obstack
@ 2024-04-05 13:06 rguenth at gcc dot gnu.org
  2024-04-05 13:10 ` [Bug middle-end/114604] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-05 13:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114604

            Bug ID: 114604
           Summary: Ranger allocates from uninitialized
                    bitmap_default_obstack
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

Visible at least from gcc.dg/torture/pr52429.c when instrumenting
bitmap_alloc with

bitmap
bitmap_alloc (bitmap_obstack *bit_obstack MEM_STAT_DECL)
{
  bitmap map;

  if (!bit_obstack)
    {
      gcc_assert (bitmap_default_obstack_depth > 0);
      bit_obstack = &bitmap_default_obstack;

gcc.dg/torture/pr52429.c:24:1: internal compiler error: in bitmap_alloc, at
bitmap.cc:785^M
0xf3d95b bitmap_alloc(bitmap_obstack*)^M
        /home/rguenther/src/trunk/gcc/bitmap.cc:785^M
0x2e89005 update_list::update_list()^M
        /home/rguenther/src/trunk/gcc/gimple-range-cache.cc:900^M
0x2e893a2 ranger_cache::ranger_cache(int, bool)^M
        /home/rguenther/src/trunk/gcc/gimple-range-cache.cc:976^M
0x2e815a9 gimple_ranger::gimple_ranger(bool)^M
        /home/rguenther/src/trunk/gcc/gimple-range.cc:44^M
0x2e83e88 enable_ranger(function*, bool)^M
        /home/rguenther/src/trunk/gcc/gimple-range.cc:693^M
0x13bfd62 ipa_analyze_node(cgraph_node*)^M
        /home/rguenther/src/trunk/gcc/ipa-prop.cc:3191^M

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/114604] Ranger allocates from uninitialized bitmap_default_obstack
  2024-04-05 13:06 [Bug middle-end/114604] New: Ranger allocates from uninitialized bitmap_default_obstack rguenth at gcc dot gnu.org
@ 2024-04-05 13:10 ` rguenth at gcc dot gnu.org
  2024-04-05 13:14 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-05 13:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114604

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org,
                   |                            |amacleod at redhat dot com
           Keywords|                            |ice-on-valid-code

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
It looks like ranger initializes a few bitmap obstacks, if there's no
convenient
ranger-wide one then calling

bitmap_obstack_initialize (NULL);

from enable_ranger and

bitmap_obstack_release (NULL);

from disable_ranger would initialize the global one (those handle nesting
from other callers).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/114604] Ranger allocates from uninitialized bitmap_default_obstack
  2024-04-05 13:06 [Bug middle-end/114604] New: Ranger allocates from uninitialized bitmap_default_obstack rguenth at gcc dot gnu.org
  2024-04-05 13:10 ` [Bug middle-end/114604] " rguenth at gcc dot gnu.org
@ 2024-04-05 13:14 ` rguenth at gcc dot gnu.org
  2024-04-08  9:49 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-05 13:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114604

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 57887
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57887&action=edit
BITMAP_ALLOC instrumentation

This is the instrumentation patch.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/114604] Ranger allocates from uninitialized bitmap_default_obstack
  2024-04-05 13:06 [Bug middle-end/114604] New: Ranger allocates from uninitialized bitmap_default_obstack rguenth at gcc dot gnu.org
  2024-04-05 13:10 ` [Bug middle-end/114604] " rguenth at gcc dot gnu.org
  2024-04-05 13:14 ` rguenth at gcc dot gnu.org
@ 2024-04-08  9:49 ` rguenth at gcc dot gnu.org
  2024-04-09  6:46 ` cvs-commit at gcc dot gnu.org
  2024-04-09  6:50 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-08  9:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114604

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
   Last reconfirmed|                            |2024-04-08
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Posted a patch.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/114604] Ranger allocates from uninitialized bitmap_default_obstack
  2024-04-05 13:06 [Bug middle-end/114604] New: Ranger allocates from uninitialized bitmap_default_obstack rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-04-08  9:49 ` rguenth at gcc dot gnu.org
@ 2024-04-09  6:46 ` cvs-commit at gcc dot gnu.org
  2024-04-09  6:50 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-09  6:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114604

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/114604] Ranger allocates from uninitialized bitmap_default_obstack
  2024-04-05 13:06 [Bug middle-end/114604] New: Ranger allocates from uninitialized bitmap_default_obstack rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-04-09  6:46 ` cvs-commit at gcc dot gnu.org
@ 2024-04-09  6:50 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-09  6:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114604

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |14.0

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-09  6:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05 13:06 [Bug middle-end/114604] New: Ranger allocates from uninitialized bitmap_default_obstack rguenth at gcc dot gnu.org
2024-04-05 13:10 ` [Bug middle-end/114604] " rguenth at gcc dot gnu.org
2024-04-05 13:14 ` rguenth at gcc dot gnu.org
2024-04-08  9:49 ` rguenth at gcc dot gnu.org
2024-04-09  6:46 ` cvs-commit at gcc dot gnu.org
2024-04-09  6:50 ` rguenth at gcc dot gnu.org

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).