The compiler used to use move_by_pieces for sh-elf at -O2 for the trivial
strcpy calls in dhrystone, but now it uses memcpy. I've found that this
is because it no longer knows that the two MEM arguments are aligned.
Here is a pruned-down testcase:
char *strcpy (char *, const char *);
extern void g ();
f ()
{
struct {
int i;
char str[31];
} s;
strcpy (s.str, "text text text text text text text text");
g (s.str);
}
--
Summary: Compiler looses track of alignment for emit_block_move
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: amylaar at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27226