From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E4E0638708D1; Sat, 15 Jun 2024 13:51:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E4E0638708D1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718459515; bh=jfA+NL9ZRERrx3ZiWwg7chdFFj4u6hvEAeFqz3LojZg=; h=From:To:Subject:Date:From; b=U4/tXE2wrK1RU2SkiVUqP5D2zSzAzCgkdc3ew42lWDIBu5kF5wl8bSYNWNDXvV+rT TgzD/b3flHUi7RQf0tmPAKbOVqTh0z9h7+GSzhKXACYby44VKZaBWeDHGeTEmMgF17 Yw3zn1UFityfjlF0EDapgyWnkTt/MQaRB/kyfl3g= From: "lis8215 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/115505] New: missing optimization: thumb1 use ldmia/stmia for load store DI/DF data when possible Date: Sat, 15 Jun 2024 13:51:55 +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: 15.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lis8215 at gmail dot com 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 attachments.created 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115505 Bug ID: 115505 Summary: missing optimization: thumb1 use ldmia/stmia for load store DI/DF data when possible Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: lis8215 at gmail dot com Target Milestone: --- Created attachment 58438 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D58438&action=3Dedit possible solution patch At the moment GCC emits two ldr/str instructions for DI/DF modes load/store. However there's a trick to use ldmia/stmia when address register in not used anymore/dead or reused. I don't know if it affects arm and/or thumb2 as well. Patch for possible solution for thumb1 provided. Comparing code size with the patch gives for v6-m/nofp: libgcc: -52 bytes / -0.10% Newlib's libc: -68 bytes / -0.03% libm: -96 bytes / -0.10% libstdc++: -140 bytes / -0.02%=