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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-02-03
             Status|UNCONFIRMED                 |NEW
                 CC|                            |aldyh at gcc dot gnu.org,
                   |                            |amacleod at redhat dot com

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly tweaked, still -O1:
char b;
void bar (void);

void
foo (_BitInt(6110) j)
{
  for (;;)
    {
      _BitInt(10) k = b % j;
      for (j = 6; j; --j)
        if (k)
          bar ();
    }
}

The ICE is in on:
721       if (!m_equiv[bb->index])
because bb->index is larger than m_equiv size.
The bitint lowering pass works by walking the IL and replacing some statements
in there with lowered code, which can involve new basic blocks (either through
splitting existing blocks or creating fresh new ones) and the like.  And asks
the ranger about range of statements during that.
Is that something that ranger doesn't/can't support?
So, would I need to ensure to find out what ranges I'll need before making any
changes,
ask for them, remember them somewhere on the side and then use them during the
transformations?

#0  fancy_abort (file=0x2c76d8a "../../gcc/vec.h", line=910, function=0x2c76d7f
"operator[]") at ../../gcc/diagnostic.cc:2313
#1  0x00000000011fcb6b in vec<equiv_chain*, va_heap, vl_embed>::operator[]
(this=0x39fb660 = {...}, ix=16) at ../../gcc/vec.h:910
#2  0x00000000011fc4b7 in vec<equiv_chain*, va_heap, vl_ptr>::operator[]
(Python Exception <class 'gdb.error'>: There is no member or method named
m_vecpfx.
this=0x39fc050, ix=16) at ../../gcc/vec.h:1599
#3  0x00000000011f81c4 in equiv_oracle::add_equiv_to_block (this=0x39fbf80,
bb=<basic_block 0x7fffea2dfd80 (16)>, equiv_set=0x3ad29b8) at
../../gcc/value-relation.cc:721
#4  0x00000000011f7f1e in equiv_oracle::register_initial_def (this=0x39fbf80,
ssa=<ssa_name 0x7fffea308240 13>) at ../../gcc/value-relation.cc:643
#5  0x00000000011f8025 in equiv_oracle::register_relation (this=0x39fbf80,
bb=<basic_block 0x7fffea2df960 (7)>, k=VREL_EQ, ssa1=<ssa_name 0x7fffea308360
17>, 
    ssa2=<ssa_name 0x7fffea308240 13>) at ../../gcc/value-relation.cc:675
#6  0x00000000011f98a5 in dom_oracle::register_relation (this=0x39fbf80,
bb=<basic_block 0x7fffea2df960 (7)>, k=VREL_EQ, op1=<ssa_name 0x7fffea308360
17>, 
    op2=<ssa_name 0x7fffea308240 13>) at ../../gcc/value-relation.cc:1111
#7  0x00000000011f96d7 in relation_oracle::register_stmt (this=0x39fbf80,
stmt=<gimple_phi 0x7fffea30ae00>, k=VREL_EQ, op1=<ssa_name 0x7fffea308360 17>, 
    op2=<ssa_name 0x7fffea308240 13>) at ../../gcc/value-relation.cc:1069
#8  0x00000000025fb5fe in fur_depend::register_relation (this=0x7fffffffbcd0,
s=<gimple_phi 0x7fffea30ae00>, k=VREL_EQ, op1=<ssa_name 0x7fffea308360 17>, 
    op2=<ssa_name 0x7fffea308240 13>) at ../../gcc/gimple-range-fold.cc:202
#9  0x00000000025fe3d3 in fold_using_range::range_of_phi (this=0x7fffffffbcff,
r=..., phi=0x7fffea30ae00, src=...) at ../../gcc/gimple-range-fold.cc:932
#10 0x00000000025fcaa8 in fold_using_range::fold_stmt (this=0x7fffffffbcff,
r=..., s=<gimple_phi 0x7fffea30ae00>, src=..., name=<ssa_name 0x7fffea308360
17>)
    at ../../gcc/gimple-range-fold.cc:604
#11 0x00000000025ee502 in gimple_ranger::fold_range_internal (this=0x3b91ca0,
r=..., s=<gimple_phi 0x7fffea30ae00>, name=<ssa_name 0x7fffea308360 17>)
    at ../../gcc/gimple-range.cc:265
#12 0x00000000025eeb24 in gimple_ranger::prefill_stmt_dependencies
(this=0x3b91ca0, ssa=<ssa_name 0x7fffea137f78 4>) at
../../gcc/gimple-range.cc:404
#13 0x00000000025ee7c3 in gimple_ranger::range_of_stmt (this=0x3b91ca0, r=...,
s=<gimple_phi 0x7fffea2dda00>, name=<ssa_name 0x7fffea137f78 4>) at
../../gcc/gimple-range.cc:322
#14 0x00000000025edc52 in gimple_ranger::range_of_expr (this=0x3b91ca0, r=...,
expr=<ssa_name 0x7fffea137f78 4>, stmt=<gimple_assign 0x7fffea306000>)
    at ../../gcc/gimple-range.cc:134
#15 0x00000000025cb0a0 in (anonymous namespace)::range_to_prec (op=<ssa_name
0x7fffea137f78 4>, stmt=<gimple_assign 0x7fffea306000>) at
../../gcc/gimple-lower-bitint.cc:2008
#16 0x00000000025cc539 in (anonymous
namespace)::bitint_large_huge::handle_operand_addr (this=0x7fffffffd560,
op=<ssa_name 0x7fffea137f78 4>, stmt=<gimple_assign 0x7fffea306000>, 
    prec_stored=0x0, prec=0x7fffffffd148) at
../../gcc/gimple-lower-bitint.cc:2211
#17 0x00000000025d3688 in (anonymous
namespace)::bitint_large_huge::lower_muldiv_stmt (this=0x7fffffffd560,
obj=<tree 0x0>, stmt=<gimple_assign 0x7fffea306000>)
    at ../../gcc/gimple-lower-bitint.cc:3403
#18 0x00000000025de784 in (anonymous namespace)::bitint_large_huge::lower_stmt
(this=0x7fffffffd560, stmt=<gimple_assign 0x7fffea306000>) at
../../gcc/gimple-lower-bitint.cc:5439
#19 0x00000000025e4297 in gimple_lower_bitint () at
../../gcc/gimple-lower-bitint.cc:6575
#20 0x00000000025e5719 in (anonymous namespace)::pass_lower_bitint::execute
(this=0x3a10fe0) at ../../gcc/gimple-lower-bitint.cc:6837

Reply via email to