http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56212
Bug #: 56212 Summary: Does not fold unsigned (b - a) + a Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: middle-end AssignedTo: unassig...@gcc.gnu.org ReportedBy: rgue...@gcc.gnu.org unsigned foo (unsigned a, unsigned b) { return (b - a) + a; } should be simplified to return b. Later GIMPLE reassoc and forwprop do that job.