[Bug optimization/11181] [3.3 only][avr-gcc] Optimization of "uchar/xor/and/single_bit" produced wrong code.
ehrhardt at mathematik dot uni-ulm dot de
gcc-bugzilla@gcc.gnu.org
Mon Jul 28 16:42:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11181
------- Additional Comments From ehrhardt at mathematik dot uni-ulm dot de 2003-07-28 16:42 -------
Subject: Re: [avr-gcc] Optimization of "uchar/xor/and/single_bit" produced wrong code.
On Mon, Jul 28, 2003 at 04:20:58PM -0000, pinskia at physics dot uc dot edu wrote:
> It looks like the mainline (20030728) is still broken with -Os
> (but I do not read avr asm.):
I've never seen an avr either ;-) But now gcc at least emmits an eor
after the call which is definitely a progression wrt. the assembly
in the audit trail.
> .L2:
> rcall f
> ldi r25,lo8(1)
> eor r25,r24
> sbrs r25,0
> rjmp .L2
I found an avr tutorial at
http://www.avr-asm-tutorial.net/avr_en/beginner/index.html
and this tells me that sbrs skips the next instruction if Bit 0 in r25
ist set. I.e. this code looks correct to me.
regards Christian
More information about the Gcc-bugs
mailing list