public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amacleod at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/108647] [13 Regression] ICE in upper_bound, at value-range.h:950 with -O3 since r13-2974-g67166c9ec35d58ef
Date: Fri, 03 Feb 2023 14:54:51 +0000	[thread overview]
Message-ID: <bug-108647-4-3R1Yu7ilGH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108647-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Andrew Macleod <amacleod at redhat dot com> ---
This is the first release that we process relations in GORI.  Up until recently
it was fairly ad-hoc what got passed in as a relation trio to the op?_range
routines.  A couple of days ago I fleshed it out fully.  I am surprised that
isn't what caused this.

Anyway, the reason its tripping:

  if (_42 != 0)
    goto <bb 10>; [50.00%]
  else
    goto <bb 6>; [50.00%]

bb6:
  _27 = *h_29(D);
  _53 = _27 < _42;
  if (_42 > _53)

we start by trying to evaluate the outgoing edge for _42 on the true side:
[1,1] = (_42 > _53)
The problem is we have determined that _42 is bool [0, 0] at this point.
Knowing _42 is [0, 0], the definition of _53 can never be true, so it is also
bool [0,0]

in order for _53 to be [0,0] AND _42 to be [0,0], the bool value for _27 is
nonsensical..    and thus its being calculated as undefined.

This branch is eventually going to be removed since it can never be taken, but
that hasnt happened at this point yet.

we could fix it at the call site, but you do point out that the opX_range
routines are not gracefully dealing with undefined values.

We probably should audit them all to make sure we handled undefined gracefully
before accessing a bound.

  parent reply	other threads:[~2023-02-03 14:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 21:21 [Bug tree-optimization/108647] New: [13 Regression] ICE in upper_bound, at value-range.h:950 with -O3 vsevolod.livinskiy at gmail dot com
2023-02-03  1:45 ` [Bug tree-optimization/108647] " pinskia at gcc dot gnu.org
2023-02-03  8:04 ` rguenth at gcc dot gnu.org
2023-02-03  9:21 ` [Bug tree-optimization/108647] [13 Regression] ICE in upper_bound, at value-range.h:950 with -O3 since r13-2974-g67166c9ec35d58ef marxin at gcc dot gnu.org
2023-02-03  9:29 ` jakub at gcc dot gnu.org
2023-02-03  9:54 ` jakub at gcc dot gnu.org
2023-02-03 12:46 ` aldyh at gcc dot gnu.org
2023-02-03 14:54 ` amacleod at redhat dot com [this message]
2023-02-03 15:11 ` jakub at gcc dot gnu.org
2023-02-03 15:15 ` jakub at gcc dot gnu.org
2023-02-03 15:20 ` amacleod at redhat dot com
2023-02-03 15:23 ` jakub at gcc dot gnu.org
2023-02-03 15:28 ` amacleod at redhat dot com
2023-02-03 16:16 ` aldyh at gcc dot gnu.org
2023-02-03 16:31 ` aldyh at gcc dot gnu.org
2023-02-03 16:33 ` jakub at gcc dot gnu.org
2023-02-03 16:35 ` aldyh at gcc dot gnu.org
2023-02-03 20:31 ` cvs-commit at gcc dot gnu.org
2023-02-03 20:39 ` cvs-commit at gcc dot gnu.org
2023-02-03 20:43 ` jakub at gcc dot gnu.org
2023-02-04  1:35 ` raj.khem at gmail dot com
2023-02-04  4:28 ` jakub at gcc dot gnu.org
2023-02-04  5:25 ` jakub at gcc dot gnu.org
2023-02-04  7:26 ` raj.khem at gmail dot com

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-108647-4-3R1Yu7ilGH@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).