[Bug tree-optimization/51683] New: [4.7 Regression] __builtin_memcpy etc. with constant first argument optimized away by ccp
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Dec 27 11:19:00 GMT 2011
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: jakub@gcc.gnu.org
ReportedBy: jakub@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.
More information about the Gcc-bugs
mailing list