From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22147 invoked by alias); 14 Oct 2004 19:48:56 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22138 invoked by uid 48); 14 Oct 2004 19:48:54 -0000 Date: Thu, 14 Oct 2004 19:48:00 -0000 From: "berndtrog at yahoo dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20041014194850.18002.berndtrog@yahoo.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug target/18002] New: [3.4/4.0 Regression] 'while' loop performace regression on avr target X-Bugzilla-Reason: CC X-SW-Source: 2004-10/txt/msg01989.txt.bz2 List-Id: Hello, when I compile(avr-gcc -c -Os -mmcu=atmega8 test.c) this code: int main (void) { while (((*(volatile unsigned char *)((0x0B) + 0x20)) & (1<<5)) == 0) { ; } return (0); } with gcc 3.3.1 I get this asm loop: 8: 5d 9b sbis 0x0b, 5 ; 11 a: fe cf rjmp .-4 ; 0x8 with gcc 3.4.2 or 4.0.0 I get this: 8: 41 e0 ldi r20, 0x01 ; 1 a: 50 e0 ldi r21, 0x00 ; 0 c: 8b b1 in r24, 0x0b ; 11 e: 99 27 eor r25, r25 10: 25 e0 ldi r18, 0x05 ; 5 12: 96 95 lsr r25 14: 87 95 ror r24 16: 2a 95 dec r18 18: e1 f7 brne .-8 ; 0x12 1a: 84 27 eor r24, r20 1c: 95 27 eor r25, r21 1e: 9c 01 movw r18, r24 20: 21 70 andi r18, 0x01 ; 1 22: 30 70 andi r19, 0x00 ; 0 24: 80 fd sbrc r24, 0 26: f2 cf rjmp .-28 ; 0xc -- Summary: [3.4/4.0 Regression] 'while' loop performace regression on avr target Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: berndtrog at yahoo dot com CC: gcc-bugs at gcc dot gnu dot org GCC host triplet: i686-pc-linux-gnu GCC target triplet: avr-elf http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18002