This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR46932: Block auto increment on frame pointer
- From: Jeff Law <law at redhat dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: nd <nd at arm dot com>
- Date: Tue, 25 Jul 2017 14:42:10 -0600
- Subject: Re: [PATCH] Fix PR46932: Block auto increment on frame pointer
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=law at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 279047C850
- References: <AM5PR0802MB2610C93E52AAFEFD3A1DA5B283A70@AM5PR0802MB2610.eurprd08.prod.outlook.com>
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 <wdijkstr@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