From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DA8A83858425; Thu, 22 Dec 2022 16:29:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA8A83858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671726591; bh=rWreOvbWr19tnlxnCJIUi5bf4nGCExsw5FalOgFJo9I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DQQ4gnD0QS3ibHcqYd+uyoDuoIULZV/YQRkVHKWbS1rKg9fY68FyxaDsa0nhLSEY8 V060KuvKtS3JnkXJBqtrpEGMZ85C0lx+1xhc1iT5E2WNW713ebGGZl2SnjXjcHqpZH cXt5Cx0yzpQrGsBAqxVA55BGaGgwih4xG9mSeuEk= From: "krebbel at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108199] Bitfields and storage_order_attribute Date: Thu, 22 Dec 2022 16:29:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: krebbel at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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=3D108199 --- Comment #3 from Andreas Krebbel --- Moving the local definition of dst out of the function to global scope prev= ents the store from getting eliminated. union DST dst; As expected the store is still in the FRE dump: _1 =3D src_6(D)->a; dst.val =3D _1; <--- _2 =3D BIT_FIELD_REF ; _3 =3D _2 & 64; if (_3 !=3D 0) ... and the first by is accessed: bar: movq (%rdi), %rax movq %rax, dst(%rip) testb $64, %al jne .L11=