This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/36467] [avr] Missed optimization with pointer arithmetic and mul*
- From: "eric dot weddington at atmel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jun 2008 18:08:34 -0000
- Subject: [Bug target/36467] [avr] Missed optimization with pointer arithmetic and mul*
- References: <bug-36467-6095@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from eric dot weddington at atmel dot com 2008-06-08 18:08 -------
Generated code when structure size is 16 (test.i):
funct:
/* prologue: function */
/* frame size = 0 */
lds r24,head
mov r30,r24
clr r31
sbrc r30,7
com r31
ldi r24,4
1: lsl r30
rol r31
dec r24
brne 1b
subi r30,lo8(-(qq))
sbci r31,hi8(-(qq))
ld r24,Z
sbrc r24,1
std Z+1,__zero_reg__
.L3:
ret
Generated code when structure size is 17 (test2.i):
funct:
/* prologue: function */
/* frame size = 0 */
lds r24,head
ldi r25,lo8(17)
muls r24,r25
movw r30,r0
clr r1
subi r30,lo8(-(qq))
sbci r31,hi8(-(qq))
ld r24,Z
sbrc r24,1
std Z+1,__zero_reg__
.L3:
ret
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36467