From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 36E253860015; Fri, 15 Mar 2024 23:29:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36E253860015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710545374; bh=QesyDL38+pnqvxrzq0Du9DNShCkWMi39JmMkP5NO8+g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=n92bAAu5//xCRKnojcKclq8ocTDE4HAp9VwqoIpTXgTqJF3nd92h7O4RRxUqp6rmu yVLN5mVqidM2SL1ykyBwy1ukvz0YnFFP3JczbjdoDmbcV9543YVeO6xBEDKi2Wp8nc eCngPh3qegdDv9/xrcPhgYVTsQfMY/v338cH2s6E= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114310] [11/12/13 Regression] [aarch64] __sync_val_compare_and_swap fails on __int128_t with newval = 0 Date: Fri, 15 Mar 2024 23:29:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 8.5.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114310 --- Comment #7 from GCC Commits --- The releases/gcc-13 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:1c907cee6163a3ec2c0edaebeace73e2d32835ee commit r13-8450-g1c907cee6163a3ec2c0edaebeace73e2d32835ee Author: Jakub Jelinek Date: Thu Mar 14 14:09:20 2024 +0100 aarch64: Fix TImode __sync_*_compare_and_exchange expansion with LSE [PR114310] The following testcase ICEs with LSE atomics. The problem is that the @atomic_compare_and_swap expander uses aarch64_reg_or_zero predicate for the desired operand, which is fine, given that for most of the modes and even for TImode in some cases it can handle zero immediate just fine, but the TImode @aarch64_compare_and_swap_lse just uses register_operand for that operand instead, again intentionally so, because the casp, caspa, caspl and caspal instructions need to use a pair of consecutive registers for the operand and xzr is just one register and we can't just store zero into the link register to emulate pair of zeros. So, the following patch fixes that by forcing the newval operand into a register for the TImode LSE case. 2024-03-14 Jakub Jelinek PR target/114310 * config/aarch64/aarch64.cc (aarch64_expand_compare_and_swap): = For TImode force newval into a register. * gcc.dg/pr114310.c: New test. (cherry picked from commit 9349aefa1df7ae36714b7b9f426ad46e314892d1)=