This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in x86-64 psABI or in gcc?


H.J. Lu wrote:
> On Wed, Dec 9, 2009 at 7:51 AM, Andrew Haley <aph@redhat.com> wrote:
>> H.J. Lu wrote:
>>> On Wed, Dec 9, 2009 at 7:10 AM, Andrew Haley <aph@redhat.com> wrote:
>>>> H. Peter Anvin wrote:
>>>>> On 12/09/2009 06:56 AM, Michael Matz wrote:
>>>>>>> Aren't bits in the _Bool byte of"bar" specified by the psABI
>>>>>> Right now they are specified in the psABI, you suggested to remove that
>>>>>> specification.
>>>>>>
>>>>> The intent of H.J.'s proposal is to require bits <7:1> == 0 in all cases
>>>>> (and higher bits as don't cares, the same way a char is passed), as
>>>>> opposed to the current text which requires <63:1> == 0 when passed as
>>>>> registers or on the stack (and <7:1> == 0 when stored in a memory
>>>>> object.)  Furthermore, the current psABI text is inconsistent for
>>>>> arguments are return values; this is a bug in the wordsmithing of the
>>>>> text rather than intentional, if I remember the original discussions
>>>>> correctly.
>>>> Surely Postel's Law applies:
>>>>
>>>>  Be conservative in what you do; be liberal in what you accept from others.
>>>>
>>>> So, return values should be zero-extended to the full word, but we shouldn't
>>>> assume that parameters will be.
>>> I guess you missed the discussion around July 2007:
>>>
>>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42324#c5
>>
>> No, I didn't miss it.  We have had discussions about this before.
>> I still think Postel's Law applies, particularly as we have an
>> explicit guarantee in the psABI that
>>
>> ---
>> When a value of type _Bool is passed in a register or on the stack,
>> the upper 63 bits of the eightbyte shall be zero.
>> ---
> 
> Please read it again. It is only for parameter passing, not for
> function return. Since gcc 4.3, we return _Bool in %AL.

Yes, I know that too.  Why does the fact that this is only for parameter
passing make any difference?

Andrew.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]