public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6896] range-op-float: Use get_nan_state in float_widen_lhs_range
@ 2023-03-28  8:56 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2023-03-28  8:56 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ccaee0d2c994ada5be6bcaae1ce3e43ca56fc617

commit r13-6896-gccaee0d2c994ada5be6bcaae1ce3e43ca56fc617
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Mar 28 10:55:31 2023 +0200

    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  <jakub@redhat.com>
    
            * 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:
---
 gcc/range-op-float.cc | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc
index 95641144627..dc9789b4ffd 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;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-28  8:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28  8:56 [gcc r13-6896] range-op-float: Use get_nan_state in float_widen_lhs_range Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).