public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2742] frange::maybe_isnan() should return FALSE for undefined ranges. Date: Tue, 20 Sep 2022 18:22:53 +0000 (GMT) [thread overview] Message-ID: <20220920182253.D43303858004@sourceware.org> (raw) https://gcc.gnu.org/g:2438b6a4c8df0d1870881e123cc74cc62b7e58e8 commit r13-2742-g2438b6a4c8df0d1870881e123cc74cc62b7e58e8 Author: Aldy Hernandez <aldyh@redhat.com> Date: Tue Sep 20 16:09:31 2022 +0200 frange::maybe_isnan() should return FALSE for undefined ranges. Undefined ranges have undefined NAN bits. We can't depend on them, as they may contain garbage. This patch returns false from maybe_isnan() for undefined ranges (the empty set). gcc/ChangeLog: * value-range.h (frange::maybe_isnan): Return false for undefined ranges. Diff: --- gcc/value-range.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/value-range.h b/gcc/value-range.h index 7d5584a9294..325ed08f290 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -1210,6 +1210,8 @@ frange::known_isinf () const inline bool frange::maybe_isnan () const { + if (undefined_p ()) + return false; return m_pos_nan || m_neg_nan; }
reply other threads:[~2022-09-20 18:22 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220920182253.D43303858004@sourceware.org \ --to=aldyh@gcc.gnu.org \ --cc=gcc-cvs@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: linkBe 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).