This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/11181] [3.3 only][avr-gcc] Optimization of "uchar/xor/and/single_bit" produced wrong code.
- From: "ehrhardt at mathematik dot uni-ulm dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Jul 2003 16:42:57 -0000
- Subject: [Bug optimization/11181] [3.3 only][avr-gcc] Optimization of "uchar/xor/and/single_bit" produced wrong code.
- References: <20030613031030.11181.dmixm@marine.febras.ru>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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