This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: missed optimization in m68k
- From: Peter Barada <pbarada at mail dot wm dot sps dot mot dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 14 Jun 2002 19:40:59 -0400
- Subject: Re: missed optimization in m68k
When I build the follwing snippet on my ColdFire v4e modified
version(even in m68k mode using -mc68020) I get:
char *copy(const char *src, char *dst)
{
char *dst0 = dst;
while (*dst++ = *src++)
;
return dst0;
}
copy:
move.l %a2,-(%sp)
move.l 8(%sp),%a1
move.l 12(%sp),%a0
move.l %a0,%a2
.L2:
move.b (%a1)+,(%a0)
tst.b (%a0)+
jbne .L2
move.l %a2,%d0
move.l (%sp)+,%a2
rts
Whereas I build it got -mcfv4e (my own tweaked version) I get:
copy:
move.l 4(%sp),%a1
move.l 8(%sp),%a0
move.l %a0,%d0
.L2:
move.b (%a1)+,(%a0)
tst.b (%a0)+
jbne .L2
rts
So I'm wondering where to check for the extra move of %a0 to %a2 came
from instead of moveing it to %d0.
Any ideas will be most appreciated. TIA...
--
Peter Barada Peter.Barada@motorola.com
Wizard 781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola) 781-270-0193 (fax)