From: Jakub Jelinek Date: Tue, 28 Mar 2023 08:55:31 +0000 (+0200) Subject: range-op-float: Use get_nan_state in float_widen_lhs_range X-Git-Tag: basepoints/gcc-14~311 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ccaee0d2c994ada5be6bcaae1ce3e43ca56fc617;p=thirdparty%2Fgcc.git range-op-float: Use get_nan_state in float_widen_lhs_range On Wed, Mar 22, 2023 at 07:32:44AM +0100, Aldy Hernandez wrote: > * value-range.cc (frange::set): Add nan_state argument. > * value-range.h (class nan_state): New. > (frange::get_nan_state): New. The following patch makes use of those changes in float_widen_lhs_range. 2023-03-28 Jakub Jelinek * range-op-float.cc (float_widen_lhs_range): Use pass get_nan_state as 4th argument to set to avoid clear_nan and union_ calls. --- diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 956411446274..dc9789b4ffdd 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -2262,12 +2262,7 @@ float_widen_lhs_range (tree type, const frange &lhs) or real_max_representable (type) as upper bound. */ bool save_flag_finite_math_only = flag_finite_math_only; flag_finite_math_only = false; - ret.set (type, lb, ub); - if (lhs.kind () != VR_VARYING) - { - ret.clear_nan (); - ret.union_ (lhs); - } + ret.set (type, lb, ub, lhs.get_nan_state ()); flag_finite_math_only = save_flag_finite_math_only; return ret; }