public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/97467] New: ICE in verify_range, at value-range.cc:369 (-Os and above)
@ 2020-10-17  7:47 su at cs dot ucdavis.edu
  2020-10-19  7:20 ` [Bug tree-optimization/97467] ICE in verify_range, at value-range.cc:369 (-Os and above) since r11-3685-gfcae5121154d1c33 marxin at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: su at cs dot ucdavis.edu @ 2020-10-17  7:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97467
           Summary: ICE in verify_range, at value-range.cc:369 (-Os and
                    above)
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

[594] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20201017 (experimental) [master revision
56e4eee935c:ba026021eaa:f476a9fe912132abf06c2832a1bb9abe6c1a1bb1] (GCC) 
[595] % 
[595] % gcctk -O1 small.c
[596] % 
[596] % gcctk -Os small.c
during GIMPLE pass: evrp
small.c: In function ‘main’:
small.c:13:1: internal compiler error: in verify_range, at value-range.cc:369
   13 | }
      | ^
0x104b853 irange::verify_range()
        ../../gcc-trunk/gcc/value-range.cc:369
0x104e8b7 irange::irange_set(tree_node*, tree_node*)
        ../../gcc-trunk/gcc/value-range.cc:172
0x104e8b7 irange::set(tree_node*, tree_node*, value_range_kind)
        ../../gcc-trunk/gcc/value-range.cc:226
0x1851ec5 int_range<2u>::int_range(tree_node*,
generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage>
const&, value_range_kind)
        ../../gcc-trunk/gcc/value-range.h:431
0x1851ec5 operator_lshift::op1_range(irange&, tree_node*, irange const&, irange
const&) const
        ../../gcc-trunk/gcc/range-op.cc:1611
0x18e9398 gori_compute::compute_operand1_range(irange&, gimple*, irange const&,
tree_node*)
        ../../gcc-trunk/gcc/gimple-range-gori.cc:878
0x18eb2d3 gori_compute_cache::compute_operand_range(irange&, gimple*, irange
const&, tree_node*)
        ../../gcc-trunk/gcc/gimple-range-gori.cc:1271
0x18e9457 gori_compute::compute_operand1_range(irange&, gimple*, irange const&,
tree_node*)
        ../../gcc-trunk/gcc/gimple-range-gori.cc:903
0x18eb2d3 gori_compute_cache::compute_operand_range(irange&, gimple*, irange
const&, tree_node*)
        ../../gcc-trunk/gcc/gimple-range-gori.cc:1271
0x18e9d9d gori_compute::outgoing_edge_range_p(irange&, edge_def*, tree_node*)
        ../../gcc-trunk/gcc/gimple-range-gori.cc:1002
0x18e4b00 ranger_cache::iterative_cache_update(tree_node*)
        ../../gcc-trunk/gcc/gimple-range-cache.cc:636
0x18e5783 ranger_cache::fill_block_cache(tree_node*, basic_block_def*,
basic_block_def*)
        ../../gcc-trunk/gcc/gimple-range-cache.cc:873
0x18e5b7e ranger_cache::block_range(irange&, basic_block_def*, tree_node*,
bool)
        ../../gcc-trunk/gcc/gimple-range-cache.cc:589
0x18d8a00 gimple_ranger::range_on_entry(irange&, basic_block_def*, tree_node*)
        ../../gcc-trunk/gcc/gimple-range.cc:909
0x18d9384 gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
        ../../gcc-trunk/gcc/gimple-range.cc:880
0x18dbb27 gimple_ranger::range_of_range_op(irange&, gimple*)
        ../../gcc-trunk/gcc/gimple-range.cc:418
0x18e0203 gimple_ranger::calc_stmt(irange&, gimple*, tree_node*)
        ../../gcc-trunk/gcc/gimple-range.cc:369
0x18e09a9 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
        ../../gcc-trunk/gcc/gimple-range.cc:986
0x18d9485 gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
        ../../gcc-trunk/gcc/gimple-range.cc:877
0x104a61e range_query::value_of_expr(tree_node*, gimple*)
        ../../gcc-trunk/gcc/value-query.cc:85
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.
[597] % 
[597] % cat small.c
int a;
long b;
unsigned int c = 1;

int main () {
  int e;
  for (; c <= 0; c++) {
    int f = 0;
    b = e;
    a = f || b << c;
  }
  return 0;
}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/97467] ICE in verify_range, at value-range.cc:369 (-Os and above) since r11-3685-gfcae5121154d1c33
  2020-10-17  7:47 [Bug tree-optimization/97467] New: ICE in verify_range, at value-range.cc:369 (-Os and above) su at cs dot ucdavis.edu
@ 2020-10-19  7:20 ` marxin at gcc dot gnu.org
  2020-10-19  8:06 ` [Bug tree-optimization/97467] [11 Regression] " aldyh at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-19  7:20 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
           Keywords|                            |ice-on-valid-code
     Ever confirmed|0                           |1
      Known to fail|                            |11.0
            Summary|ICE in verify_range, at     |ICE in verify_range, at
                   |value-range.cc:369 (-Os and |value-range.cc:369 (-Os and
                   |above)                      |above) since
                   |                            |r11-3685-gfcae5121154d1c33
             Status|UNCONFIRMED                 |NEW
                 CC|                            |aldyh at gcc dot gnu.org,
                   |                            |amacleod at redhat dot com,
                   |                            |marxin at gcc dot gnu.org
           Priority|P3                          |P1
   Last reconfirmed|                            |2020-10-19

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Thanks for the report, started with r11-3685-gfcae5121154d1c33.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/97467] [11 Regression] ICE in verify_range, at value-range.cc:369 (-Os and above) since r11-3685-gfcae5121154d1c33
  2020-10-17  7:47 [Bug tree-optimization/97467] New: ICE in verify_range, at value-range.cc:369 (-Os and above) su at cs dot ucdavis.edu
  2020-10-19  7:20 ` [Bug tree-optimization/97467] ICE in verify_range, at value-range.cc:369 (-Os and above) since r11-3685-gfcae5121154d1c33 marxin at gcc dot gnu.org
