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

--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #13)
> VRP is rewriting:
>   _75 = _33 ? -1 : 0;
> to:
>   _38 = (<signed-boolean:1>) _33;
>   _75 = -_38;
> 
> 
> Folding statement: _75 = _33 ? -1 : 0;
> Applying pattern match.pd:3954, gimple-match.c:142059
> gimple_simplified to _38 = (<signed-boolean:1>) _33;
> _75 = -_38;
> Folded into: _75 = -_38;
> 
> 
> Mine.

That is this pattern:
    /* a ? -1 : 0 -> -a. */
    (if (INTEGRAL_TYPE_P (type) && integer_all_onesp (@1))
     (negate (convert (convert:boolean_type_node @0))))

I guess I need a check for TYPE_PRECISION being non-1 here.

Reply via email to