public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/108068] [10/11/12/13 Regression] decimal floating point signed zero is not honored
Date: Wed, 21 Dec 2022 12:11:52 +0000	[thread overview]
Message-ID: <bug-108068-4-Jbsmh7WqFL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108068-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jsm28 at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
           Priority|P3                          |P2

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Optimizing statement if (_5 != 0)

Visiting conditional with predicate: if (_5 != 0)

With known ranges
        _5: [unsupported_range] UNDEFINED

Predicate evaluates to: DON'T KNOW
LKUP STMT _5 ne_expr 0
0>>> COPY _5 = 0
<<<< COPY _5 = 0

the issue is we do

              bool can_infer_simple_equiv
                = !(HONOR_SIGNED_ZEROS (op1)
                    && (TREE_CODE (op1) == SSA_NAME || real_zerop (op1)));

but real_zerop is false for Decimal zero.  That's because "Trailing zeroes
matter for decimal float constants, so don't return 1 for them.".  We'd
need a real_maybe_zerop () for this usage.  We have other !real_zerop
checks in match.pd and elsewhere, those are susceptible as well.

Joseph, do you think adding DECIMAL_FLOAT_MODE_P checks in users is what
we want to do or do you think a real_nonzerop would be more appropriate
here?  I guess DOM want's to ask whether op1 may compare equal to zero.

  parent reply	other threads:[~2022-12-21 12:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12  8:53 [Bug c/108068] New: decimal " ntysdd at qq dot com
2022-12-12 16:54 ` [Bug tree-optimization/108068] [10/11/12/13 Regression] decimal floating point " pinskia at gcc dot gnu.org
2022-12-21 12:11 ` rguenth at gcc dot gnu.org [this message]
2022-12-21 15:08 ` jakub at gcc dot gnu.org
2022-12-21 15:45 ` jakub at gcc dot gnu.org
2022-12-21 17:37 ` joseph at codesourcery dot com
2022-12-21 17:53 ` jakub at gcc dot gnu.org
2022-12-22  7:12 ` rguenth at gcc dot gnu.org
2022-12-22 10:36 ` jakub at gcc dot gnu.org
2022-12-22 10:40 ` jakub at gcc dot gnu.org
2022-12-22 11:36 ` rguenther at suse dot de
2022-12-23 15:22 ` cvs-commit at gcc dot gnu.org
2022-12-23 15:23 ` [Bug tree-optimization/108068] [10/11/12 " jakub at gcc dot gnu.org
2023-02-10 17:45 ` cvs-commit at gcc dot gnu.org
2023-02-10 17:58 ` [Bug tree-optimization/108068] [10/11 " jakub at gcc dot gnu.org
2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org
2023-05-03  9:33 ` [Bug tree-optimization/108068] [10 " jakub at gcc dot gnu.org
2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
2023-05-04  7:22 ` 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-108068-4-Jbsmh7WqFL@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).