From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E9C8E3858415; Wed, 1 Sep 2021 23:55:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9C8E3858415 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/102162] Byte-wise access optimized away at -O1 and above Date: Wed, 01 Sep 2021 23:55:02 +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: unknown X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2021 23:55:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102162 --- Comment #20 from Andrew Pinski --- tem was the var_decl /* If TEM's type is a union of variable size, pass TARGET to the in= ner computation, since it will need a temporary and TARGET is known to have to do. This occurs in unchecked conversion in Ada. */ orig_op0 =3D op0 =3D expand_expr_real (tem, (TREE_CODE (TREE_TYPE (tem)) =3D=3D UNION_TYPE && COMPLETE_TYPE_P (TREE_TYPE (tem)) && (TREE_CODE (TYPE_SIZE (TREE_TYPE (tem))) !=3D INTEGER_CST) && modifier !=3D EXPAND_STACK_PARM ? target : NULL_RTX), VOIDmode, modifier =3D=3D EXPAND_SUM ? EXPAND_NORMAL : modifier, NULL, true); produces: (gdb) p debug_rtx(op0) (mem/c:SI (reg/f:DI 71) [1 output_len+0 S4 A32]) Note the A32 here. So it is a bug in the expansion of the var_decl.=