[patch] Fix PHI optimization issue with boolean types

Richard Biener richard.guenther@gmail.com
Thu Oct 20 09:36:00 GMT 2016


On Thu, Oct 20, 2016 at 12:50 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Because BOOLEAN_TYPE types only have two values as documented in
>> tree.def:
>>
>> /* Boolean type (true or false are the only values).  Looks like an
>>    INTEGRAL_TYPE.  */
>> DEFTREECODE (BOOLEAN_TYPE, "boolean_type", tcc_type, 0)
>
> Yes, but on the other hand they have a precision and a range.
>
>> There are not many references to BOOLEAN_TYPE in ada/gcc-interface
>> thus it shouldn't be hard to change ... (looks like Ada might even prefer
>> ENUMERAL_TYPE here).
>
> It was like that originally (an ENUMERAL_TYPE) but this blocked LTO (well,
> cross-language LTO) exactly like the sizetype discrepancy, so I don't really
> feel like going back in time.

Because boolean_type_node was different?  Well, are really _all_ boolean types
this way or can you keep using BOOLEAN_TYPE for boolean_type_node for
things like interfacing to C and C++ (and the builtins, etc.) and use
ENUMERAL_TYPE for the cases where bool can have non zero/one values?

Richard.

> --
> Eric Botcazou



More information about the Gcc-patches mailing list