avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Need help compiling testcase with gcc 3.3.5 or 3.4.3


From: Andy Hutchinson
Subject: Re: [avr-gcc-list] Need help compiling testcase with gcc 3.3.5 or 3.4.3
Date: Sat, 29 Jan 2005 01:01:00 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

Oh thats bad !

It looks like loop is changed so loop counter goes from 0 to -x

- think that needs a bug report


address@hidden wrote:


Another interesting case (-Os used):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int foo (int x)
{
    int i= x;
    do {
        x *= 2;
    } while (--i);
    return x;
}

Result with 3.3.4:
~~~~~~~~~~~~~~~~~~
foo:
/* prologue: frame size=0 */
/* prologue end (size=0) */
        mov r18,r24
        mov r19,r25
.L2:
        add r24,r24
        adc r25,r25
        subi r18,lo8(-(-1))
        sbci r19,hi8(-(-1))
        brne .L2
/* epilogue: frame size=0 */
        ret

Result with 4.0:
~~~~~~~~~~~~~~~~
foo:
/* prologue: frame size=0 */
/* prologue end (size=0) */
        ldi r18,lo8(0)
        ldi r19,hi8(0)
        clr r20
        clr r21
        sub r20,r24
        sbc r21,r25
.L2:
        add r24,r24
        adc r25,r25
        subi r18,lo8(-(-1))
        sbci r19,hi8(-(-1))
        cp r18,r20
        cpc r19,r21
        brne .L2
/* epilogue: frame size=0 */
        ret


_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list



reply via email to

[Prev in Thread] Current Thread [Next in Thread]