http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45970
Summary: tree DSE misses many obvious dead stores
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: [email protected]
ReportedBy: [email protected]
struct A { char c[4]; } a, b;
void
f1 (void)
{
__builtin_memcpy (&a.c[0], "a", 1);
a = b;
}
void
f2 (void)
{
__builtin_memcpy (&a.c[0], "a", 1);
__builtin_memcpy (&a.c[0], "cdef", 4);
}
isn't optimized by tree DSE. RTL DSE can handle it, but only on some targets
(there are issues with calls to builtins if they were expanded as calls and
args aren't in registers etc.).