Take the following function: int f(int a, int c) { return -a - (5); } Fold should have converted that to: int f(int a, int c) { return (-5) - a; }
So that we only have one constant (-5) and one decl (a) and one expression (MINUS_EXPR) instead of one constant (5), one decl (a) and two expressions (MINUS_EXPR and NEG_EXPR). -- Summary: fold does not simplify -a - (5) to (-5) - a Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: missed-optimization, TREE Severity: enhancement Priority: P2 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23295