On Thu, Apr 17, 2025 at 2:10 PM Eric Botcazou <botca...@adacore.com> wrote: > > > That looks like a good place - can we possibly say sth about signedness a > > well? IIRC all languages have unsigned bools but vector mask components are > > signed bools? > > Not really the right person to answer the above second ? I'm afraid. > > diff --git a/gcc/tree.def b/gcc/tree.def > index c4ad8d08f10..bb4e4328dfa 100644 > --- a/gcc/tree.def > +++ b/gcc/tree.def > @@ -135,7 +135,12 @@ DEFTREECODE (OFFSET_TYPE, "offset_type", tcc_type, 0) > DEFTREECODE (ENUMERAL_TYPE, "enumeral_type", tcc_type, 0) > > /* Boolean type (true or false are the only values). Looks like an > - INTEGRAL_TYPE. */ > + INTEGER_TYPE, but must be dealt with specially because TYPE_PRECISION > + may be arbitrary despite the restricted set of valid values (in other > + words, boolean types with TYPE_PRECISION > 1 exist in some languages). > + Similarly, TYPE_UNSIGNED may be false for components of vector masks, > + although it is believed to be true for all boolean types built in the > + front-ends of the various languages. */
I'd reword this to "Similarly, TYPE_UNSIGNED is false for components of vector masks and possibly for boolean types in languages other than C." That is, the C/middle-end boolean_type_node is always unsigned. > DEFTREECODE (BOOLEAN_TYPE, "boolean_type", tcc_type, 0) > > /* Integer types in all languages, including char in C. > > > -- > Eric Botcazou > > >