aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.cc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2023-04-27 12:05:36 +0200
committerAldy Hernandez <aldyh@redhat.com>2023-04-27 13:58:55 +0200
commit2b8ac1df6493eb1789c7c4d9f3df280ef9cf0ac4 (patch)
tree9af00177f2761baae692af263ced5f7d1085e89d /gcc/tree-ssa-phiopt.cc
parenta82c6ab0aade4124e1903dda6f6f85c4c317fcec (diff)
downloadgcc-2b8ac1df6493eb1789c7c4d9f3df280ef9cf0ac4.zip
gcc-2b8ac1df6493eb1789c7c4d9f3df280ef9cf0ac4.tar.gz
gcc-2b8ac1df6493eb1789c7c4d9f3df280ef9cf0ac4.tar.bz2
Normalize addresses in IPA before calling range_op_handler [PR109639]
The old legacy code would allow building ranges containing symbolics, even though the entire ranger ecosystem does not handle them. These were normalized into non-zero ranges by helper functions in VRP (range_fold_*_expr) before calling the ranger. The only users of these functions should have been legacy VRP, which is no more. However, a handful of users crept into IPA, even though these functions shouldn't never been called outside of VRP or vr-values. The issue here is that IPA is building a range of [&foo, &foo] and expecting range_fold_binary to normalize it to non-zero. Fixed by adding a helper function before calling the range_op handler. I think these covers the problematic ranges. If not, I'll come up with something more generalized that does not involve polluting irange::set with the normalization code. After all, this only involves a handful of IPA places. I've also added an assert in irange::set() making it easier to detect any possible fallout without having to drill deep into the setter. gcc/ChangeLog: PR tree-optimization/109639 * ipa-cp.cc (ipa_value_range_from_jfunc): Normalize range. (propagate_vr_across_jump_function): Same. * ipa-fnsummary.cc (evaluate_conditions_for_known_args): Same. * ipa-prop.h (ipa_range_set_and_normalize): New. * value-range.cc (irange::set): Assert min and max are INTEGER_CST.
Diffstat (limited to 'gcc/tree-ssa-phiopt.cc')
0 files changed, 0 insertions, 0 deletions