From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5453 invoked by alias); 11 Feb 2003 17:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 5430 invoked by uid 71); 11 Feb 2003 17:06:00 -0000 Resent-Date: 11 Feb 2003 17:06:00 -0000 Resent-Message-ID: <20030211170600.5428.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, gertom@rgai.hu Received: (qmail 4881 invoked by uid 48); 11 Feb 2003 17:04:41 -0000 Message-Id: <20030211170441.4880.qmail@sources.redhat.com> Date: Tue, 11 Feb 2003 17:06:00 -0000 From: gertom@rgai.hu Reply-To: gertom@rgai.hu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: target/9663: gcc-20030127 misses an optimization opportunity X-SW-Source: 2003-02/txt/msg00496.txt.bz2 List-Id: >Number: 9663 >Category: target >Synopsis: gcc-20030127 misses an optimization opportunity >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: pessimizes-code >Submitter-Id: net >Arrival-Date: Tue Feb 11 17:06:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Tamás Gergely >Release: gcc version 3.3 20030127 (prerelease) >Organization: >Environment: Built on: Linux 2.4.20 i686 unknown Configured with: /home/gertom/gcc/src/gcc-20030127/configure --target=arm-elf --prefix=/home/gertom/gcc/build/install-20030127-arm-elf-orgn --enable-target-optspace --with-newlib --with-headers --disable-nls --disable-threads --disable-shared --disable-libgcj --disable-multilib --with-gnu-as --with-gnu-ld --enable-languages=c,c++ Thread model: single >Description: The following two lines: cmp r0, #0 mov lr, r0 should be replaced with: subs lr, r0, #0 in the asm output. 20020503-1.i: --- # 1 "20020503-1.c" # 1 "" # 1 "" # 1 "20020503-1.c" void abort (void); static char * inttostr (long i, char buf[128]) { unsigned long ui = i; char *p = buf + 127; *p = '\0'; if (i < 0) ui = -ui; do *--p = '0' + ui % 10; while ((ui /= 10) != 0); if (i < 0) *--p = '-'; return p; } int main () { char buf[128], *p; p = inttostr (-1, buf); if (*p != '-') abort (); return 0; } >How-To-Repeat: just compile with -O2 >Fix: See "PATCH: new peephole2 in arm.md" at http://gcc.gnu.org/ml/gcc-patches/2003-02/msg00204.html >Release-Note: >Audit-Trail: >Unformatted: