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/114130] [11/12/13 Regression] RISC-V: `__atomic_compare_exchange` does not use sign-extended value for RV64
Date: Thu, 11 Apr 2024 06:52:48 +0000	[thread overview]
Message-ID: <bug-114130-4-ncjRc7fbqx@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114130-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Kito Cheng <kito@gcc.gnu.org>:

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

commit r12-10319-gd37be5c0413783c5459c5664b6ffb9f47acfca4e
Author: Kito Cheng <kito.cheng@sifive.com>
Date:   Wed Feb 28 16:01:52 2024 +0800

    RISC-V: Fix __atomic_compare_exchange with 32 bit value on RV64

    atomic_compare_and_swapsi will use lr.w to do obtain the original value,
    which sign extends to DI.  RV64 only has DI comparisons, so we also need
    to sign extend the expected value to DI as otherwise the comparison will
    fail when the expected value has the 32nd bit set.

    gcc/ChangeLog:

            PR target/114130
            * config/riscv/sync.md (atomic_compare_and_swap<mode>): Sign
            extend the expected value if needed.

    gcc/testsuite/ChangeLog:

            * gcc.target/riscv/pr114130.c: New.

    Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
    (cherry picked from commit fd07a29e39f5347d6cef3e7042a32306f97a1719)

  parent reply	other threads:[~2024-04-11  6:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 13:42 [Bug target/114130] New: RISC-V: `__atomic_compare_exchange` does not use sign-extended value x at maxxsoft dot net
2024-02-28  5:14 ` [Bug target/114130] " pinskia at gcc dot gnu.org
2024-02-28  8:01 ` [Bug target/114130] [11/12/13/14 Regression] RISC-V: `__atomic_compare_exchange` does not use sign-extended value for RV64 rguenth at gcc dot gnu.org
2024-02-29  3:05 ` cvs-commit at gcc dot gnu.org
2024-04-11  1:21 ` [Bug target/114130] [11/12/13 " cvs-commit at gcc dot gnu.org
2024-04-11  6:52 ` cvs-commit at gcc dot gnu.org [this message]
2024-04-12  8:06 ` [Bug target/114130] [11 " cvs-commit at gcc dot gnu.org
2024-04-12  8:06 ` kito 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-114130-4-ncjRc7fbqx@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).