From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26986 invoked by alias); 13 Aug 2004 17:54:50 -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 26978 invoked by uid 48); 13 Aug 2004 17:54:49 -0000 Date: Fri, 13 Aug 2004 17:54:00 -0000 Message-ID: <20040813175449.26977.qmail@sourceware.org> From: "danfuzz at milk dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040813164249.17019.danfuzz@milk.com> References: <20040813164249.17019.danfuzz@milk.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug target/17019] THUMB -O1: bad code generated for simple for loop X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg01297.txt.bz2 List-Id: ------- Additional Comments From danfuzz at milk dot com 2004-08-13 17:54 ------- I just looked at the intermediate RTL, and, near as I can tell, as of pass 35.mach, the code is ok. Here's the loop skip test: (jump_insn 44 74 72 (parallel [ (set (pc) (if_then_else (lt (plus:SI (reg/v:SI 0 r0 [orig:68 a ] [68]) (const_int 1 [0x1])) (const_int 0 [0x0])) (label_ref 45) (pc))) (clobber (reg:SI 3 r3)) ]) 176 {*addsi3_cbranch_scratch} (insn_list 3 (nil)) (expr_list:REG_UNUSED (reg:SI 3 r3) (expr_list:REG_BR_PROB (const_int 3600 [0xe10]) (nil)))) I read that as skipping the loop if (a + 1) < 0, which I believe is correct. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17019