http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53253
Bug #: 53253 Summary: Missed opportunity to inline memcmp Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: l...@redhat.com Compile with -O2. Note the length of the memory to be compared via memcmp is fixed and just 2 bytes. It'd be more efficient and possibly smaller to just inline the necessary comparisons. Seems to me this ought to be addressed in our tree optimizers. int foo(const char* x) { return memcmp(x,"xx",2) != 0; }