From 045d57b979722d15ce7fce733616bbf4ab0e0459 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Fri, 14 Oct 2022 16:49:33 +0200 Subject: [PATCH] Implement distinction between HONOR_SIGNED_ZEROS and MODE_HAS_SIGNED_ZEROS. gcc/ChangeLog: * value-range.cc (frange::set): Implement distinction between HONOR_SIGNED_ZEROS and MODE_HAS_SIGNED_ZEROS. --- gcc/value-range.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 6b4f3dddcd5..e5b4c1565d4 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -324,13 +324,20 @@ frange::set (tree type, m_neg_nan = false; } - if (!HONOR_SIGNED_ZEROS (m_type)) + if (!MODE_HAS_SIGNED_ZEROS (TYPE_MODE (m_type))) { if (real_iszero (&m_min, 1)) m_min.sign = 0; if (real_iszero (&m_max, 1)) m_max.sign = 0; } + else if (!HONOR_SIGNED_ZEROS (m_type)) + { + if (real_iszero (&m_max, 1)) + m_max.sign = 0; + if (real_iszero (&m_min, 0)) + m_min.sign = 1; + } // For -ffinite-math-only we can drop ranges outside the // representable numbers to min/max for the type. -- 2.37.3