Consider the testcase static inline bool wrap(bool f) { return f; } bool bar(bool f) { return wrap(f); }
we have in t67.optimized return (int) (bool) (int) (bool) (int) f; and in t14.oplower bool bar(bool) (f) { int D.1592; bool f; bool D.1583; int D.1582; int D.1581; int D.1591; <bb 0>: D.1582 = (int) f; f = (bool) D.1582; D.1592 = (int) f; D.1591 = D.1592; D.1583 = (bool) D.1591; D.1581 = (int) D.1583; return D.1581; } this load of SSA variables must pessimize or at least slow down something. -- Summary: Repeated casts between bool and int are not optimized Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21608