public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>,
	Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org>,
	Andrew MacLeod <amacleod@redhat.com>,
	Aldy Hernandez <aldyh@redhat.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [RFC PATCH] range-op-float: Fix up op1_op2_relation of comparisons
Date: Wed, 12 Apr 2023 18:35:29 +0200	[thread overview]
Message-ID: <1C3AF517-6578-4052-8C9B-1D74953FB00D@gmail.com> (raw)
In-Reply-To: <ZDa+ZFg3Tfe4KG2w@tucnak>

On 12 April 2023 16:21:24 CEST, Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:

>--- gcc/range-op-float.cc.jj	2023-04-12 12:17:44.784962757 +0200
>+++ gcc/range-op-float.cc	2023-04-12 16:07:54.948759355 +0200
>@@ -835,10 +835,17 @@ public:
>   bool fold_range (irange &r, tree type,
> 		   const frange &op1, const frange &op2,
> 		   relation_trio = TRIO_VARYING) const final override;
>-  relation_kind op1_op2_relation (const irange &lhs, const frange &,
>-				  const frange &) const final override
>+  relation_kind op1_op2_relation (const irange &lhs, const frange &op1,
>+				  const frange &op2) const final override
>   {
>-    return lt_op1_op2_relation (lhs);
>+    relation_kind ret = lt_op1_op2_relation (lhs);
>+    if (ret == VREL_GE
>+	&& (op1.known_isnan ()
>+	    || op1.maybe_isnan ()
>+	    || op2.known_isnan ()
>+	    || op2.maybe_isnan ()))
>+      ret = VREL_VARYING; // Inverse of VREL_LT is VREL_UNGE with NAN ops.
>+    return ret;
>   }
>   bool op1_range (frange &r, tree type,
> 		  const irange &lhs, const frange &op2,
>@@ -952,9 +959,17 @@ public:
>   bool fold_range (irange &r, tree type,
> 		   const frange &op1, const frange &op2,
> 		   relation_trio rel = TRIO_VARYING) const final override;
>-  relation_kind op1_op2_relation (const irange &lhs, const frange &,
>-				  const frange &) const final override
>+  relation_kind op1_op2_relation (const irange &lhs, const frange &op1,
>+				  const frange &op2) const final override
>   {
>+    relation_kind ret = le_op1_op2_relation (lhs);
>+    if (ret == VREL_GT
>+	&& (op1.known_isnan ()
>+	    || op1.maybe_isnan ()
>+	    || op2.known_isnan ()
>+	    || op2.maybe_isnan ()))
>+      ret = VREL_VARYING; // Inverse of VREL_LE is VREL_UNGT with NAN ops.
>+    return ret;
>     return le_op1_op2_relation (lhs);

I think you forgot to delete the above return.

thanks,

  reply	other threads:[~2023-04-12 16:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11  8:21 Jakub Jelinek
2023-04-11  8:59 ` Aldy Hernandez
2023-04-11 20:58 ` Andrew MacLeod
2023-04-12 10:33   ` Jakub Jelinek
2023-04-12 14:21     ` Jakub Jelinek
2023-04-12 16:35       ` Bernhard Reutner-Fischer [this message]
2023-04-12 16:40         ` Jakub Jelinek

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=1C3AF517-6578-4052-8C9B-1D74953FB00D@gmail.com \
    --to=rep.dot.nop@gmail.com \
    --cc=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /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).