Skip statements with no BB in ranger.
authorAldy Hernandez <aldyh@redhat.com>
Fri, 3 Sep 2021 08:42:37 +0000 (10:42 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Fri, 3 Sep 2021 13:30:56 +0000 (15:30 +0200)
commit5db93cd083890b29262ab93bc8e692990b781002
tree45793b098773cb0e73558f5e2542306e5ceca2d2
parentbccf4b88e184e925ee2d7931e4cf09704f1c3932
Skip statements with no BB in ranger.

The function postfold_gcond_edges() registers relations coming out of a
GIMPLE_COND.  With upcoming changes, we may be called with statements
not in the IL (for example, dummy statements created by the
forward threader).  This patch avoids breakage by exiting if the
statement does not have a defining basic block.  There is a similar
change to the path solver.

Tested on x86-64 Linux.

gcc/ChangeLog:

* gimple-range-fold.cc (fold_using_range::postfold_gcond_edges):
Skip statements with no defining BB.
* gimple-range-path.cc (path_range_query::range_defined_in_block):
Do not get confused by statements with no defining BB.
gcc/gimple-range-fold.cc
gcc/gimple-range-path.cc