public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H. J. Lu" <hjl@lucon.org>
To: John David Anglin <dave@hiauly1.hia.nrc.ca>
Cc: gcc@gcc.gnu.org, rth@redhat.com, schwab@suse.de
Subject: Re: Does gcc violate the ia64 ABI?
Date: Sun, 18 May 2003 04:10:00 -0000	[thread overview]
Message-ID: <20030517202234.A28227@lucon.org> (raw)
In-Reply-To: <200305180310.h4I3AHYu015127@hiauly1.hia.nrc.ca>; from dave@hiauly1.hia.nrc.ca on Sat, May 17, 2003 at 11:10:17PM -0400

On Sat, May 17, 2003 at 11:10:17PM -0400, John David Anglin wrote:
> > > This is talking about what happens in a procedure call.  It's not talking
> > > about what happens to gp in the body of a procedure.  'c' and 'd' don't
> > > guarantee that gp won't be modified when a local call returns.  For that,
> > 
> > 'c' and 'd' require the compiler guarantees gp won't be modified when
> > a local call returns since gp will be the same at procedure entry and
> > exit.
> 
> That's not how I interpret them.  They say that gp will be valid at
> procedure entry and at procedure return.  The returning procedure is
> not bar if it does a tail call to another procedure.  So, I can't

Where did the psABI say that? You can't interpret something which is
is not there. Any procedure is a returning procedure, bar is included.

> see how you can argue that gp always will be preserved across local
> calls if tail calls are ok.
> 
> The last sentence in 'd' is not a requirement.  The same compiler

I was talking about the "At procedure return, gp must be valid." part.

> does both the tail call optimization and the local call optimization.
> So, it can decide to perform one or the other, or none in situations
> where there is an incompatibility.  I don't see that not being able
> to optimize calls known to be local is an ABI violation.  Generating
> tail calls might be an ABI violation but again I can't see how 'a' to
> 'd' explicitly rule them out.

The rule says gp much be valid at entry and exit, period. It states

---
The effect of the rules is that gp must be treated as scratch register
at the point of call (i.e., it must be saved by the caller), and it must
be preserved from entry to exit.
---

The only optimization allowed by the ia64 psABI is to skip save/restore
gp across a function call if you can prove gp won't be changed.


H.J.

  reply	other threads:[~2003-05-18  3:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-17 18:58 John David Anglin
2003-05-17 20:43 ` H. J. Lu
2003-05-17 23:27   ` John David Anglin
2003-05-17 23:45     ` H. J. Lu
2003-05-18  3:22       ` John David Anglin
2003-05-18  4:10         ` H. J. Lu [this message]
2003-05-18 23:00           ` John David Anglin
2003-05-19  3:08             ` Fergus Henderson
2003-05-19  6:18               ` Richard Henderson
2003-05-19 15:00                 ` H. J. Lu
2003-05-19 15:06                   ` Jakub Jelinek
2003-05-19 15:27                     ` H. J. Lu
2003-05-19 20:43                       ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2003-05-16 23:37 John David Anglin
2003-05-16 21:55 H. J. Lu
2003-05-16 22:10 ` Andreas Schwab
2003-05-16 22:27   ` H. J. Lu
2003-05-17  0:50     ` Richard Henderson
2003-05-17  5:52       ` H. J. Lu
2003-05-17 18:58         ` Richard Henderson
2003-05-17 22:02           ` H. J. Lu
2003-05-18  0:08             ` Richard Henderson
2003-05-18  3:10               ` H. J. Lu
2003-05-20 23:21               ` H. J. Lu
2003-05-21  3:22                 ` Richard Henderson

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=20030517202234.A28227@lucon.org \
    --to=hjl@lucon.org \
    --cc=dave@hiauly1.hia.nrc.ca \
    --cc=gcc@gcc.gnu.org \
    --cc=rth@redhat.com \
    --cc=schwab@suse.de \
    /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).