[PATCH] Fix bool vs. unsigned:1 vectorization (PR tree-optimization/79284)

Jakub Jelinek jakub@redhat.com
Wed Feb 1 08:38:00 GMT 2017


On Wed, Feb 01, 2017 at 09:32:46AM +0100, Eric Botcazou wrote:
> > all BOOLEAN_TYPEs but Adas have precision one and are unsigned
> > (their TYPE_SIZE may vary though).

Oops, thanks for the correction.  That said, the prec > 1 BOOLEAN_TYPE
aren't compatible with the prec 1 BOOLEAN_TYPE, so the intent of the
predicate is to support precision 1 BOOLEAN_TYPE and anything
types_compatible_p with it, or precision > 1 BOOLEAN_TYPEs (where
anything types_compatible_p with it must be BOOLEAN_TYPE with the
same precision and signedness).

> /* Builds a boolean type of precision PRECISION.
>    Used for boolean vectors to choose proper vector element size.  */
> tree
> build_nonstandard_boolean_type (unsigned HOST_WIDE_INT precision)
> {
>   tree type;
> 
>   if (precision <= MAX_BOOL_CACHED_PREC)
>     {
>       type = nonstandard_boolean_type_cache[precision];
>       if (type)
> 	return type;
>     }
> 
>   type = make_node (BOOLEAN_TYPE);
>   TYPE_PRECISION (type) = precision;
>   fixup_signed_type (type);
> 
>   if (precision <= MAX_INT_CACHED_PREC)
>     nonstandard_boolean_type_cache[precision] = type;
> 
>   return type;
> }

	Jakub



More information about the Gcc-patches mailing list