public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub 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: Fri, 21 Jul 2023 08:11:24 +0000	[thread overview]
Message-ID: <bug-110755-4-VmRgZwIELu@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 #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
A big hammer solution might be to treat flag_rounding_math in frange::set the
same as
!HONOR_SIGNED_ZEROS, i.e. always extend [0, x] ranges to [-0, x] and [y, -0] to
[y, 0]
because we don't know what the rounding will do:
-  else if (!HONOR_SIGNED_ZEROS (m_type))
+  else if (!HONOR_SIGNED_ZEROS (m_type) || flag_rounding_math)
     {
       if (real_iszero (&m_max, 1))
         m_max.sign = 0;
       if (real_iszero (&m_min, 0))
         m_min.sign = 1;
     }
Though, such a change would affect even say operator_abs handling where we even
for flag_rounding_math are guaranteed the sign will be positive (unless
-fno-signed-zeros, in that case it is right we don't assume anything).
Or do it in range_operator::fold_range?  Or some other spot?
Generally, operations like neg, abs, comparisons should be fine, but +-*/ at
least in the fold_range direction probably need to do that.

  parent reply	other threads:[~2023-07-21  8:11 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 [this message]
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
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-VmRgZwIELu@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).