https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115505

            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=58438&action=edit
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%

Reply via email to