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 target/102224] [9/10 regession] wrong code for `x * copysign(1.0, x)` since r9-5298-g33142cf9cf82aa1f
Date: Tue, 10 May 2022 08:20:34 +0000	[thread overview]
Message-ID: <bug-102224-4-oeBVannemy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102224-4@http.gcc.gnu.org/bugzilla/>

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

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

https://gcc.gnu.org/g:c7b00fbc469bc9c0a486b48bc349dba13881241e

commit r10-10641-gc7b00fbc469bc9c0a486b48bc349dba13881241e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Sep 8 11:25:31 2021 +0200

    i386: Fix up @xorsign<mode>3_1 [PR102224]

    As the testcase shows, we miscompile @xorsign<mode>3_1 if both input
    operands are in the same register, because the splitter overwrites op1
    before with op1 & mask before using op0.

    For dest = xorsign op0, op0 we can actually simplify it from
    dest = (op0 & mask) ^ op0 to dest = op0 & ~mask (aka abs).

    The expander change is an optimization improvement, if we at expansion
    time know it is xorsign op0, op0, we can emit abs right away and get better
    code through that.

    The @xorsign<mode>3_1 is a fix for the case where xorsign wouldn't be known
    to have same operands during expansion, but during RTL optimizations they
    would appear.  We need to use earlyclobber, we require dest and op1 to be
    the same but op0 must be different because we overwrite
    op1 first.

    2021-09-08  Jakub Jelinek  <jakub@redhat.com>

            PR target/102224
            * config/i386/i386.md (xorsign<mode>3): If operands[1] is equal to
            operands[2], emit abs<mode>2 instead.
            (@xorsign<mode>3_1): Add early-clobber for output operand.

            * gcc.dg/pr102224.c: New test.
            * gcc.target/i386/avx-pr102224.c: New test.

    (cherry picked from commit a7b626d98a9a821ffb33466818d6aa86cac1d6fd)

  parent reply	other threads:[~2022-05-10  8:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07  2:56 [Bug tree-optimization/102224] New: Incorrect compile on `x * copysign(1.0, x)` gabravier at gmail dot com
2021-09-07  2:58 ` [Bug tree-optimization/102224] " gabravier at gmail dot com
2021-09-07  2:59 ` gabravier at gmail dot com
2021-09-07  3:01 ` gabravier at gmail dot com
2021-09-07  3:04 ` [Bug target/102224] " pinskia at gcc dot gnu.org
2021-09-07  3:06 ` [Bug target/102224] [12 regession] wrong code for " pinskia at gcc dot gnu.org
2021-09-07  3:07 ` gabravier at gmail dot com
2021-09-07  3:18 ` [Bug target/102224] [9/10/11/12 " gabravier at gmail dot com
2021-09-07  3:25 ` gabravier at gmail dot com
2021-09-07  6:37 ` rguenth at gcc dot gnu.org
2021-09-07  9:33 ` [Bug target/102224] [9/10/11/12 regession] wrong code for `x * copysign(1.0, x)` since r9-5298-g33142cf9cf82aa1f marxin at gcc dot gnu.org
2021-09-07  9:51 ` jakub at gcc dot gnu.org
2021-09-07 11:25 ` jakub at gcc dot gnu.org
2021-09-07 18:53 ` pinskia at gcc dot gnu.org
2021-09-08  9:26 ` cvs-commit at gcc dot gnu.org
2021-09-08 10:08 ` [Bug target/102224] [9/10/11 " jakub at gcc dot gnu.org
2021-09-08 18:02 ` cvs-commit at gcc dot gnu.org
2021-09-08 18:03 ` [Bug target/102224] [9/10 " jakub at gcc dot gnu.org
2022-05-10  8:20 ` cvs-commit at gcc dot gnu.org [this message]
2022-05-11  6:22 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:36 ` 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-102224-4-oeBVannemy@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).