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

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

https://gcc.gnu.org/g:325646488a306c36c28e84260b4dd551bd30a47f

commit r17-4564-g325646488a306c36c28e84260b4dd551bd30a47f
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]>

Reply via email to