https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95489
Bug ID: 95489
Summary: Failure to optimize x && (x & y) to x & y
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: gabravier at gmail dot com
Target Milestone: ---
int f(int x, int y)
{
return x && (x & y);
}
This can be optimized to `return x & y;` (see also the summary). This
optimization is done by LLVM, but not by GCC.
