From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2136) id 83E3E383E041; Wed, 31 Aug 2022 12:39:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83E3E383E041 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661949549; bh=muLuQaUGD41l2vijroUboKr2eJoh8/uekyNuXN/azI8=; h=From:To:Subject:Date:From; b=jYdcp0EkZFE4VdsRn3nXogzcbLFHsnW+atgW4O92M4ShgyawXJaKJNYonnu/7EnjJ A2/KWErTyXV4q5DHkJXz/HqZTaHfFA+oIdYeeNsgkf2+DwqoaqCFWZmXFU3/gsnBOz TCmTGYVQcpxQ1xJND+v4jBvdohT0VnkN0up2zOYw= 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-2309] Stream out endpoints for frange. X-Act-Checkin: gcc X-Git-Author: Aldy Hernandez X-Git-Refname: refs/heads/master X-Git-Oldrev: 217ba2ce7841a68482cb428b9bc093b0842faf3d X-Git-Newrev: 25dd2768afdb8fad7b11d511eb5f739958f9870d Message-Id: <20220831123909.83E3E383E041@sourceware.org> Date: Wed, 31 Aug 2022 12:39:09 +0000 (GMT) List-Id: https://gcc.gnu.org/g:25dd2768afdb8fad7b11d511eb5f739958f9870d commit r13-2309-g25dd2768afdb8fad7b11d511eb5f739958f9870d Author: Aldy Hernandez Date: Wed Aug 31 12:09:44 2022 +0200 Stream out endpoints for frange. We only stream out the FP properties for global float ranges (currently only NAN). The following patch adds the endpoints as well. gcc/ChangeLog: * value-range-storage.cc (frange_storage_slot::set_frange): Save endpoints. (frange_storage_slot::get_frange): Restore endpoints. * value-range-storage.h (class frange_storage_slot): Add endpoint fields. Diff: --- gcc/value-range-storage.cc | 18 +++++++----------- gcc/value-range-storage.h | 8 +++++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/gcc/value-range-storage.cc b/gcc/value-range-storage.cc index 494392737ac..b7a23fa9825 100644 --- a/gcc/value-range-storage.cc +++ b/gcc/value-range-storage.cc @@ -253,6 +253,8 @@ frange_storage_slot::set_frange (const frange &r) gcc_checking_assert (fits_p (r)); gcc_checking_assert (!r.undefined_p ()); + m_min = r.m_min; + m_max = r.m_max; m_props = r.m_props; } @@ -261,18 +263,12 @@ frange_storage_slot::get_frange (frange &r, tree type) const { gcc_checking_assert (r.supports_type_p (type)); - // FIXME: NANs get special treatment, because we need [NAN, NAN] in - // the range to properly represent it, not just the NAN flag in the - // property bits. This will go away when we stream out the - // endpoints. - if (m_props.get_nan ().yes_p ()) - { - r = frange_nan (type); - return; - } - - r.set_varying (type); + r.set_undefined (); + r.m_kind = VR_RANGE; r.m_props = m_props; + r.m_type = type; + r.m_min = m_min; + r.m_max = m_max; r.normalize_kind (); if (flag_checking) diff --git a/gcc/value-range-storage.h b/gcc/value-range-storage.h index 9cd6b9f7bec..f506789f3d1 100644 --- a/gcc/value-range-storage.h +++ b/gcc/value-range-storage.h @@ -113,9 +113,11 @@ class GTY (()) frange_storage_slot frange_storage_slot (const frange &r) { set_frange (r); } DISABLE_COPY_AND_ASSIGN (frange_storage_slot); - // We can get away with just storing the properties because the type - // can be gotten from the SSA, and UNDEFINED is unsupported, so it - // can only be a range. + // We can get away with just storing the properties and the + // endpoints because the type can be gotten from the SSA, and + // UNDEFINED is unsupported, so it can only be a VR_RANGE. + REAL_VALUE_TYPE m_min; + REAL_VALUE_TYPE m_max; frange_props m_props; };