http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50417
Bug #: 50417 Summary: regression: memcpy with known alignment Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: wouter.vermae...@scarlet.be Consider these functions: void copy1(char* d, const char* s) { memcpy(d, s, 256); } void copy2(short* d, const short* s) { memcpy(d, s, 256); } void copy3(int* d, const int* s) { memcpy(d, s, 256); } void copy4(long* d, const long* s) { memcpy(d, s, 256); } g++-4.5.2 is able to generate better code for the later functions. But when I test with a recent snapshot (SVN revision 178875 on linux x86_64) it generates the same code for all versions (same as copy1()).