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/110755] [13/14 Regression] Wrong optimization of fabs on ppc64el at -O1
Date: Wed, 26 Jul 2023 08:52:58 +0000	[thread overview]
Message-ID: <bug-110755-4-t2VAqOvOSZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110755-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 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:21da32d995c8b574c929ec420cd3b0fcfe6fa4fe

commit r14-2782-g21da32d995c8b574c929ec420cd3b0fcfe6fa4fe
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jul 26 10:50:50 2023 +0200

    range-op-float: Fix up -frounding-math frange_arithmetic +- handling
[PR110755]

    IEEE754 says that x + (-x) and x - x result in +0 in all rounding modes
    but rounding towards negative infinity, in which case the result is -0
    for all finite x.  x + x and x - (-x) if it is zero retain sign of x.
    Now, range_arithmetic implements the normal rounds to even rounding,
    and as the addition or subtraction in those cases is exact, we don't do any
    further rounding etc. and e.g. on the testcase below distilled from glibc
    compute a range [+0, +INF], which is fine for -fno-rounding-math or
    if we'd have a guarantee that those statements aren't executed with
rounding
    towards negative infinity.

    I believe it is only +- which has this problematic behavior and I think
    it is best to deal with it in frange_arithmetic; if we know -frounding-math
    is on, it is x + (-x) or x - x and we are asked to round to negative
    infinity (i.e. want low bound rather than high bound), change +0 result to
    -0.

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

            PR tree-optimization/110755
            * range-op-float.cc (frange_arithmetic): Change +0 result to -0
            for PLUS_EXPR or MINUS_EXPR if -frounding-math, inf is negative and
            it is exact op1 + (-op1) or op1 - op1.

            * gcc.dg/pr110755.c: New test.

  parent reply	other threads:[~2023-07-26  8:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20 20:18 [Bug target/110755] New: " aurelien at aurel32 dot net
2023-07-20 20:25 ` [Bug target/110755] " pinskia at gcc dot gnu.org
2023-07-20 20:28 ` aurelien at aurel32 dot net
2023-07-20 20:31 ` [Bug tree-optimization/110755] [13/14 Regression] " pinskia at gcc dot gnu.org
2023-07-21  6:56 ` rguenth at gcc dot gnu.org
2023-07-21  8:11 ` jakub at gcc dot gnu.org
2023-07-21  8:38 ` jakub at gcc dot gnu.org
2023-07-22 20:20 ` aurelien at aurel32 dot net
2023-07-24  7:12 ` jakub at gcc dot gnu.org
2023-07-24  7:47 ` jakub at gcc dot gnu.org
2023-07-24 18:31 ` aurelien at aurel32 dot net
2023-07-26  8:52 ` cvs-commit at gcc dot gnu.org [this message]
2023-07-26 10:00 ` [Bug tree-optimization/110755] [13 " jakub at gcc dot gnu.org
2023-07-27  9:27 ` rguenth at gcc dot gnu.org
2023-07-27 17:53 ` cvs-commit at gcc dot gnu.org
2023-08-30 22:21 ` jakub at gcc dot gnu.org
2023-11-06  2:38 ` hp 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-110755-4-t2VAqOvOSZ@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).