https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95698
Bug ID: 95698
Summary: Failure to optimize float comparison of converted
integer to integer comparison
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: ---
bool f(int n)
{
return (float)n > 0.0;
}
This can be optimized to `return n > 0;`. This transformation is done by LLVM,
but not by GCC.