@ 2020-10-19  8:06 ` aldyh at gcc dot gnu.org
  2020-10-19  9:37 ` cvs-commit at gcc dot gnu.org
  2020-10-19  9:40 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: aldyh at gcc dot gnu.org @ 2020-10-19  8:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Ranger can figure out that the RHS operand of a shift is a zero and feeds it to
operator_lshift::op1_range, which then uses it to create a swapped [1,0] range.

Testing the following patch:

diff --git a/gcc/range-op.cc b/gcc/range-op.cc
index 0efa00186e8..30d2a4d3987 100644
--- a/gcc/range-op.cc
+++ b/gcc/range-op.cc
@@ -1579,6 +1579,11 @@ operator_lshift::op1_range (irange &r,
       wide_int shift = wi::to_wide (shift_amount);
       if (wi::lt_p (shift, 0, SIGNED))
        return false;
+      if (shift == 0)
+       {
+         r = lhs;
+         return true;
+       }

       // Work completely in unsigned mode to start.
       tree utype = type;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/97467] [11 Regression] ICE in verify_range, at value-range.cc:369 (-Os and above) since r11-3685-gfcae5121154d1c33
  2020-10-17  7:47 [Bug tree-optimization/97467] New: ICE in verify_range, at value-range.cc:369 (-Os and above) su at cs dot ucdavis.edu
  2020-10-19  7:20 ` [Bug tree-optimization/97467] ICE in verify_range, at value-range.cc:369 (-Os and above) since r11-3685-gfcae5121154d1c33 marxin at gcc dot gnu.org
  2020-10-19  8:06 ` [Bug tree-optimization/97467] [11 Regression] " aldyh at gcc dot gnu.org
@ 2020-10-19  9:37 ` cvs-commit at gcc dot gnu.org
  2020-10-19  9:40 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-19  9:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Aldy Hernandez <aldyh@gcc.gnu.org>:

https://gcc.gnu.org/g:5b80069c7e65a3ed60ee16deac4a450a9c32efa6

commit r11-4035-g5b80069c7e65a3ed60ee16deac4a450a9c32efa6
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Mon Oct 19 09:48:27 2020 +0200

    Handle right shifts by zero in range-ops.

    If the shift amount in operator_lshift::op1_range was zero, an invalid
range
    of [1, 0] was being created.

    gcc/ChangeLog:

            PR tree-optimization/97467
            * range-op.cc (operator_lshift::op1_range): Handle shifts by 0.

    gcc/testsuite/ChangeLog:

            * gcc.dg/pr97467.c: New test.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/97467] [11 Regression] ICE in verify_range, at value-range.cc:369 (-Os and above) since r11-3685-gfcae5121154d1c33
  2020-10-17  7:47 [Bug tree-optimization/97467] New: ICE in verify_range, at value-range.cc:369 (-Os and above) su at cs dot ucdavis.edu
                   ` (2 preceding siblings ...)
  2020-10-19  9:37 ` cvs-commit at gcc dot gnu.org
@ 2020-10-19  9:40 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: aldyh at gcc dot gnu.org @ 2020-10-19  9:40 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-19  9:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-17  7:47 [Bug tree-optimization/97467] New: ICE in verify_range, at value-range.cc:369 (-Os and above) su at cs dot ucdavis.edu
2020-10-19  7:20 ` [Bug tree-optimization/97467] ICE in verify_range, at value-range.cc:369 (-Os and above) since r11-3685-gfcae5121154d1c33 marxin at gcc dot gnu.org
2020-10-19  8:06 ` [Bug tree-optimization/97467] [11 Regression] " aldyh at gcc dot gnu.org
2020-10-19  9:37 ` cvs-commit at gcc dot gnu.org
2020-10-19  9:40 ` aldyh at gcc dot gnu.org

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).