public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Sandiford <rsandifo@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-4880] aarch64: Avoid bogus atomics match
Date: Tue, 24 Oct 2023 09:58:52 +0000 (GMT)	[thread overview]
Message-ID: <20231024095852.5BD183858401@sourceware.org> (raw)

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

commit r14-4880-gb632a516a0448818a25f35e15a4bf0a3187af359
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Tue Oct 24 10:58:40 2023 +0100

    aarch64: Avoid bogus atomics match
    
    The non-LSE pattern aarch64_atomic_exchange<mode> comes before the
    LSE pattern aarch64_atomic_exchange<mode>_lse.  From a recog
    perspective, the only difference between the patterns is that
    the non-LSE one clobbers CC and needs a scratch.
    
    However, combine and RTL-SSA can both add clobbers to make a
    pattern match.  This means that if they try to rerecognise an
    LSE pattern, they could end up turning it into a non-LSE pattern.
    This patch adds a !TARGET_LSE test to avoid that.
    
    This is needed to avoid a regression with later patches.
    
    gcc/
            * config/aarch64/atomics.md (aarch64_atomic_exchange<mode>): Require
            !TARGET_LSE.

Diff:
---
 gcc/config/aarch64/atomics.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/aarch64/atomics.md b/gcc/config/aarch64/atomics.md
index 2b6f04efa6c9..055a87320caa 100644
--- a/gcc/config/aarch64/atomics.md
+++ b/gcc/config/aarch64/atomics.md
@@ -224,7 +224,7 @@
       UNSPECV_ATOMIC_EXCHG))
    (clobber (reg:CC CC_REGNUM))
    (clobber (match_scratch:SI 4 "=&r"))]
-  ""
+  "!TARGET_LSE"
   "#"
   "&& epilogue_completed"
   [(const_int 0)]

                 reply	other threads:[~2023-10-24  9:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20231024095852.5BD183858401@sourceware.org \
    --to=rsandifo@gcc.gnu.org \
    --cc=gcc-cvs@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).