From 35a293a6454ac0cd88735036f536d8f4ec65951a Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Wed, 22 May 2024 22:32:57 +0200 Subject: [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. --- gcc/tree-ssa-phiopt.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gcc/tree-ssa-phiopt.cc') 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); -- cgit v1.1