This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/50775] Register allocator sets up frame and frame pointer with low register pressure
- From: "gjl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Dec 2011 19:07:02 +0000
- Subject: [Bug other/50775] Register allocator sets up frame and frame pointer with low register pressure
- Auto-submitted: auto-generated
- References: <bug-50775-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50775
Georg-Johann Lay <gjl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WORKSFORME
--- Comment #9 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-12-15 19:07:02 UTC ---
Code looks much better now. Great!
With options
$ avr-gcc in.c -c -save-temps -dp -Os -mmcu=avr4 -mstrict-X
The code is:
func1:
push r28 ; 43 pushqi1/1 [length = 1]
push r29 ; 44 pushqi1/1 [length = 1]
/* prologue: function */
/* frame size = 0 */
/* stack size = 2 */
.L__stack_usage = 2
movw r18,r24 ; 2 *movhi/1 [length = 1]
movw r28,r22 ; 3 *movhi/1 [length = 1]
ld r24,Y ; 8 movqi_insn/4 [length = 1]
movw r26,r18 ; 37 *movhi/1 [length = 1]
ld r25,X ; 9 movqi_insn/4 [length = 1]
add r24,r25 ; 10 addqi3/1 [length = 1]
movw r30,r20 ; 38 *movhi/1 [length = 1]
ld r25,Z ; 11 movqi_insn/4 [length = 1]
add r24,r25 ; 12 addqi3/1 [length = 1]
movw r30,r18 ; 39 *movhi/1 [length = 1]
ldd r25,Z+1 ; 13 movqi_insn/4 [length = 1]
add r24,r25 ; 14 addqi3/1 [length = 1]
ldd r25,Y+1 ; 15 movqi_insn/4 [length = 1]
add r24,r25 ; 16 addqi3/1 [length = 1]
movw r30,r20 ; 40 *movhi/1 [length = 1]
ldd r25,Z+1 ; 17 movqi_insn/4 [length = 1]
add r24,r25 ; 18 addqi3/1 [length = 1]
movw r30,r18 ; 41 *movhi/1 [length = 1]
ldd r25,Z+2 ; 19 movqi_insn/4 [length = 1]
add r24,r25 ; 20 addqi3/1 [length = 1]
ldd r25,Y+2 ; 21 movqi_insn/4 [length = 1]
add r24,r25 ; 22 addqi3/1 [length = 1]
movw r30,r20 ; 42 *movhi/1 [length = 1]
ldd r25,Z+2 ; 23 movqi_insn/4 [length = 1]
add r24,r25 ; 29 addqi3/1 [length = 1]
/* epilogue start */
pop r29 ; 47 popqi [length = 1]
pop r28 ; 48 popqi [length = 1]
ret ; 49 return_from_epilogue [length = 1]