From: Aldy Hernandez <aldyh@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: GCC patches <gcc-patches@gcc.gnu.org>,
Andrew MacLeod <amacleod@redhat.com>,
Aldy Hernandez <aldyh@redhat.com>
Subject: [PATCH] [range-ops] Minor readability fix.
Date: Tue, 15 Nov 2022 17:31:35 +0100 [thread overview]
Message-ID: <20221115163135.604240-1-aldyh@redhat.com> (raw)
I know it's past the end of stage1, but I'm afraid we'll drag this
around forever in the GCC12 branch, and it's an easy readbility fix.
p.s. Or if you prefer:
if (!lb_nan && !ub_nan && !maybe_nan && ....)
r.clear_nan ();
OK for trunk?
gcc/ChangeLog:
* range-op-float.cc (range_operator_float::fold_range): Make check
for maybe_isnan more readable.
---
gcc/range-op-float.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc
index 53a0928c6aa..86107e16553 100644
--- a/gcc/range-op-float.cc
+++ b/gcc/range-op-float.cc
@@ -83,10 +83,12 @@ range_operator_float::fold_range (frange &r, tree type,
r.set (type, lb, ub);
- if (lb_nan || ub_nan || maybe_nan)
+ if (lb_nan || ub_nan || maybe_nan
+ || op1.maybe_isnan ()
+ || op2.maybe_isnan ())
// Keep the default NAN (with a varying sign) set by the setter.
;
- else if (!op1.maybe_isnan () && !op2.maybe_isnan ())
+ else
r.clear_nan ();
return true;
--
2.38.1
next reply other threads:[~2022-11-15 16:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 16:31 Aldy Hernandez [this message]
2022-11-17 2:15 ` Jeff Law
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=20221115163135.604240-1-aldyh@redhat.com \
--to=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).