From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25957 invoked by alias); 7 Apr 2009 09:51:56 -0000 Received: (qmail 25908 invoked by uid 48); 7 Apr 2009 09:51:44 -0000 Date: Tue, 07 Apr 2009 09:51:00 -0000 Message-ID: <20090407095144.25907.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/39635] [avr] integer wrong code bug In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "wvangulik at xs4all dot nl" 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: 2009-04/txt/msg00575.txt.bz2 ------- Comment #2 from wvangulik at xs4all dot nl 2009-04-07 09:51 ------- The problem is it uses R22 as loop counter and as the shift counter. I could not (yet) reproduce the problem in a smaller example. This could be the same problem as: http://lists.gnu.org/archive/html/avr-gcc-list/2009-03/msg00203.html or http://lists.gnu.org/archive/html/avr-gcc-list/2009-03/msg00158.html ; (insn 16 15 17 main.c:24 (set (reg/v:HI 22 r22 [orig:42 _left ] [42]) ; (ashift:HI (reg/v:HI 22 r22 [orig:42 _left ] [42]) ; (reg:QI 22 r22 [orig:54 _right.2 ] [54]))) 54 {ashlhi3} (expr_list:REG_DEAD (reg:QI 18 r18 [orig:54 _right.2 ] [54]) ; (expr_list:REG_UNUSED (reg:QI 23 r23) ; (nil)))) rjmp 2f ; 16 ashlhi3/1 [length = 6] 1: lsl r22 rol r23 2: dec r22 brpl 1b An other interresting point is the rtl stating reg 23 is unused. Unfortunatly the avr backend can not remove the useless shift. But that is another issue. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39635