public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "suochenyao at 163 dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/102565] New: ICE: in upper_bound, at value-range.h:531 under -O2
Date: Sat, 02 Oct 2021 10:21:02 +0000	[thread overview]
Message-ID: <bug-102565-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 102565
           Summary: ICE: in upper_bound, at value-range.h:531 under -O2
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: suochenyao at 163 dot com
  Target Milestone: ---

*******************************************************************************
OS and Platform:
CentOS Linux release 7.8.2003 (Core).0, x86_64 GNU/Linux
*******************************************************************************
Program:
struct a {
  signed b;
};
char c;
short d;
int e;
long(f)() { return 0; }
void g() {
  struct a h = {1};
  short *i = &d;
  *i = 0;
  e = c << h.b;
  f(e == 1 || d) == c;
}
void main() {}
*******************************************************************************
version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/data/bin/gcc-dev/bin/gcc
COLLECT_LTO_WRAPPER=/data/bin/gcc-dev/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/data/bin/gcc-dev/ --disable-multilib
--enable-languages=c,c++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20211002 (experimental) (GCC)

git ver: 9d116bcc5556c7df32803f7bf8e6e238ea1c13fb
*******************************************************************************
Command Lines:
$ gcc -O2 a.c
during GIMPLE pass: evrp
a.c: In function ‘g’:
a.c:15:1: internal compiler error: in upper_bound, at value-range.h:531
   15 | void main() {}
      | ^~~~
0xbc9939 irange::upper_bound() const
        ../../gcc/value-range.h:531
0x1be6f03 operator_lshift::op1_range(irange&, tree_node*, irange const&, irange
const&, tree_code) const
        ../../gcc/range-op.cc:2131
0x1ae0b0b gori_compute::compute_operand1_range(irange&, gimple*, irange const&,
tree_node*, fur_source&)
        ../../gcc/gimple-range-gori.cc:1011
0x1ae0b9e gori_compute::compute_operand_range(irange&, gimple*, irange const&,
tree_node*, fur_source&)
        ../../gcc/gimple-range-gori.cc:689
0x1ae0b9e gori_compute::compute_operand1_range(irange&, gimple*, irange const&,
tree_node*, fur_source&)
        ../../gcc/gimple-range-gori.cc:1064
0x1ae1bc1 gori_compute::compute_operand_range(irange&, gimple*, irange const&,
tree_node*, fur_source&)
        ../../gcc/gimple-range-gori.cc:689
0x1ae1bc1 gori_compute::outgoing_edge_range_p(irange&, edge_def*, tree_node*,
range_query&)
        ../../gcc/gimple-range-gori.cc:1245
0x1ad5b93 ranger_cache::range_on_edge(irange&, edge_def*, tree_node*)
        ../../gcc/gimple-range-cache.cc:979
0x1ad62f5 ranger_cache::range_on_edge(irange&, edge_def*, tree_node*)
        ../../gcc/gimple-range-fold.h:97
0x1ad62f5 ranger_cache::propagate_cache(tree_node*)
        ../../gcc/gimple-range-cache.cc:1078
0x1ad6c6d ranger_cache::fill_block_cache(tree_node*, basic_block_def*,
basic_block_def*)
        ../../gcc/gimple-range-cache.cc:1290
0x1ad6dcf ranger_cache::block_range(irange&, basic_block_def*, tree_node*,
bool)
        ../../gcc/gimple-range-cache.cc:1022
0x1ad2b39 gimple_ranger::range_on_entry(irange&, basic_block_def*, tree_node*)
        ../../gcc/gimple-range.cc:131
0x1ad32a8 gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
        ../../gcc/gimple-range.cc:105
0x1adc712 fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
        ../../gcc/gimple-range-fold.cc:604
0x1addc09 fold_using_range::fold_stmt(irange&, gimple*, fur_source&,
tree_node*)
        ../../gcc/gimple-range-fold.cc:556
0x1ad290d gimple_ranger::fold_range_internal(irange&, gimple*, tree_node*)
        ../../gcc/gimple-range.cc:226
0x1ad290d gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
        ../../gcc/gimple-range.cc:269
0x1ad33ff gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
        ../../gcc/gimple-range.cc:100
0x11abbdf range_query::value_of_expr(tree_node*, gimple*)
        ../../gcc/value-query.cc:87
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

             reply	other threads:[~2021-10-02 10:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-02 10:21 suochenyao at 163 dot com [this message]
2021-10-03 11:58 ` [Bug tree-optimization/102565] " zsojka at seznam dot cz
2021-10-03 19:06 ` pinskia 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-102565-4@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).