On 19/12/13 16:42, Eric Botcazou wrote:
>> This generates:
>>
>> sub sp, sp, #n
>> str ip, [sp]
>>
>> which can be done in one instruction, vis:
>>
>> str ip, [sp, #-n]!
>>
>> Very similar code to do this essentially already exists a few lines
>> earlier (in the args_to_push == 0 case), but needs tweaking to use
>> pre-modify rather than pre-dec when n != 4.
>
> Thanks for the hint, I obviously don't think the ARM way yet...
>
>> I'll pre-approve a patch that makes that change.
>
> Revised patch attached. It generates:
>
> @ Nested: function declared inside another function.
> @ args = 8, pretend = 4, frame = 0
> @ frame_needed = 1, uses_anonymous_args = 0
> str ip, [sp, #-4]!
> add ip, sp, #4
> stmfd sp!, {fp, ip, lr, pc}
> sub fp, ip, #8
> ldr ip, [fp, #4]
>
> on arm-vxworks and:
>
> @ Function supports interworking.
> @ Nested: function declared inside another function.
> @ args = 12, pretend = 8, frame = 0
> @ frame_needed = 1, uses_anonymous_args = 0
> str ip, [sp, #-8]!
> add ip, sp, #8
> stmfd sp!, {fp, ip, lr, pc}
> sub fp, ip, #12
> ldr ip, [fp, #4]
>
> on arm-eabi and your testcase passes with it. I'll test it over the next few
> days and install it on mainline if everything is as expected.
>
Thanks. LGTM.
R.