[Top][All Lists]

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

[avr-gcc-list] a newbie's question

From: TeeN
Subject: [avr-gcc-list] a newbie's question
Date: Fri, 7 Jun 2002 10:02:49 +0800

Hi Guru,

I have used the following CFLAGS to make the gcctest8.c:

CFLAGS =  -O1 -Wall -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst)

the original C code:

for (j=0; j<255; j++)


                 ldi     r24, 0          ; for (j=0;
 loc_5F:                                 ; 
                 subi    r24, -1         ; ;j++)
                 cpi     r24, -1
                 brcs    loc_5F          ; r24 == 0x00-0xFE : loop 
                                           r24 == 0xFF : fall thru

1. k++ line is optimised. it is ok.
2. since the "subi r24,0xFF" has increased r24 before the 
comparision, the loop actually executed 253 times instead of 254 
if i use -O3 to optimise it, the disassembled code is even funny. Is 
it something wrong with my system ?

Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

avr-gcc-list at http://avr1.org

reply via email to

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