On 07/20/2017 08:49 AM, Wilco Dijkstra wrote:
> Block auto increment on frame pointer references.  This is never
> beneficial since the SFP expands into SP+C or FP+C during register
> allocation.  The generated code for the testcase is now as expected:
> 
>       str     x30, [sp, -32]!
>       strb    w0, [sp, 31]
>       add     x0, sp, 31
>       bl      foo3
>       ldr     x30, [sp], 32
>       ret
> 
> On SPEC2017 codesize improves uniformly across the board.
> 
> ChangeLog:
> 2017-07-20  Wilco Dijkstra  <wdijk...@arm.com>
> 
>       PR middle-end/46932
>       * auto-inc-dec.c (parse_add_or_inc): Block autoinc on sfp.
> 
> gcc/testsuite/
> 
>       * gcc.dg/pr46932.c: New testcase.
My only concern here would be cases where we don't end up eliminating FP
to SP.  But I'd think it's unlikely that we'd have enough auto-inc
opportunities on the frame pointer for it to matter much anyway.

OK for the trunk.

jeff

Reply via email to