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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

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

commit r14-8373-gdbc5f1f523b3cfa539d72fdd60b9479b3cd5a45d
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Tue Jan 23 19:59:00 2024 +0100

    c: Call c_fully_fold on __atomic_* operands in
atomic_bitint_fetch_using_cas_loop [PR113518]

    As the following testcase shows, I forgot to call c_fully_fold on the
    __atomic_*/__sync_* operands called on _BitInt address, the expressions
    are then used inside of TARGET_EXPR initializers etc. and are never fully
    folded later, which means we can ICE e.g. on C_MAYBE_CONST_EXPR trees
    inside of those.

    The following patch fixes it, while the function currently is only called
    in the C FE because C++ doesn't support BITINT_TYPE, I think guarding the
    calls on !c_dialect_cxx () is safer.

    2024-01-23  Jakub Jelinek  <ja...@redhat.com>

            PR c/113518
            * c-common.cc (atomic_bitint_fetch_using_cas_loop): Call
c_fully_fold
            on lhs_addr, val and model for C.

            * gcc.dg/bitint-77.c: New test.

Reply via email to