This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, Aarch64]: Handle return address via. frame pointer
- From: Venkataramanan Kumar <venkataramanan dot kumar at linaro dot org>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Marcus Shawcroft <marcus dot shawcroft at arm dot com>, Patch Tracking <patch at linaro dot org>, Richard Earnshaw <rearnsha at arm dot com>, marcus dot shawcroft at gmail dot com
- Date: Mon, 29 Jul 2013 13:18:11 +0530
- Subject: Re: [Patch, Aarch64]: Handle return address via. frame pointer
- References: <CAJK_mQ0+_eD9XzzjkUZb=LEraxfZv5CZXAGs42_zjdg6xfmrjA at mail dot gmail dot com> <CA+=Sn1mfbrPD4+5Qjw9FA3f7RJuHf3g6Vd+zJaK4unRfda_kCA at mail dot gmail dot com>
I can see that rs6000 port uses a flag
"cfun->machine->ra_needs_full_frame = 1".
But I need to check if this flag helps to generate frame for all the
functions in a compilation unit.
The requirement is that frame need to be preserved by any function
that calls our function which uses _builtin_return_address(1), even
when -fomit-frame-pointer is used.
On 29 July 2013 11:57, Andrew Pinski <email@example.com> wrote:
> On Sun, Jul 28, 2013 at 3:53 AM, Venkataramanan Kumar
> <firstname.lastname@example.org> wrote:
>> Hi Maintainers,
>> This patch adds supports to handle return address via. frame pointer.
> I noticed this patch causes undefined behavior when
> -fomit-frame-pointer and __builtin_return_address(1) is used. On
> PowerPC it is defined correctly that is it generates a frame for that
> case. Now on x86_64 it might be undefined but I think that is just
> wrong since __builtin_return_address is just used for debugging
>> 2013-07-28 Venkataramanan Kumar <email@example.com>
>> * config/aarch64/aarch64.c (aarch64_return_addr): Handle returning
>> address from a frame.
>> Regression tested with aarch64-none-elf with V8 foundation model.