From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2136) id B530C384D196; Fri, 14 Oct 2022 14:27:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B530C384D196 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665757672; bh=e8KRr/apy6PTZVJ2cXtAKPs8gB1zkMfhkM4B/Kk4Miw=; h=From:To:Subject:Date:From; b=hD2XUUzlb5HYVDHhi6HjB5ym4LA+WBcB22kOGr3V6yrIzO4KlkHSFbRtdGOJBPn3Q 3up1aUcKorg8j6AKA6xpWxF/aiHVm+rVshLhZcUWplmnjLAWRbqfku2El6zijQAPAo +UEJld62I0zg4KcGC3bxgm8IS5KxCRcEIgse8fgU= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Aldy Hernandez To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3300] Drop -0.0 in frange::set() for !HONOR_SIGNED_ZEROS. X-Act-Checkin: gcc X-Git-Author: Aldy Hernandez X-Git-Refname: refs/heads/master X-Git-Oldrev: d6a488f243acfac4bdbbb0eefbee3ae916159cf5 X-Git-Newrev: 2e252f504b68d001ced53dc1850b67e1368eebc9 Message-Id: <20221014142752.B530C384D196@sourceware.org> Date: Fri, 14 Oct 2022 14:27:52 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2e252f504b68d001ced53dc1850b67e1368eebc9 commit r13-3300-g2e252f504b68d001ced53dc1850b67e1368eebc9 Author: Aldy Hernandez Date: Fri Oct 14 12:06:56 2022 +0200 Drop -0.0 in frange::set() for !HONOR_SIGNED_ZEROS. Similar to what we do for NANs when !HONOR_NANS and Inf when flag_finite_math_only, we can remove -0.0 from the range at creation time. We were kinda sorta doing this because there is a bug in real_isdenormal that is causing flush_denormals_to_zero to saturate [x, -0.0] to [x, +0.0] when !HONOR_SIGNED_ZEROS. Fixing this bug (upcoming), causes us to leave -0.0 in places where we aren't expecting it (the intersection code). gcc/ChangeLog: * value-range.cc (frange::set): Drop -0.0 for !HONOR_SIGNED_ZEROS. Diff: --- gcc/value-range.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 26a2b782e2c..86550f158b8 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -324,6 +324,14 @@ frange::set (tree type, m_neg_nan = false; } + if (!HONOR_SIGNED_ZEROS (m_type)) + { + if (real_iszero (&m_min, 1)) + m_min.sign = 0; + if (real_iszero (&m_max, 1)) + m_max.sign = 0; + } + // For -ffinite-math-only we can drop ranges outside the // representable numbers to min/max for the type. if (flag_finite_math_only)