From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23078 invoked by alias); 7 Jan 2010 11:31:56 -0000 Received: (qmail 23026 invoked by uid 48); 7 Jan 2010 11:31:44 -0000 Date: Thu, 07 Jan 2010 11:31:00 -0000 Message-ID: <20100107113144.23025.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/42505] [4.4 / 4.5 regression] loop canonicalization causes a lot of unnecessary temporary variables In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sliao at google dot com" 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: 2010-01/txt/msg00756.txt.bz2 ------- Comment #2 from sliao at google dot com 2010-01-07 11:31 ------- 1. Yes, the flags used are "-mthumb -Os -march=armv5te". 2. For completeness, I also tried to generate 32-bit instructions. In this case of ARM mode, GCC 4.5.0 (trunk as of last week) didn't store things onto stack unnecessarily. I.e., there is no more "sub sp, sp, #12" instruction. See below: 00000000 : 0: e92d41f0 push {r4, r5, r6, r7, r8, lr} 4: e1a05000 mov r5, r0 8: e1a04001 mov r4, r1 c: e1a07002 mov r7, r2 10: e3a06000 mov r6, #0 14: ea000009 b 40 18: e0858006 add r8, r5, r6 1c: e5980004 ldr r0, [r8, #4] 20: ebfffffe bl 0 24: e3500000 cmp r0, #0 28: e2477001 sub r7, r7, #1 2c: 0a000006 beq 4c 30: e8980003 ldm r8, {r0, r1} 34: e0843006 add r3, r4, r6 38: e8830003 stm r3, {r0, r1} 3c: e2866008 add r6, r6, #8 40: e3570000 cmp r7, #0 44: 1afffff3 bne 18 48: e3a00001 mov r0, #1 4c: e8bd41f0 pop {r4, r5, r6, r7, r8, lr} 50: e12fff1e bx lr -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42505