------- Comment #3 from wvangulik at xs4all dot nl 2007-08-24 19:36 -------
(In reply to comment #2)
> 4.3.0 20070817 snapshot generates this for the testcase:
>
<snip>
Well at least the extra clr r25 is gone...
I just tried some simpler code:
extern unsigned char foo();
unsigned char test(unsigned char input) {
return input += foo();
}
The result is:
/* prologue: frame size=0 */
push r17
/* prologue end (size=1) */
mov r17,r24
call foo
add r17,r24 <<Could do "add r24,r17"
mov r24,r17 <<This could then be gone
clr r25 <<This is maybe gone in 4.3.0??
/* epilogue: frame size=0 */
pop r17
ret
/* epilogue end (size=2) */
Here the add is also done non-optimal. So maybe solving this prevents the extra
register save?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33050