From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0A99F38582A1; Tue, 23 Jan 2024 18:59:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A99F38582A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706036383; bh=LoFRw7cMfi9+uzfFPED9PqThd6Ry5Irbnnm8G7F5Svk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=A6qWd7XJ1gLtYtNZEVEJsqehxBOB77bhL/+L+IesDlMfvPNHNNpz+A/jkG8lZvlPG /OgkBfxHqETsGKX31z/GEUEGG6TT9Vn5wVHpE65wZNVh1AOOp+T2WjWGOSAZOgM398 Ad7UnS1WmX1zfVzomnflH4DY+leLYvto9vFKeMQo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/113518] ICE: in gimplify_expr, at gimplify.cc:18596 with atomic_fetch_or_explicit() on _BitInt() Date: Tue, 23 Jan 2024 18:59:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.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: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D113518 --- Comment #3 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:dbc5f1f523b3cfa539d72fdd60b9479b3cd5a45d commit r14-8373-gdbc5f1f523b3cfa539d72fdd60b9479b3cd5a45d Author: Jakub Jelinek 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 ful= ly 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 call= ed in the C FE because C++ doesn't support BITINT_TYPE, I think guarding t= he calls on !c_dialect_cxx () is safer. 2024-01-23 Jakub Jelinek 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.=