public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/97554] ICE: during RTL pass: cprop /segfault in sbitmap
Date: Mon, 26 Oct 2020 08:05:33 +0000	[thread overview]
Message-ID: <bug-97554-4-xtNshoVOZ6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97554-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-10-26
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  We're doing

#1  0x0000000002343be5 in alloc_cprop_mem (n_blocks=249747, n_sets=137435)
    at /home/rguenther/src/gcc2/gcc/cprop.c:557
557       cprop_avloc = sbitmap_vector_alloc (n_blocks, n_sets);

where sbitmap_vector_alloc continues to use 'int' for things like size:

139     sbitmap *
140     sbitmap_vector_alloc (unsigned int n_vecs, unsigned int n_elms)
141     {
142       unsigned int i, bytes, offset, elm_bytes, size, amt, vector_bytes;
143       sbitmap *bitmap_vector;
144

and eventually 'amt' overflows:

  amt = vector_bytes + (n_vecs * elm_bytes);

(gdb) p vector_bytes
$8 = 1997976
(gdb) p n_vecs
$9 = 249747
(gdb) p elm_bytes
$10 = 17192
(gdb) p amt
$11 = 681104

I'll fix that part.

  reply	other threads:[~2020-10-26  8:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 16:34 [Bug rtl-optimization/97554] New: " rimvydas.jas at gmail dot com
2020-10-26  8:05 ` rguenth at gcc dot gnu.org [this message]
2020-10-26 10:34 ` [Bug rtl-optimization/97554] " rguenth at gcc dot gnu.org
2020-10-26 17:13 ` rimvydas.jas at gmail dot com
2020-12-01 10:12 ` rguenth at gcc dot gnu.org
2020-12-01 10:13 ` rguenth at gcc dot gnu.org
2020-12-01 10:32 ` cvs-commit at gcc dot gnu.org
2020-12-01 10:50 ` cvs-commit at gcc dot gnu.org
2020-12-01 11:02 ` cvs-commit at gcc dot gnu.org
2020-12-01 11:03 ` rguenth at gcc dot gnu.org

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=bug-97554-4-xtNshoVOZ6@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).