public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/108540] [13 Regression] Frange miscompilation of ruby since r13-3261
Date: Thu, 26 Jan 2023 16:28:34 +0000	[thread overview]
Message-ID: <bug-108540-4-0oEQTVSJfk@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108540-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108540

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:09176201ec6a21c25b1edb07f19f83be22a123f9

commit r13-5397-g09176201ec6a21c25b1edb07f19f83be22a123f9
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Jan 26 17:21:22 2023 +0100

    frange: Fix up foperator_{,not_}equal::fold_range for signed zeros
[PR108540]

    The following testcases are miscompiled, because threader sees some
    SSA_NAME would have -0.0 value and when computing range of SSA_NAME == 0.0
    foperator_equal::fold_range sees one operand has [-0.0, -0.0] singleton
    range, the other [0.0, 0.0], they aren't equal (frange operator== uses
    real_identical etc. rather than real comparisons) and so it thinks they
    compare unequal.  With signed zeros -0.0 == 0.0 is true though, so we
    need to special case the both ranges singleton code.
    Similarly, if we see op1 range being say [-42.0, -0.0] and op2 range
    [0.0, 42.0], we'd check that the intersection of the two ranges is empty
    (that is correct) and fold the result of == between such operands to
    [0, 0] which is wrong, because -0.0 == 0.0, it needs to be [0, 1].
    Similarly for foperator_not_equal::fold_range.

    2023-01-26  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/108540
            * range-op-float.cc (foperator_equal::fold_range): If both op1 and
op2
            are singletons, use range_true even if op1 != op2
            when one range is [-0.0, -0.0] and another [0.0, 0.0].  Similarly,
            even if intersection of the ranges is empty and one has
            zero low bound and another zero high bound, use
range_true_and_false
            rather than range_false.
            (foperator_not_equal::fold_range): If both op1 and op2
            are singletons, use range_false even if op1 != op2
            when one range is [-0.0, -0.0] and another [0.0, 0.0].  Similarly,
            even if intersection of the ranges is empty and one has
            zero low bound and another zero high bound, use
range_true_and_false
            rather than range_true.

            * gcc.c-torture/execute/ieee/pr108540-1.c: New test.
            * gcc.c-torture/execute/ieee/pr108540-2.c: New test.

  parent reply	other threads:[~2023-01-26 16:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25 15:48 [Bug tree-optimization/108540] New: " jakub at gcc dot gnu.org
2023-01-25 15:52 ` [Bug tree-optimization/108540] " jakub at gcc dot gnu.org
2023-01-26 11:27 ` jakub at gcc dot gnu.org
2023-01-26 11:41 ` jakub at gcc dot gnu.org
2023-01-26 12:16 ` jakub at gcc dot gnu.org
2023-01-26 12:37 ` jakub at gcc dot gnu.org
2023-01-26 13:08 ` jakub at gcc dot gnu.org
2023-01-26 13:29 ` aldyh at gcc dot gnu.org
2023-01-26 16:28 ` cvs-commit at gcc dot gnu.org [this message]
2023-01-27 20:39 ` jakub at gcc dot gnu.org

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=bug-108540-4-0oEQTVSJfk@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).