diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2021-09-21 08:28:28 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2021-09-21 18:55:13 +0200 |
commit | 64b80b8819f9ea74712625bceb0ec4388e25f67d (patch) | |
tree | 80a7f3954ace46d7689c477fd0325f22a82c7d92 /gcc | |
parent | 08f392534a2c65fcebb1ce5a2f04459ac993a2f0 (diff) | |
download | gcc-64b80b8819f9ea74712625bceb0ec4388e25f67d.zip gcc-64b80b8819f9ea74712625bceb0ec4388e25f67d.tar.gz gcc-64b80b8819f9ea74712625bceb0ec4388e25f67d.tar.bz2 |
Do not query SCEV in range_of_phi unless dominators are available.
SCEV won't work without dominators and we can get called without
dominators from debug_ranger.
Another option would be to rename scev_initialized_p to something like
scev_available_p and move the check there. For now, this will do.
gcc/ChangeLog:
* gimple-range-fold.cc (fold_using_range::range_of_phi): Check
dom_info_available_p.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gimple-range-fold.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc index 80cc5c0..770a6c9 100644 --- a/gcc/gimple-range-fold.cc +++ b/gcc/gimple-range-fold.cc @@ -814,7 +814,9 @@ fold_using_range::range_of_phi (irange &r, gphi *phi, fur_source &src) } // If SCEV is available, query if this PHI has any knonwn values. - if (scev_initialized_p () && !POINTER_TYPE_P (TREE_TYPE (phi_def))) + if (dom_info_available_p (CDI_DOMINATORS) + && scev_initialized_p () + && !POINTER_TYPE_P (TREE_TYPE (phi_def))) { value_range loop_range; class loop *l = loop_containing_stmt (phi); |