From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 364BC3858D38; Tue, 16 Jan 2024 09:27:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 364BC3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705397253; bh=UoacYLn7CF1N3HOXQQlTfulKSgZgHLegQjbI1AlC/4o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UFZ1eS8dUqfE+IJT73Z+HCnfncE1R6AvkNBt3G9UQdt2gPZ5KCfPCvsqz33PxMR1G 0wiLYOnYmTeua5vK7S2fejOMM+rTX88dafB1U87PIlJXqceHYtS15Mg2VTuMQ5PAtw 0r4N708V79AkhUTDMXjUhXH+qGa/jgr2HMAJjvhM= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/113395] RTL expansion of bitfield accesses drops MEM_EXPR Date: Tue, 16 Jan 2024 09:27:32 +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: alias, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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=3D113395 --- Comment #5 from Richard Biener --- Without fully lowering this on GIMPLE we could substitute the representative for the bitfield member in the MEM_EXPR and adjust adjust_address_1 to instead of using attrs.size to constrain the extent of the object designated by MEM_EXPR re-discover it. (I wonder if MEM_SIZE needs to be exact in a must-def way - ao_ref_from_mem certainly treats it that way instead of getting the size from the mode for non-BLKmode accesses) That said, lowering on GIMPLE is the way to go. Even iff only right before RTL expansion ...=