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

            Bug ID: 121904
           Summary: [16 Regression] ICE in as_a, at value-range.h:668
                    since r16-1400-g2e4688a7202
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stefansf at gcc dot gnu.org
  Target Milestone: ---
            Target: s390*-*-*

$ gcc /devel/src/gcc/testsuite/gcc.c-torture/compile/20111209-1.c -O3 -S
during RTL pass: expand
/devel/src/gcc/testsuite/gcc.c-torture/compile/20111209-1.c: In function
'__gnat_getenv':
/devel/src/gcc/testsuite/gcc.c-torture/compile/20111209-1.c:11:12: internal
compiler error: in as_a, at value-range.h:668
0x4528af5 internal_error(char const*, ...)
        /devel/src/gcc/diagnostic-global-context.cc:517
0x44cc955 fancy_abort(char const*, int, char const*)
        /devel/src/gcc/diagnostic.cc:1803
0x1d75073 irange const& as_a<irange>(vrange const&)
        /devel/src/gcc/value-range.h:668
0x2e5d87f irange::intersect(vrange const&)
        /devel/src/gcc/value-range.cc:1945
0x20b9bcb gimple_ranger::range_of_stmt(vrange&, gimple*, tree_node*)
        /devel/src/gcc/gimple-range.cc:348
0x20b8ca9 gimple_ranger::range_of_expr(vrange&, tree_node*, gimple*)
        /devel/src/gcc/gimple-range.cc:142
0x2e2897d get_range_pos_neg(tree_node*, gimple*)
        /devel/src/gcc/tree.cc:14653
0x1f4f36f expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode,
expand_modifier)
        /devel/src/gcc/expr.cc:9887
0x1f569bf expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /devel/src/gcc/expr.cc:11234
0x1c90c85 expand_gimple_stmt_1
        /devel/src/gcc/cfgexpand.cc:4334
0x1c910bd expand_gimple_stmt
        /devel/src/gcc/cfgexpand.cc:4398
0x1c9e457 expand_gimple_basic_block
        /devel/src/gcc/cfgexpand.cc:6459
0x1ca1397 execute
        /devel/src/gcc/cfgexpand.cc:7210
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Bisect stops at r16-1400-g2e4688a7202

In gimple-range.cc we have for `r` an irange and for `tmp` an prange as
discriminator:

348           bool changed = r.intersect (tmp);
(gdb) call debug_tree(tmp.type())
 <pointer_type 0x3fff76e07e0
    type <integer_type 0x3fff75163f0 char asm_written public unsigned QI
        size <integer_cst 0x3fff7502bb8 constant 8>
        unit-size <integer_cst 0x3fff7502bd0 constant 1>
        align:8 warn_if_not_align:0 symtab:1023 alias-set -1 canonical-type
0x3fff75163f0 precision:8 min <integer_cst 0x3fff7502c18 0> max <integer_cst
0x3fff7502c00 255>
        pointer_to_this <pointer_type 0x3fff76e07e0>>
    unsigned SI
    size <integer_cst 0x3fff7502d08 type <integer_type 0x3fff75160a8
bitsizetype> constant 32>
    unit-size <integer_cst 0x3fff7502d20 type <integer_type 0x3fff7516000
sizetype> constant 4>
    align:32 warn_if_not_align:0 symtab:1023 alias-set -1 canonical-type
0x3fff76e07e0>
(gdb) call debug_tree(r.type())
warning: RTTI symbol not found for class 'int_range<3u, true>'
warning: RTTI symbol not found for class 'int_range<3u, true>'
warning: RTTI symbol not found for class 'int_range<3u, true>'
 <pointer_type 0x3fff76e07e0
    type <integer_type 0x3fff75163f0 char asm_written public unsigned QI
        size <integer_cst 0x3fff7502bb8 constant 8>
        unit-size <integer_cst 0x3fff7502bd0 constant 1>
        align:8 warn_if_not_align:0 symtab:1023 alias-set -1 canonical-type
0x3fff75163f0 precision:8 min <integer_cst 0x3fff7502c18 0> max <integer_cst
0x3fff7502c00 255>
        pointer_to_this <pointer_type 0x3fff76e07e0>>
    unsigned SI
    size <integer_cst 0x3fff7502d08 type <integer_type 0x3fff75160a8
bitsizetype> constant 32>
    unit-size <integer_cst 0x3fff7502d20 type <integer_type 0x3fff7516000
sizetype> constant 4>
    align:32 warn_if_not_align:0 symtab:1023 alias-set -1 canonical-type
0x3fff76e07e0>
(gdb) print r
$10 = warning: RTTI symbol not found for class 'int_range<3u, true>'
(vrange &) warning: RTTI symbol not found for class 'int_range<3u, true>'
@0x3ffffff7488: {_vptr.vrange = 0x4727998 <vtable for int_range<3u, true>+16>,
m_kind = VR_VARYING, m_discriminator = VR_IRANGE}
(gdb) print tmp
$11 = {m_vrange = 0x3ffffff6f00, m_buffer = {ints = {<irange> = {<vrange> =
{_vptr.vrange = 0x46d0d90 <vtable for prange+16>, m_kind = VR_VARYING,
m_discriminator = VR_PRANGE} ...

Reply via email to