http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51683
Bug #: 51683 Summary: [4.7 Regression] __builtin_memcpy etc. with constant first argument optimized away by ccp Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: tree-optimization AssignedTo: ja...@gcc.gnu.org ReportedBy: ja...@gcc.gnu.org static inline void * bar (void *p, void *q, int r) { return __builtin_memcpy (p, q, r); } void * foo (void *p) { return bar ((void *) 0x12345000, p, 256); } at -O2 starting with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175290 is optimized away. While the return value from memcpy is known to be constant and we know that constant, we ignore the other side-effects of the call.