From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 51920386181E; Thu, 23 Nov 2023 12:00:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51920386181E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700740833; bh=l0hLpIF/SP3Gxkj869spOtbaL98qnA7EMD+NY/YWRXI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ohmFcW3Khs/opOrvl5P1u/o2CO7UVZaxr28ZNmxAtkfb72Eg4s23Zu2FrgsUMOlus xBp6d7s3mkYb+3WJnA4zAs9wOnrlM4V+PF8Zy0m0fJ0S3HcRt0FMdYvIh8nrtDzpcU kA0Ru+npYEO7RehnphKbRfqFtSz5JUlp4FBcUHUY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112336] fsanitize=address vs _BitInt with a non-mode size (smaller than max mode size) Date: Thu, 23 Nov 2023 12:00:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end 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=3D112336 --- Comment #5 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:f9982ef4f55bd3a63745e03ac6d68b4a92fa8bce commit r14-5776-gf9982ef4f55bd3a63745e03ac6d68b4a92fa8bce Author: Jakub Jelinek Date: Thu Nov 23 12:59:54 2023 +0100 expr: Fix &bitint_var handling in initializers [PR112336] As the following testcase shows, we ICE when trying to emit ADDR_EXPR of a bitint variable which doesn't have mode width. The problem is in the EXTEND_BITINT stuff which makes sure we treat the padding bits on memory reads from user bitint vars as undefined. When expanding ADDR_EXPR on such vars inside outside of initializers, expand_expr_addr* uses EXPAND_CONST_ADDRESS modifier and EXTEND_BITINT does nothing, but in initializers it keeps using EXPAND_INITIALIZER modifier. So, we need to treat EXPAND_INITIALIZER the same as EXPAND_CONST_ADDRESS for this regard. 2023-11-23 Jakub Jelinek PR middle-end/112336 * expr.cc (EXTEND_BITINT): Don't call reduce_to_bit_field_preci= sion if modifier is EXPAND_INITIALIZER. * gcc.dg/bitint-41.c: New test.=