[RFC PATCH]: Define "bool" as _Bool when bootstrapping with gcc >= 4.4

Richard Guenther richard.guenther@gmail.com
Wed Sep 22 16:05:00 GMT 2010


On Wed, Sep 22, 2010 at 8:25 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Wed, Sep 22, 2010 at 12:07 AM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> On Tue, Sep 21, 2010 at 9:23 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>>>> "Uros" == Uros Bizjak <ubizjak@gmail.com> writes:
>>>
>>> Andrew> I think one issue is that libcpp needs to make sure it has the same
>>> Andrew> definition for bool also.
>>>
>>> Uros> Hm, indeed. I have started bootstrap on x86_64-pc-linux-gnu with the
>>> Uros> attached patch (that copies relevant parts of gcc/system.h to
>>> Uros> libgcc/system.h).
>>>
>>> Uros>  /* Provide a fake boolean type.  We make no attempt to use the
>>> Uros>     C99 _Bool, as it may not be available in the bootstrap compiler,
>>> Uros> -   and even if it is, it is liable to be buggy.
>>> Uros> +   and even if it is, it is liable to be buggy.
>>>
>>> This comment needs to be updated to reflect the new reality.
>>>
>>> I didn't read the patch too closely this time around, but the idea seems
>>> reasonable to me.
>>
>> Hm.  Given different semantic of int and _Bool can we force the use of
>> int (or char) for stage1 to make sure we keep both variants working?
>
> No worries, since *.md processors didn't hear about bool (yet?).
>
> OTOH, I don't think we should consider a gcc bootstrap as one giant
> testcase. IMO, _Bool is the most appropriate type for predicate
> functions, so why cripple these types to increase coverage for
> "alternative" implementation? We have testsuite for this, and I'm sure
> that a failure in such a basic functionality will be detected in no
> time.

Because bool and int (or char) are not the same.  There have been
bugs in GCC because of this, see also Paolos reply.

Richard.

> OTOOH, It is also nice for gcc to eat is own dogfood [1] ;)
>
> [1] http://en.wikipedia.org/wiki/Dogfooding
>
> Uros.
>



More information about the Gcc-patches mailing list