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 tree-optimization/111967] [12/13/14 Regression] during GIMPLE pass: evrp ICE: in operator[], at vec.h:910 with -O2 -fno-tree-forwprop -fdump-tree-evrp-all since r12-4694
Date: Mon, 13 Nov 2023 07:48:21 +0000	[thread overview]
Message-ID: <bug-111967-4-dRRZnq9awf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111967-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from CVS 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:5a0c302d2d721b9650c1e354695dbba87364c334

commit r14-5376-g5a0c302d2d721b9650c1e354695dbba87364c334
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Nov 13 08:47:41 2023 +0100

    gimple-range-cache: Fix ICEs when dumping details [PR111967]

    The following testcase ICEs when dumping details.
    When m_ssa_ranges vector is created, it is safe_grow_cleared
(num_ssa_names),
    but when when some new SSA_NAME is added, we strangely grow it to
    num_ssa_names + 1 instead and later on the 3 argument dump method
    iterates from 1 to m_ssa_ranges.length () - 1 and uses ssa_name (x)
    on each; but because set_bb_range grew it one too much, ssa_name
    (m_ssa_ranges.length () - 1) might be after the end of the ssanames
    vector and ICE.

    The fix grows the vector consistently only to num_ssa_names,
    doesn't waste time checking m_ssa_ranges[0] because there is no
    ssa_names (0), it is always NULL, before using ssa_name (x) checks
    if we'll need it at all (we check later if m_ssa_ranges[x] is non-NULL,
    so we might check it earlier as well) and also in the last loop
    iterates until m_ssa_ranges.length () rather than num_ssa_names, I don't
    see a reason for the inconsistency and in theory some SSA_NAME could be
    added without set_bb_range called for it and the vector could be shorter
    than the ssanames vector.

    To actually fix the ICE, either the first hunk or the last 2 hunks
    would be enough, but I think it doesn't hurt to change all the spots.

    2023-11-13  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/111967
            * gimple-range-cache.cc (block_range_cache::set_bb_range): Grow
            m_ssa_ranges to num_ssa_names rather than num_ssa_names + 1.
            (block_range_cache::dump): Iterate from 1 rather than 0.  Don't use
            ssa_name (x) unless m_ssa_ranges[x] is non-NULL.  Iterate to
            m_ssa_ranges.length () rather than num_ssa_names.

            * gcc.dg/tree-ssa/pr111967.c: New test.

  parent reply	other threads:[~2023-11-13  7:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 19:44 [Bug tree-optimization/111967] New: [12/13/14 Regression] during GIMPLE pass: evrp ICE: in operator[], at vec.h:910 with -O2 -fno-tree-forwprop -fdump-tree-evrp-all zsojka at seznam dot cz
2023-10-24 19:48 ` [Bug tree-optimization/111967] " pinskia at gcc dot gnu.org
2023-10-24 19:53 ` pinskia at gcc dot gnu.org
2023-10-27 12:27 ` rguenth at gcc dot gnu.org
2023-11-10 15:26 ` [Bug tree-optimization/111967] [12/13/14 Regression] during GIMPLE pass: evrp ICE: in operator[], at vec.h:910 with -O2 -fno-tree-forwprop -fdump-tree-evrp-all since r12-4694 jakub at gcc dot gnu.org
2023-11-10 16:13 ` jakub at gcc dot gnu.org
2023-11-13  7:48 ` cvs-commit at gcc dot gnu.org [this message]
2023-11-13  7:55 ` [Bug tree-optimization/111967] [12/13 " jakub at gcc dot gnu.org
2023-12-05 16:32 ` cvs-commit at gcc dot gnu.org
2023-12-05 17:01 ` [Bug tree-optimization/111967] [12 " jakub at gcc dot gnu.org
2023-12-16  0:37 ` cvs-commit at gcc dot gnu.org
2023-12-16  8:46 ` 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-111967-4-dRRZnq9awf@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).