The following two functions can be simplified, and this is motivated from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109878.
#include<iostream>
unsigned foo(unsigned a, unsigned c0, unsigned c1)
{
return ((c0 & c1) == c1) ? std::max(a & c0, a & c1) : (a & c0);
}
unsigned bar(unsigned a, unsigned c0, unsigned c1)
{
return ((c0 & c1) == c0) ? std::min(a & c0, a & c1) : (a & c0);
}
Alive2:
https://alive2.llvm.org/ce/z/kQrReA
https://alive2.llvm.org/ce/z/UQay5M