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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Kewen Lin from comment #5)
> (In reply to Andrew Pinski from comment #2)
> > Note I think this could help scalar code too:
> > ```
> > int a[1], b[1], c[1];
> > 
> > void
> > test (void)
> > {
> >   a[0] = (b[0] == c[0]) ? -1 : a[0];
> > }
> > 
> > void
> > test1 (void)
> > {
> >   a[0] = (-(b[0] == c[0])) | a[0];
> > }
> > 
> > ```
> > 
> 
> Good catch!
> 
> > So this could be something like:
> > ```
> > (simplify
> >  (cond @0 @1 integer_all_ones_p)
> >  (bit_ior (negate (convert @0)) @1))
> > (simplify
> >  (vec_cond @0 @1 integer_all_ones_p)
> >  (bit_ior (view_convert @0) @1))
> > ```
> 
> Missing negate for the vector one?

No because vector true is already -1 :).

Reply via email to