public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3301] Normalize ranges over the range for both bounds when -ffinite-math-only.
@ 2022-10-14 14:27 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2022-10-14 14:27 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:464f0503b91f11ba65e95319088cb68ee872c76f

commit r13-3301-g464f0503b91f11ba65e95319088cb68ee872c76f
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Fri Oct 14 12:07:40 2022 +0200

    Normalize ranges over the range for both bounds when -ffinite-math-only.
    
    [-Inf, +Inf] was being chopped correctly for -ffinite-math-only, but
    [-Inf, -Inf] was not.  This was latent because a bug in
    real_isdenormal is causing us to flush -Inf to zero.
    
    gcc/ChangeLog:
    
            * value-range.cc (frange::set): Normalize ranges for both bounds.

Diff:
---
 gcc/value-range.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 86550f158b8..6b4f3dddcd5 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -340,8 +340,12 @@ frange::set (tree type,
       REAL_VALUE_TYPE max_repr = frange_val_max (m_type);
       if (real_less (&m_min, &min_repr))
 	m_min = min_repr;
+      else if (real_less (&max_repr, &m_min))
+	m_min = max_repr;
       if (real_less (&max_repr, &m_max))
 	m_max = max_repr;
+      else if (real_less (&m_max, &min_repr))
+	m_max = min_repr;
     }
 
   // Check for swapped ranges.

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

only message in thread, other threads:[~2022-10-14 14:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14 14:27 [gcc r13-3301] Normalize ranges over the range for both bounds when -ffinite-math-only Aldy Hernandez

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).