This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Why does IRA force all pseudos live across a setjmp call to be spilled?
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc at gcc dot gnu dot org, Peter Bergner <bergner at vnet dot ibm dot com>, Jeff Law <law at redhat dot com>, Vladimir N Makarov <vmakarov at redhat dot com>, Pat Haugen <pthaugen at linux dot vnet dot ibm dot com>
- Date: Mon, 5 Mar 2018 09:33:25 -0600
- Subject: Re: Why does IRA force all pseudos live across a setjmp call to be spilled?
- Authentication-results: sourceware.org; auth=none
- References: <141cfa78-f202-029a-e530-24e657692bff@vnet.ibm.com> <3378914.kM1GF4J5QF@polaris> <20180305001631.GN21977@gate.crashing.org> <1798327.obcmBFoBij@polaris>
On Mon, Mar 05, 2018 at 08:01:14AM +0100, Eric Botcazou wrote:
> > C11 says in 7.13.2.1/2
> > "The longjmp function restores the environment saved by the most recent
> > invocation of the setjmp macro in the same invocation of the program with
> > the corresponding jmp_buf argument."
> > where "environment" is not really defined, but it includes all information
> > a program will need to return to its caller (so it has to restore the
> > non-volatile registers, set stack pointers correctly, that kind of thing).
>
> Apparently the authors of the SPARC psABI thought that the last part of your
> sentence is an interpolation and that the (historical) requirements were vague
> enough to allow their interpretation, IOW that the compiler can do the work.
Maybe we should have a target hook that says setjmp/longjmp are
implemented by simple function calls (or as-if by function calls), so
as not to penalize everyone who has an, erm, more conservative ABI?
Segher