This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM patch: Improve Thumb epilogues (PR40657)


On 08/07/10 23:20, Bernd Schmidt wrote:
When optimizing for size, the Thumb-1 epilogue

         add     sp, sp, #12
         pop     {pc}

can be improved to

pop {r1-r3, pc}

I previously added this kind of optimization for prologues, and somehow
overlooked that the PR also mentions epilogues.

Regression tested with

Schedule of variations:
     qemu-system-armv7-2/arch=armv5te/thumb
     qemu-system-armv7-2/thumb

(as v4 and v5 apparently have slightly different epilogues)

Ok?


Bernd


You also need a test that the optimization isn't used when the result would be clobbered. For example, if the function returned long long and 12 bytes needed to be popped.

OK with that change.

R.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]