int foo(int a) { unsigned int b = a > 0; char c = b; return c; } is not optimized to
int foo(int a) { return a > 0; } at the tree level. Forwprop has code to do this if the final propagation result is in a COND_EXPR. I have a patch. -- Summary: Does not propagate comparison results Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization, TREE Severity: enhancement Priority: P3 Component: tree-optimization AssignedTo: rguenth at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30978