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

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Jakub Jelinek
<[email protected]>:

https://gcc.gnu.org/g:090a6cebe5a22843f08030dae1855bd1cd72a07c

commit r14-12929-g090a6cebe5a22843f08030dae1855bd1cd72a07c
Author: Jakub Jelinek <[email protected]>
Date:   Tue Sep 22 14:58:22 2026 +0200

    builtins: Fix further fallback of atomic builtins [PR127492]

    This is a continuation of the PR127336 problem, just in a different file.
    If TER results in val being expanded as a MEM, we need to force it into
    a register before the atomic operation (and as a bonus for
    expand_builtin_atomic_fetch_op even better reuse it also for the atomic
    call itself).

    2026-09-22  Jakub Jelinek  <[email protected]>

            PR middle-end/127492
            * builtins.cc (expand_builtin_atomic_fetch_op): Force val into a
            pseudo if updates to mem could change its value.
            (expand_ifn_atomic_bit_test_and): Likewise.

            * gcc.dg/pr127492.c: New test.

    Reviewed-by: Richard Biener <[email protected]>
    (cherry picked from commit 325646488a306c36c28e84260b4dd551bd30a47f)

Reply via email to