Closed
Description
GCC outputs the same sequence of instructions for the following two functions. Clang doesn't simplify the function foo
. The transformation from foo
to bar
can be proved.
int foo(int a, int b)
{
return (~a & b) && ~a;
}
int bar(int a, int b)
{
return (~a & b) && b;
}
Godbolt: https://godbolt.org/z/1cfP7Y5x6
Alive2: https://alive2.llvm.org/ce/z/HDJVkD