This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/70547] Optimize multiplication of booleans to bit_and


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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> /* (m1 CMP m2) * d -> (m1 CMP m2) ? d : 0  */
> (for cmp (gt lt ge le)
> (simplify
>  (mult (convert (cmp @0 @1)) @2)
>   (cond (cmp @0 @1) @2 { build_zero_cst (type); })))
> 
> 
> Should have caught that ...

We do get:
  _1 = c_5(D) < d_6(D);
  _2 = (int) _1;
  _7 = a_3(D) < b_4(D) ? _2 : 0;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]