This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][AArch64] LR register not used in leaf functions
- From: Jiong Wang <wong dot kwongyuan dot tools at gmail dot com>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: Jiong Wang <jiong dot wang at arm dot com>, Kugan <kugan dot vivekanandarajah at linaro dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Sat, 15 Nov 2014 14:08:00 +0000
- Subject: Re: [PATCH][AArch64] LR register not used in leaf functions
- Authentication-results: sourceware.org; auth=none
- References: <54204387 dot 5090105 at linaro dot org> <54204727 dot 6080002 at arm dot com> <54272A2D dot 7030306 at linaro dot org> <542AC57A dot 20701 at arm dot com> <CA+=Sn1=AD6Ho_fA3cuyA62ZS7uQEY1kx-hsz-OJPSZFAoPA79g at mail dot gmail dot com>
2014-11-15 0:15 GMT+00:00 Andrew Pinski <pinskia@gmail.com>:
> On Tue, Sep 30, 2014 at 8:00 AM, Jiong Wang <jiong.wang@arm.com> wrote:
>> On 27/09/14 22:20, Kugan wrote:
>>>
>>>
>>> On 23/09/14 01:58, Jiong Wang wrote:
>
> + /* If we decided that we didn't need a leaf frame pointer but then used
> + LR in the function, then we'll want a frame pointer after all, so
> + prevent this elimination to ensure a frame pointer is used. */
> + if (to == STACK_POINTER_REGNUM
> + && flag_omit_leaf_frame_pointer
> + && df_regs_ever_live_p (LR_REGNUM))
> + return false;
>
> This breaks my build on aarch64-elf (with some local modifications)
Hi Andrew,
then what's your local modification?
I think the problem is we need to figure out why there is an ICE
after your local modification?
can you please send me your local modification and testcase if possible.
> aarch64_frame_pointer_required returns true but then we use LR but now
> aarch64_can_eliminate and aarch64_frame_pointer_required are
> inconsitant which is not a valid thing for LRA (and reload).
>
> This was mentioned in https://gcc.gnu.org/ml/gcc-patches/2013-12/msg00151.html :
> " IRA calls hook frame_pointer_required and it returns false. After
> that LRA calls can_eliminate hook and it returns false which means
> that fp can not be used for allocation and we should spill all pseudos
> assigned to it."
>
> Thanks,
> Andrew Pinski