From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 81386385781A; Mon, 22 Mar 2021 15:19:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81386385781A From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/99712] New: Cannot elide aggregate parameter setup Date: Mon, 22 Mar 2021 15:19:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Mon, 22 Mar 2021 15:19:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99712 Bug ID: 99712 Summary: Cannot elide aggregate parameter setup Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- On arm32 for struct X { int a; int b; int c; int d; int e; }; volatile int i; void bar (struct X); void foo (struct X x) { i =3D x.a; // i =3D x.e; } we are not able to elide the argument setup generated by RTL expansion: foo: @ args =3D 20, pretend =3D 16, frame =3D 0 @ frame_needed =3D 0, uses_anonymous_args =3D 0 @ link register save eliminated. sub sp, sp, #16 sub ip, sp, #4 add sp, sp, #16 stmib ip, {r0, r1, r2, r3} movw r3, #:lower16:.LANCHOR0 movt r3, #:upper16:.LANCHOR0 str r0, [r3] bx lr note the stmib and all the stack slot setup while we were able to CSE the "load" to r0. It looks like the frame setup is not subject to DSE, it's generated as (insn 2 4 3 2 (parallel [ (set (mem/c:SI (reg/f:SI 107 virtual-incoming-args) [2 x+0 S4 A= 32]) (reg:SI 0 r0)) (set (mem/c:SI (plus:SI (reg/f:SI 107 virtual-incoming-args) (const_int 4 [0x4])) [2 x+4 S4 A32]) (reg:SI 1 r1)) (set (mem/c:SI (plus:SI (reg/f:SI 107 virtual-incoming-args) (const_int 8 [0x8])) [2 x+8 S4 A32]) (reg:SI 2 r2)) (set (mem/c:SI (plus:SI (reg/f:SI 107 virtual-incoming-args) (const_int 12 [0xc])) [2 x+12 S4 A32]) (reg:SI 3 r3)) ]) "t.c":7:1 -1 (nil)) (note 3 2 6 2 NOTE_INSN_FUNCTION_BEG)=