From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23501 invoked by alias); 16 Apr 2002 14:56:07 -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 23440 invoked by uid 71); 16 Apr 2002 14:56:04 -0000 Resent-Date: 16 Apr 2002 14:56:04 -0000 Resent-Message-ID: <20020416145604.23439.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, francisco.blasco@ds2.es Received:(qmail 20256 invoked by uid 61); 16 Apr 2002 14:53:22 -0000 Message-Id:<20020416145322.20255.qmail@sources.redhat.com> Date: Tue, 16 Apr 2002 07:56:00 -0000 From: francisco.blasco@ds2.es Reply-To: francisco.blasco@ds2.es To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: optimization/6324: On ARC-ELF32 target, optimizations generate uncomplete code X-SW-Source: 2002-04/txt/msg00836.txt.bz2 List-Id: >Number: 6324 >Category: optimization >Synopsis: On ARC-ELF32 target, optimizations generate uncomplete code >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Apr 16 07:56:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: francisco.blasco@ds2.es >Release: gcc version 3.1 20020408 >Organization: >Environment: Linux Slackware 8.0 gcc version 2.95.3 20010315 (release) >Description: I compiled gcc for ARC-ELF32 target. When you compiled this code: int ll(int k) { return k<0?1234:0; } It generates next assembler output (bad): .cpu base .section .text .align 4 .global _ll .type _ll,@function _ll: ; BEGIN PROLOGUE ; vars= 0, regs= 0, args= 0, extra= 0 st fp,[sp] mov fp,sp ; END PROLOGUE mov r0,1234 mov.ge r0,0 ; EPILOGUE j.d blink ld.a fp,[sp,0] .Lfe1: .size _ll,.Lfe1-_ll .ident "GCC: (GNU) 3.1 20020408 (prerelease)" And the right output is: .cpu base .section .text .align 4 .global _ll .type _ll,@function _ll: ; BEGIN PROLOGUE ; vars= 0, regs= 0, args= 0, extra= 0 st fp,[sp] mov fp,sp ; END PROLOGUE sub.f 0,r0,0 mov r0,1234 mov.ge r0,0 ; EPILOGUE j.d blink ld.a fp,[sp,0] .Lfe1: .size _ll,.Lfe1-_ll .ident "GCC: (GNU) 3.1 20020408 (prerelease)" The problem is on the optimization reduction (I think). Note: I'm working with ARC processor. If you want, I can become a tester. >How-To-Repeat: arc-elf32-gcc -S -O2 -o - example.c >Fix: >Release-Note: >Audit-Trail: >Unformatted: