This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: nested function question
- From: Aurelien Buhrig <aurelien dot buhrig dot gcc at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 11 Sep 2012 11:15:31 +0200
- Subject: Re: nested function question
- References: <504EFD74.4010803@gmail.com>
> Hi,
>
> The gcc.c-torture/execute/nestfunc-3.c test fails on a private target. I
> suspect this is because the STATIC_CHAIN_REGNUM, which is not a call
> used register, is used by the caller function (main), modified by the
> trampoline, but not restored upon nested function return.
>
> Should the STATIC_CHAIN_REGNUM be defined so that
> CALL_USED_REGISTERS[STATIC_CHAIN_REGNUM] == 0?
The question is rather:
Should the STATIC_CHAIN_REGNUM be defined so that
CALL_USED_REGISTERS[STATIC_CHAIN_REGNUM] == 1? Or is it possible to make
nested functions work if CALL_USED_REGISTERS[STATIC_CHAIN_REGNUM] == 0?
Thanks
Aurélien