We may be asked to fold an artificial statement not in the CFG. Since
there are no outgoing edges from those, avoid calling
register_outgoing_edges.
Tested on x86-64 Linux.
gcc/ChangeLog:
* gimple-range-fold.cc (fold_using_range::range_of_range_op):
Move check for non-empty BB here.
(fur_source::register_outgoing_edges): ...from here.
src.register_relation (s, rel, lhs, op2);
}
}
- else if (is_a<gcond *> (s))
+ // Check for an existing BB, as we maybe asked to fold an
+ // artificial statement not in the CFG.
+ else if (is_a<gcond *> (s) && gimple_bb (s))
{
basic_block bb = gimple_bb (s);
edge e0 = EDGE_SUCC (bb, 0);
range_operator *handler;
basic_block bb = gimple_bb (s);
- // We may get asked to fold an artificial statement not in the CFG.
- if (!bb)
- return;
-
if (e0)
{
// If this edge is never taken, ignore it.