public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Peter Bergner <bergner@vnet.ibm.com>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc@gcc.gnu.org, Jeff Law <law@redhat.com>,
	       Vladimir N Makarov <vmakarov@redhat.com>,
	       Pat Haugen <pthaugen@linux.vnet.ibm.com>
Subject: Re: Why does IRA force all pseudos live across a setjmp call to be spilled?
Date: Sun, 04 Mar 2018 16:40:00 -0000	[thread overview]
Message-ID: <b1857039-83cb-271f-7bea-4e59ba38021b@vnet.ibm.com> (raw)
In-Reply-To: <3378914.kM1GF4J5QF@polaris>

On 3/4/18 7:57 AM, Eric Botcazou wrote:
>> I can't argue with anything in that comment, other than the conclusion. :-)
>> It's not the compiler's job to implement the setjmp/longjmp save/restore.
>> Maybe Kenny was working around a problem with some target's buggy setjmp
>> and spilling everything "fixed" it?
> 
> What are the requirements imposed on setjmp exactly and by whom?  The psABI on 
> SPARC (the SCD) has an explicit note saying that setjmp/sigsetjmp/vfork don't 
> (have to) preserve the usual non-volatile registers.

I'm not a language lawyer and I don't play one on TV either, but I believe
the requirements come from multiple sources.  You've pointed out your ABI
and Andreas pointed out the C standard also places requirements:

    https://gcc.gnu.org/ml/gcc/2018-03/msg00030.html

I wouldn't be surprised if there are more specs/standards that place
restrictions too.  Clearly returning from the function that calls
setjmp before calling longjmp must be illegal, since that would result
in clobbering of the stack frame the longjmp would attempt to restore to.
I don't know off hand who/what states that restriction.

Peter


  reply	other threads:[~2018-03-04 16:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-02 19:45 Peter Bergner
2018-03-02 19:55 ` Alexander Monakov
2018-03-02 21:26 ` Jeff Law
2018-03-03  3:28   ` Peter Bergner
2018-03-03 16:29     ` Jeff Law
2018-03-03 23:47       ` Peter Bergner
2018-03-04  0:30         ` Peter Bergner
2018-03-04  8:57           ` Richard Biener
2018-03-04  9:11             ` Andreas Schwab
2018-03-05  2:12             ` Jeff Law
2018-03-04 13:57         ` Eric Botcazou
2018-03-04 16:40           ` Peter Bergner [this message]
2018-03-04 17:39             ` Andreas Schwab
2018-03-05  0:16           ` Segher Boessenkool
2018-03-05  7:01             ` Eric Botcazou
2018-03-05  7:09               ` Eric Botcazou
2018-03-05 15:33               ` Segher Boessenkool
2018-03-05 16:18                 ` Eric Botcazou
2018-03-06 16:20                 ` Peter Bergner
2018-03-03  3:21 ` Vladimir Makarov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b1857039-83cb-271f-7bea-4e59ba38021b@vnet.ibm.com \
    --to=bergner@vnet.ibm.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=pthaugen@linux.vnet.ibm.com \
    --cc=vmakarov@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).