This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [discuss] Bug in x86-64 psABI or in gcc?
- From: Michael Matz <matz at suse dot de>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, discuss at x86-64 dot org, "Girkar, Milind" <milind dot girkar at intel dot com>, "H. Peter Anvin" <hpa at zytor dot com>
- Date: Wed, 13 Jan 2010 13:10:22 +0100 (CET)
- Subject: Re: [discuss] Bug in x86-64 psABI or in gcc?
- References: <6dc9ffc80912071033o20516ae1ta19a5a2521ec7f9a@mail.gmail.com> <6dc9ffc80912081024k1dcd4deer64b2005306d179f8@mail.gmail.com> <Pine.LNX.4.64.0912091100080.18785@wotan.suse.de> <6dc9ffc80912090644q23679cb7v802eead145dd660e@mail.gmail.com> <Pine.LNX.4.64.0912091549470.18785@wotan.suse.de> <4B1FBC7C.60501@zytor.com> <Pine.LNX.4.64.0912091608290.18785@wotan.suse.de> <6dc9ffc80912090715r7da55c09w2f5b508aede980c0@mail.gmail.com> <6dc9ffc80912090725t55090675jcaa71dccc885492d@mail.gmail.com> <Pine.LNX.4.64.0912091632580.18785@wotan.suse.de> <6dc9ffc80912090949i569e3ab5s2bdaf98d034f3b4f@mail.gmail.com>
Hi,
On Wed, 9 Dec 2009, H.J. Lu wrote:
> > So, IMO we have two sensible proposals:
> > (a) specify that bits <7:1> must be zero
> > (b) specify that bits <31:1> must be zero
>
> I uploaded sources and object files generated by gcc 4.4, icc 11.1
> and Sun Studio 12 Update 1 at -O to:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42324
>
> If we go with (a), no changes are needed for gcc, icc and sun studio.
> All existing object files are OK.
>
> If we go with (b), gcc 4.3 and 4.4 are broken in function return. Object
> files generated by gcc 4.3 and 4.4 aren't compatible with object files
> which assuming bits 1-31 in _Bool return are zero.
>
> I think (a) is the safest option.
The ABI now contains this:
------------------------
When a value of type \code{_Bool} is returned or passed in a register or
on the stack, bit 0 contains the truth value and bits 1 to 7 shall be
zero.
------------------------
Ciao,
Michael.