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?


On Wed, Dec 9, 2009 at 6:56 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Wed, 9 Dec 2009, H.J. Lu wrote:
>
>> > ... because this part can only be guaranteed by the ABI. ?Without the
>> > above language a compiler would be free to implement any non-zero byte as
>> > true for parameter passing without violating the ABI.
>> >
>>
>> 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.
>
>> or the C language standard already?
>
> Nope. ?If you don't look at the specific value of a _Bool (by e.g. storing
> it in some global variable) the C standard doesn't say anything about what
> this value must be, except that the true/false behaviour has to be
> preserved. ?As-if rules and so on. ?The psABI needs to be more specific.
>
>> ---
>> extern unsigned int bartmp;
>> extern _Bool bar;
>>
>> void foo()
>> {
>> ?bartmp = bar;
>> }
>> ---
>>
>> Why should the _Bool byte in "void foo(_Bool bar)" ?be any different?
>
> Because it can be different when the psABI doesn't say otherwise.
>

The psABI doesn't say anything about the _Bool return value.  Can compiler
use a different byte pattern for _Bool return byte?

-- 
H.J.


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