public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: "H.J. Lu" <hjl@lucon.org>
Cc: gcc@gcc.gnu.org
Subject: Re: ABI compatibility regression: Return values on x86
Date: Tue, 08 Jan 2008 14:21:00 -0000	[thread overview]
Message-ID: <18307.34486.308051.435767@zebedee.pink> (raw)
In-Reply-To: <20080108141309.GA16021@lucon.org>

H.J. Lu writes:
 > On Tue, Jan 08, 2008 at 01:57:50PM +0000, Andrew Haley wrote:
 > > H.J. Lu writes:
 > >  > On Mon, Jan 07, 2008 at 06:32:08PM +0000, Andrew Haley wrote:
 > >  > > 
 > >  > > So, what now?  Can we even agree about what the psABI actually says
 > >  > > about sign-extending result values?  Was what we did before correct,
 > >  > > or what we do now?  I don't believe that it doesn't matter.
 > >  > 
 > >  > You can follow up with this thread in ia32 psABI discussion group:
 > >  > 
 > >  > http://groups.google.com/group/ia32-abi/browse_thread/thread/f47e0106b21d9269
 > > 
 > > Thanks for the reference.  The attitude there looks surprisingly
 > > complacent, but if Intel and gcc x86 maintainers agree that it doesn't
 > > matter I suppose I'll have to defer to the weight of opinion.
 > > 
 > 
 > My understanding is either way is ia32 psABI compliant. If the
 > caller code generated by gcc is ia32 psABI compliant, that is
 > 
 > ---
 > callers need to assume that return value is in %al/%ax and that
 > the upper bits of %eax are undefined.  If the caller needs a 32-bit
 > sign- or zero-extended value, it needs to do the extend itself.
 > ---
 > 
 > it shouldn't be a problem.

Sure, but it doesn't say "callers need to assume ... are undefined" in
the psABI; AFAICS the Intel engineers just made that up.  I suppose
you could argue that if it isn't explicitly stated there's no
guarantee, but I didn't read it that way.  The core problem is that
the psABI is very badly worded.  

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903

  reply	other threads:[~2008-01-08 14:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-07 18:32 Andrew Haley
2008-01-07 21:05 ` H.J. Lu
2008-01-08 13:58   ` Andrew Haley
2008-01-08 14:13     ` H.J. Lu
2008-01-08 14:21       ` Andrew Haley [this message]
2008-01-08 14:36         ` H.J. Lu

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=18307.34486.308051.435767@zebedee.pink \
    --to=aph@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=hjl@lucon.org \
    /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).