From 19cb965e9d16e875944a31173b5e79b65e25d0de Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Wed, 12 Apr 2023 14:05:57 +0200 Subject: Declare dconstm0 to go along with dconst0 and friends. Negating dconst0 is getting pretty old, and we will keep adding copies of the same idiom. Fixed by adding a dconstm0 constant to go along with dconst1, dconstm1, etc. gcc/ChangeLog: * emit-rtl.cc (init_emit_once): Initialize dconstm0. * gimple-range-op.cc (class cfn_signbit): Remove dconstm0 declaration. * range-op-float.cc (zero_range): Use dconstm0. (zero_to_inf_range): Same. * real.h (dconstm0): New. * value-range.cc (frange::flush_denormals_to_zero): Use dconstm0. (frange::set_zero): Do not declare dconstm0. --- gcc/value-range.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gcc/value-range.cc') diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 8b5d0cb..3b3102b 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -322,9 +322,10 @@ frange::flush_denormals_to_zero () // Flush [x, -DENORMAL] to [x, -0.0]. if (real_isdenormal (&m_max, mode) && real_isneg (&m_max)) { - m_max = dconst0; if (HONOR_SIGNED_ZEROS (m_type)) - m_max.sign = 1; + m_max = dconstm0; + else + m_max = dconst0; } // Flush [+DENORMAL, x] to [+0.0, x]. if (real_isdenormal (&m_min, mode) && !real_isneg (&m_min)) @@ -837,8 +838,6 @@ frange::set_zero (tree type) { if (HONOR_SIGNED_ZEROS (type)) { - REAL_VALUE_TYPE dconstm0 = dconst0; - dconstm0.sign = 1; set (type, dconstm0, dconst0); clear_nan (); } -- cgit v1.1