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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
On:
int
combine (int a, int b)
{
  int c = (a | b);
  int d = ~(a & b);
  return c & d;
}
it is the
/* (x | y) & ~(x & y) -> x ^ y */
(simplify
 (bit_and:c (bit_ior @0 @1) (bit_not (bit_and @0 @1)))
 (bit_xor @0 @1))
simplification (and there are similar around it).
So, if we go to doing this in GENERIC, we'd need
variants of this for truth_{and,ior} and truth_{and,ior}if (and for the latter
only under the !TREE_SIDE_EFFECTS and !generic_expr_could_trap_p conditions,
(though doesn't the more than one @1 already imply !TREE_SIDE_EFFECTS).
We do have truth_xor, but that will evaluate both arguments.

Reply via email to