From: Richard Guenther <rguenther@suse.de>
To: Andrew Haley <aph-gcc@littlepinkcloud.COM>
Cc: Paolo Bonzini <bonzini@gnu.org>,
gcc-patches@gcc.gnu.org, Andreas Tobler <toa@pop.agri.ch>
Subject: Re: [PATCH] Fix PR32843, testsuite bug wrt sign/zero-extension of return values
Date: Fri, 27 Jul 2007 19:28:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.64.0707272026120.6492@s68.fhfr.qr> (raw)
In-Reply-To: <18090.13124.426368.235300@zebedee.pink>
On Fri, 27 Jul 2007, Andrew Haley wrote:
> Andrew Haley writes:
>
> OK, I've looked and every libffi target except x86 has explicit code
> to do sign extend retvals. I presume that such code isn't present for
> x86 because hitherto $eax has always been properly sign extended for
> the return type.
>
> So, are we *absolutely* sure that gcc hasn't broken the ABI? I can
> certainly imagine some cases where a change like this one (gcc no
> longer sign extends retvals) would break code in interesting ways.
Well, if every other libffi target has explicit sign extension code
then the change (which is to generic code!) if it breaks the ABI shows
that the x86 target machinery is lacking code to do sign extend retvals.
Of course I'd like to see what other language frontends to for returning
signed/unsigned quantities of QImode or HImode on x86. For example
Fortran does zero extension in 4.2.1 (well, really the backend is -
the frontend simply returns HImode, like mainline now does for C as well
after the change):
foo_:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movzwl (%eax), %eax
popl %ebp
ret
function foo(bar)
integer*2 foo,bar
foo = bar
end
if backends other than x86 still sign-extend for QImode returns in C
the it is the x86 backend that needs to be fixed if we decide that
it makes a difference that we need to care about.
Richard.
next prev parent reply other threads:[~2007-07-27 18:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-26 9:25 Richard Guenther
2007-07-26 14:17 ` Paolo Bonzini
2007-07-26 14:25 ` Richard Guenther
2007-07-26 14:28 ` Andrew Haley
2007-07-26 14:48 ` Richard Guenther
2007-07-26 14:54 ` Andrew Haley
2007-07-27 18:28 ` Andrew Haley
2007-07-27 19:28 ` Richard Guenther [this message]
2007-07-30 13:58 ` Andrew Haley
2007-08-06 12:46 ` Andrew Haley
2007-08-07 12:46 ` Andrew Haley
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=Pine.LNX.4.64.0707272026120.6492@s68.fhfr.qr \
--to=rguenther@suse.de \
--cc=aph-gcc@littlepinkcloud.COM \
--cc=bonzini@gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=toa@pop.agri.ch \
/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).