aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.cc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2024-05-22 22:32:57 +0200
committerAldy Hernandez <aldyh@redhat.com>2024-05-23 08:14:57 +0200
commit35a293a6454ac0cd88735036f536d8f4ec65951a (patch)
tree4d687644e906df1d8304323fdaa208642701a5f6 /gcc/tree-ssa-phiopt.cc
parent01cfd6018250141a262219c5803c3f2a278d909d (diff)
downloadgcc-35a293a6454ac0cd88735036f536d8f4ec65951a.zip
gcc-35a293a6454ac0cd88735036f536d8f4ec65951a.tar.gz
gcc-35a293a6454ac0cd88735036f536d8f4ec65951a.tar.bz2
[prange] Use type agnostic range in phiopt [PR115191]
Fix a use of int_range_max in phiopt that should be a type agnostic range, because it could be either a pointer or an int. PR tree-optimization/115191 gcc/ChangeLog: * tree-ssa-phiopt.cc (value_replacement): Use Value_Range instead of int_range_max. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr115191.c: New test.
Diffstat (limited to 'gcc/tree-ssa-phiopt.cc')
-rw-r--r--gcc/tree-ssa-phiopt.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index 918cf50..65f63eb 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -1326,12 +1326,11 @@ value_replacement (basic_block cond_bb, basic_block middle_bb,
{
/* After the optimization PHI result can have value
which it couldn't have previously. */
- int_range_max r;
+ Value_Range r (TREE_TYPE (phires));
if (get_global_range_query ()->range_of_expr (r, phires,
phi))
{
- wide_int warg = wi::to_wide (carg);
- int_range<2> tmp (TREE_TYPE (carg), warg, warg);
+ Value_Range tmp (carg, carg);
r.union_ (tmp);
reset_flow_sensitive_info (phires);
set_range_info (phires, r);