This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/33050] [avr] unnessary register save
- From: "wvangulik at xs4all dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Aug 2007 19:36:27 -0000
- Subject: [Bug target/33050] [avr] unnessary register save
- References: <bug-33050-14966@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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