------- Comment #4 from hutchinsonandy at gcc dot gnu dot org 2009-12-31 03:16 ------- The same occurs in 4.5
I think the bug is invalid The expression 1<< pin will be promoted. This produces a defined result if pin>7 and <15 The expression can not then be lower to 8 bit shift - since a shift by >7 is undefined. If you use pin &7, the shift is indeed 8 bit shift. Though it still loads a int (HIMODE) value of 1 that should have been reduced to QIMODE. setpinx: /* prologue: function */ /* frame size = 0 */ /* stack size = 0 */ .L__stack_usage = 0 mov r25,r24 andi r25,lo8(7) ldi r18,lo8(1) ldi r19,hi8(1) mov r24,r18 rjmp 2f 1: lsl r24 2: dec r25 brpl 1b cpi r22,lo8(1) brne .L7 in r25,53-0x20 or r25,r24 out 53-0x20,r25 ret .L7: in r25,53-0x20 com r24 and r24,r25 out 53-0x20,r24 ret -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29560