https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98211

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to rsand...@gcc.gnu.org from comment #8)
> (In reply to Richard Biener from comment #7)
> > Hmm, OK, so besides the incomplete bool pattern matching the issue seems to
> > be that while we reject the problematic conversion in
> > vectorizable_conversion it slips through via vectorizable_assignment because
> > it does
> > 
> >       /* Conversion between boolean types of different sizes is
> >          a simple assignment in case their vectypes are same
> >          boolean vectors.  */
> >       && (!VECTOR_BOOLEAN_TYPE_P (vectype)
> >           || !VECTOR_BOOLEAN_TYPE_P (vectype_in)))
> > 
> > as opposed to vectorizable_conversions
> > 
> >   if (VECTOR_BOOLEAN_TYPE_P (vectype_out)
> >       && !VECTOR_BOOLEAN_TYPE_P (vectype_in))
> > 
> > that was added by g:2dab46d5fc9f95de16bd9bf0f219be5e64324d1f without a
> > testcase
> > or PR reference so it's difficult to tell what it was supposed to allow. 
> Agree that looks odd…
> 
> > Now,
> > for the case in question the conversion would have slipped though anyway
> > since
> > the only difference in the types is the sign and that one is BOOLEAN_TYPE
> > and the other INTEGER_TYPE.  So the exception above seems to intent to allow
> > conversions with different precisions (note we now have precision 1 for all
> > vector bools).
> > 
> > So I'm going to just copy the vectorizable_conversion condition into
> > vectorizable_assignment as well.
> Shouldn't it instead be:
> 
>   VECTOR_BOOLEAN_TYPE_P (vectype) != VECTOR_BOOLEAN_TYPE_P (vectype_in)
> 
> as is used in some other places (sometimes with ^ instead of !=)?
> AFAIK using VCE would break in both directions.

I think the intent was to allow vector<bool:2> to vector<bool:4>, both SImode
to be converted for free (since in the end they have the same representation,
_not_ occupying 2 and 4 bits but only one).  I've recently "fixed" (changed)
the integer mode bool vectors to always be vector<bool:1> to reflect that
so I'm going to test simply removing that odd condition.

Reply via email to