public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: GCC patches <gcc-patches@gcc.gnu.org>
Cc: Andrew MacLeod <amacleod@redhat.com>, Aldy Hernandez <aldyh@redhat.com>
Subject: [COMMITTED] Do not check finite_operands_p twice in range-ops-float.
Date: Thu,  6 Oct 2022 08:23:17 +0200	[thread overview]
Message-ID: <20221006062318.1709996-2-aldyh@redhat.com> (raw)
In-Reply-To: <20221006062318.1709996-1-aldyh@redhat.com>

The uses of finite_operands_p removed are guarded by a call to
finite_operands_p already.

gcc/ChangeLog:

	* range-op-float.cc (foperator_lt::fold_range): Remove extra check
	to finite_operands_p.
	(foperator_le::fold_range): Same.
	(foperator_gt::fold_range): Same.
	(foperator_ge::fold_range): Same.
---
 gcc/range-op-float.cc | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc
index 6e9d51d3b4b..68578aa6fe7 100644
--- a/gcc/range-op-float.cc
+++ b/gcc/range-op-float.cc
@@ -572,8 +572,7 @@ foperator_lt::fold_range (irange &r, tree type,
     {
       if (real_less (&op1.upper_bound (), &op2.lower_bound ()))
 	r = range_true (type);
-      else if (finite_operands_p (op1, op2)
-	       && !real_less (&op1.lower_bound (), &op2.upper_bound ()))
+      else if (!real_less (&op1.lower_bound (), &op2.upper_bound ()))
 	r = range_false (type);
       else
 	r = range_true_and_false (type);
@@ -688,8 +687,7 @@ foperator_le::fold_range (irange &r, tree type,
     {
       if (real_compare (LE_EXPR, &op1.upper_bound (), &op2.lower_bound ()))
 	r = range_true (type);
-      else if (finite_operands_p (op1, op2)
-	       && !real_compare (LE_EXPR, &op1.lower_bound (), &op2.upper_bound ()))
+      else if (!real_compare (LE_EXPR, &op1.lower_bound (), &op2.upper_bound ()))
 	r = range_false (type);
       else
 	r = range_true_and_false (type);
@@ -796,8 +794,7 @@ foperator_gt::fold_range (irange &r, tree type,
     {
       if (real_compare (GT_EXPR, &op1.lower_bound (), &op2.upper_bound ()))
 	r = range_true (type);
-      else if (finite_operands_p (op1, op2)
-	       && !real_compare (GT_EXPR, &op1.upper_bound (), &op2.lower_bound ()))
+      else if (!real_compare (GT_EXPR, &op1.upper_bound (), &op2.lower_bound ()))
 	r = range_false (type);
       else
 	r = range_true_and_false (type);
@@ -912,8 +909,7 @@ foperator_ge::fold_range (irange &r, tree type,
     {
       if (real_compare (GE_EXPR, &op1.lower_bound (), &op2.upper_bound ()))
 	r = range_true (type);
-      else if (finite_operands_p (op1, op2)
-	       && !real_compare (GE_EXPR, &op1.upper_bound (), &op2.lower_bound ()))
+      else if (!real_compare (GE_EXPR, &op1.upper_bound (), &op2.lower_bound ()))
 	r = range_false (type);
       else
 	r = range_true_and_false (type);
-- 
2.37.1


  reply	other threads:[~2022-10-06  6:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06  6:23 [COMMITTED] Do not double print INF and NAN in frange pretty printer Aldy Hernandez
2022-10-06  6:23 ` Aldy Hernandez [this message]
2022-10-06  6:23 ` [COMMITTED] Setting explicit NANs sets UNDEFINED for -ffinite-math-only Aldy Hernandez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221006062318.1709996-2-aldyh@redhat.com \
    --to=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).