------- Comment #2 from r dot leitgeb at x-pin dot com 2006-10-24 07:31 ------- Here's an excerpt of the assembly code obtained with -Os -S with some comments from me:
---------------------------------------------------- setpin: /* prologue: frame size=0 */ /* prologue end (size=0) */ mov r20,r24 clr r21 cpi r22,lo8(1) <--- The compare is done byte wide brne .L2 in r18,53-0x20 ldi r24,lo8(1) <--- Here we load 1 sixteen bit wide ldi r25,hi8(1) rjmp 2f 1: lsl r24 <--- Here we shift 1 sixteen bit wide rol r25 2: dec r20 brpl 1b or r18,r24 <--- r25 is not used. Why would we compute it ? rjmp .L6 .L2: in r18,53-0x20 ---------------------------------------------------- Cheers Rudi -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29560