This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: nested function question




> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]