[Bug target/36467] [avr] Missed optimization with pointer arithmetic and mul*

eric dot weddington at atmel dot com gcc-bugzilla@gcc.gnu.org
Sun Jun 8 18:09:00 GMT 2008



------- 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



More information about the Gcc-bugs mailing list