public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/112411] ICE: SIGSEGV with --param=min-nondebug-insn-uid=2147483647 on powerpc64le-unknown-linux-gnu
Date: Fri, 08 Dec 2023 08:01:09 +0000	[thread overview]
Message-ID: <bug-112411-4-H2TReMXT5p@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112411-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:8f60f5499e10d19218cada082e0909516ebf0e74

commit r14-6305-g8f60f5499e10d19218cada082e0909516ebf0e74
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Dec 8 08:56:33 2023 +0100

    haifa-sched: Avoid overflows in extend_h_i_d [PR112411]

    On Thu, Dec 07, 2023 at 09:36:23AM +0100, Jakub Jelinek wrote:
    > Without the dg-skip-if I got on 64-bit host with
    > -O3 --param min-nondebug-insn-uid=0x40000000:
    > cc1: out of memory allocating 571230784744 bytes after a total of 2772992
bytes

    I've looked at this and the problem is in haifa-sched.cc:
    9047        h_i_d.safe_grow_cleared (3 * get_max_uid () / 2, true);
    get_max_uid () is 0x4000024d with the --param
min-nondebug-insn-uid=0x40000000
    and so 3 * get_max_uid () / 2 actually overflows to -536870028 but as vec.h
    then treats the value as unsigned, it attempts to allocate
    0xe0000374U * 152UL bytes, i.e. those 532GB.  If the above is fixed to do
    3U * get_max_uid () / 2 instead, it will get slightly better and will only
    need 0x60000373U * 152UL bytes, i.e. 228GB.

    Perhaps more could be helped by making the vector indirect (contain
pointers
    to haifa_insn_data_def rather than the structures themselves) and pool
allocate
    those, but the more important question is how sparse are uids in normal
    compilations without those large --param min-nondebug-insn-uid= parameters.
    Because if they aren't enough, such a change would increase compile time
memory
    just to help the unusual case.

    2023-12-08  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/112411
            * haifa-sched.cc (extend_h_i_d): Use 3U instead of 3 in
            3 * get_max_uid () / 2 calculation.

  parent reply	other threads:[~2023-12-08  8:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-06 18:30 [Bug target/112411] New: " zsojka at seznam dot cz
2023-11-07  8:37 ` [Bug target/112411] " rguenth at gcc dot gnu.org
2023-11-07  8:55 ` linkw at gcc dot gnu.org
2023-11-07 11:02 ` rsandifo at gcc dot gnu.org
2023-11-30  2:35 ` aoliva at gcc dot gnu.org
2023-11-30  8:32 ` zsojka at seznam dot cz
2023-11-30  8:39 ` rguenther at suse dot de
2023-12-06 17:47 ` jakub at gcc dot gnu.org
2023-12-06 18:19 ` jakub at gcc dot gnu.org
2023-12-06 18:51 ` jakub at gcc dot gnu.org
2023-12-07  7:56 ` [Bug middle-end/112411] " rguenth at gcc dot gnu.org
2023-12-08  7:33 ` cvs-commit at gcc dot gnu.org
2023-12-08  8:01 ` cvs-commit at gcc dot gnu.org [this message]
2023-12-08  8:01 ` jakub 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-112411-4-H2TReMXT5p@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).