This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/51683] New: [4.7 Regression] __builtin_memcpy etc. with constant first argument optimized away by ccp
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Dec 2011 11:18:42 +0000
- Subject: [Bug tree-optimization/51683] New: [4.7 Regression] __builtin_memcpy etc. with constant first argument optimized away by ccp
- Auto-submitted: auto-generated
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.