From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8442 invoked by alias); 9 Jul 2011 16:45:55 -0000 Received: (qmail 8217 invoked by uid 22791); 9 Jul 2011 16:45:53 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_GJ,TW_PQ X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 09 Jul 2011 16:45:39 +0000 From: "gjl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/39633] [avr] loop bug X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: gjl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sat, 09 Jul 2011 16:45:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg00710.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39633 --- Comment #8 from Georg-Johann Lay 2011-07-09 16:45:20 UTC --- Created attachment 24727 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24727 C file, reduced test case Compiler with avr-gcc 4.6.1 -Os -S -fno-split-wide-types -dp to get: func_1: push r8 ; 94 *pushqi/1 [length = 1] push r9 ; 95 *pushqi/1 [length = 1] push r10 ; 96 *pushqi/1 [length = 1] push r11 ; 97 *pushqi/1 [length = 1] push r12 ; 98 *pushqi/1 [length = 1] push r13 ; 99 *pushqi/1 [length = 1] push r14 ; 100 *pushqi/1 [length = 1] push r15 ; 101 *pushqi/1 [length = 1] clr r8 ; 3 *movqi/1 [length = 1] .L2: lds r24,g_52 ; 15 *movqi/4 [length = 2] subi r24,lo8(-(1)) ; 16 addqi3/2 [length = 1] sts g_52,r24 ; 17 *movqi/3 [length = 2] mov r24,r8 ; 19 *movqi/1 [length = 1] ldi r22,lo8(3) ; 20 *movqi/2 [length = 1] rcall foo ; 21 call_value_insn/3 [length = 1] mov r8,r24 ; 23 *movqi/1 [length = 1] >>>> BUG START lsl r24 ; 24 ashrqi3/5 [length = 2] sbc r24,r24 brne .L1 ; 34 branch [length = 1] >>>> BUG END tst r24 ; 37 *cmpqi/1 [length = 1] brne .L1 ; 38 branch [length = 1] tst r24 ; 41 *cmpqi/1 [length = 1] brne .L1 ; 42 branch [length = 1] tst r24 ; 45 *cmpqi/1 [length = 1] brne .L1 ; 46 branch [length = 1] tst r24 ; 49 *cmpqi/1 [length = 1] brne .L1 ; 50 branch [length = 1] tst r24 ; 53 *cmpqi/1 [length = 1] brne .L1 ; 54 branch [length = 1] tst r24 ; 57 *cmpqi/1 [length = 1] brne .L1 ; 58 branch [length = 1] ldi r24,lo8(12) ; 93 *movqi/2 [length = 1] cp r24,r8 ; 61 *cmpqi/2 [length = 1] brsh .L2 ; 62 branch [length = 1] .L1: pop r15 ; 104 popqi [length = 1] pop r14 ; 105 popqi [length = 1] pop r13 ; 106 popqi [length = 1] pop r12 ; 107 popqi [length = 1] pop r11 ; 108 popqi [length = 1] pop r10 ; 109 popqi [length = 1] pop r9 ; 110 popqi [length = 1] pop r8 ; 111 popqi [length = 1] ret ; 112 return_from_epilogue [length = 1]