This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][AArch64] PR60580: Fix frame pointer option magic
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Tue, 24 Oct 2017 17:19:42 +0100
- Subject: Re: [PATCH][AArch64] PR60580: Fix frame pointer option magic
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=bestguesspass action=none header.from=arm.com;
- Nodisclaimer: True
- References: <DB6PR0801MB2053D1D2DB09C229125AE69C83B60@DB6PR0801MB2053.eurprd08.prod.outlook.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Fri, Aug 04, 2017 at 04:46:09PM +0100, Wilco Dijkstra wrote:
> To fix PR60580 simplify the logic in aarch64_override_options_after_change_1 ().
> If the frame pointer is enabled, set it to a special value that behaves similar
> to frame pointer omission. If we don't do this all leaf functions will get a
> frame pointer even if flag_omit_leaf_frame_pointer is set.
>
> If flag_omit_frame_pointer has this special value, we must force the frame
> pointer if not in a leaf function. We also need to force it in a leaf function
> if flag_omit_frame_pointer is not set or if LR is used.
>
> Doing this allows both -fomit-frame-pointer and -fomit-leaf-frame-pointer to be
> independently set and changed in each function with the expected behaviour.
>
> OK for commit and backport to GCC7/GCC6?
OK for trunk, please wait before backporting.
This code is a mess, would macroing your magic number 2 help at all? All the
double negatives give me a massive headache!
Reviewed by: James Greenhalgh <james.greenhalgh@arm.com>
Thanks,
James
>
> ChangeLog:
> 2017-08-04 Wilco Dijkstra <wdijkstr@arm.com>
>
> gcc/
> PR middle-end/60580
> * config/aarch64/aarch64.c (aarch64_frame_pointer_required)
> Check special value of flag_omit_frame_pointer.
> (aarch64_can_eliminate): Likewise.
> (aarch64_override_options_after_change_1): Simplify handling of
> -fomit-frame-pointer and -fomit-leaf-frame-pointer.
>