https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98966
Bug ID: 98966
Summary: Failure to optimize conditional or with 1 based on
boolean condition to direct or
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 m, bool c)
{
return c ? (m | 1) : m;
}
This can be optimized to `return m | c;`. This transformation is done by LLVM,
but not by GCC.