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 rtl-optimization/99930] Failure to optimize floating point -abs(x) in nontrivial code at -O2/3
Date: Tue, 06 Apr 2021 11:57:05 +0000	[thread overview]
Message-ID: <bug-99930-4-NioTV3VrEp@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99930-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-04-06
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
             Target|                            |x86_64-*-*
          Component|target                      |rtl-optimization

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  At -O1

Trying 10 -> 12:
   10: {r91:SF=abs(r92:SF);use [`*.LC0'];clobber flags:CC;}
      REG_UNUSED flags:CC
      REG_DEAD r92:SF
   12: {r94:SF=-r91:SF;use r95:V4SF;clobber flags:CC;}
      REG_DEAD r95:V4SF
      REG_DEAD r91:SF
      REG_UNUSED flags:CC
Failed to match this instruction:
(parallel [
        (set (reg:SF 94)
            (neg:SF (abs:SF (reg:SF 92 [ *n_9(D) ]))))
        (use (reg:V4SF 95))
        (clobber (reg:CC 17 flags))
    ])
Successfully matched this instruction:
(parallel [
        (set (reg:SF 94)
            (neg:SF (abs:SF (reg:SF 92 [ *n_9(D) ]))))
        (use (reg:V4SF 95))
    ])
allowing combination of insns 10 and 12
original costs 4 + 4 = 8
replacement cost 8

but with -O2:

Trying 10 -> 12:
   10: {r91:SF=abs(r92:SF);use r93:V4SF;clobber flags:CC;}
      REG_DEAD r92:SF
      REG_UNUSED flags:CC
   12: {r94:SF=-r91:SF;use r95:V4SF;clobber flags:CC;}
      REG_DEAD r91:SF
      REG_UNUSED flags:CC
Can't combine i2 into i3

we're later trying

Trying 10, 12 -> 13:
   10: {r91:SF=abs(r92:SF);use r93:V4SF;clobber flags:CC;}
      REG_DEAD r92:SF
      REG_UNUSED flags:CC
   12: {r94:SF=-r91:SF;use r95:V4SF;clobber flags:CC;}
      REG_DEAD r91:SF
      REG_UNUSED flags:CC
   13: flags:CCFP=cmp(r90:SF,r94:SF)
      REG_DEAD r94:SF
Failed to match this instruction:
(set (reg:CCFP 17 flags)
    (compare:CCFP (neg:SF (abs:SF (reg:SF 92 [ *n_9(D) ])))
        (reg/v:SF 90 [ m ])))
Failed to match this instruction:
(set (reg:SF 94)
    (abs:SF (reg:SF 92 [ *n_9(D) ])))

  reply	other threads:[~2021-04-06 11:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 10:38 [Bug target/99930] New: " core13 at gmx dot net
2021-04-06 11:57 ` rguenth at gcc dot gnu.org [this message]
2021-04-06 12:00 ` [Bug rtl-optimization/99930] " rguenth at gcc dot gnu.org
2021-04-06 17:31 ` segher at gcc dot gnu.org
2021-04-07 10:04 ` jakub at gcc dot gnu.org
2021-04-07 10:06 ` jakub at gcc dot gnu.org
2021-04-07 10:14 ` ubizjak at gmail dot com
2021-04-07 10:27 ` crazylht at gmail dot com
2021-04-07 16:32 ` segher at gcc dot gnu.org
2021-04-08  9:48 ` crazylht at gmail dot com
2021-04-08 22:46 ` segher at gcc dot gnu.org
2021-07-25  1:30 ` pinskia at gcc dot gnu.org
2023-12-24 23:16 ` [Bug middle-end/99930] " pinskia 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-99930-4-NioTV3VrEp@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).