On 06/02/2015 06:02 PM, Richard Henderson wrote:
> On 06/02/2015 04:46 PM, H. Peter Anvin wrote:
>> For the x86 backend explicitly, is doing something like:
>>
>>     _Bool x;
>>
>>     asm("blah ; setc %0" : "=qm" (x));
>>
>> ... guaranteed to be safe for older versions of gcc?
> 
> I believe so, for the restricted set of conditions I expect you're asking.
> In particular:
> 
>  (1) Linux has always defined _Bool as a byte (indeed, afaik only Darwin
>      has ever done otherwise).
> 
>  (2) You must really produce 0/1 from the asm; the compiler doesn't re-do
>      the canonicalization afterward, and afaik we do rely on that in the
>      optimizers.  But certainly that's true for any version of GCC.
> 

That is all good as far as I am concerned.

        -hpa


Reply via email to