From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7292 invoked by alias); 9 Dec 2002 22:46:02 -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 7268 invoked by uid 71); 9 Dec 2002 22:46:00 -0000 Resent-Date: 9 Dec 2002 22:46:00 -0000 Resent-Message-ID: <20021209224600.7267.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, Falk Hueffner Received: (qmail 6655 invoked from network); 9 Dec 2002 22:41:58 -0000 Received: from unknown (HELO mailout07.sul.t-online.com) (194.25.134.83) by sources.redhat.com with SMTP; 9 Dec 2002 22:41:58 -0000 Received: from fwd04.sul.t-online.de by mailout07.sul.t-online.com with smtp id 18LWb6-0006Tl-00; Mon, 09 Dec 2002 23:41:56 +0100 Received: from juist (520046482682-0001@[217.81.145.11]) by fmrl04.sul.t-online.com with esmtp id 18LWay-1KO4VEC; Mon, 9 Dec 2002 23:41:48 +0100 Received: from falk by juist with local (Exim 3.36 #1 (Debian)) id 18LWai-0004uk-00 for ; Mon, 09 Dec 2002 23:41:32 +0100 Message-Id: Date: Mon, 09 Dec 2002 14:46:00 -0000 From: Falk Hueffner To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: optimization/8883: Alpha: regalloc too eager to use FP regs on EV6 X-SW-Source: 2002-12/txt/msg00499.txt.bz2 List-Id: >Number: 8883 >Category: optimization >Synopsis: Alpha: regalloc too eager to use FP regs on EV6 >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: pessimizes-code >Submitter-Id: net >Arrival-Date: Mon Dec 09 14:46:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Falk Hueffner >Release: 3.3 20021102 (experimental) >Organization: >Environment: System: Linux juist 2.4.20-rc1 #1 Sun Nov 10 15:01:35 CET 2002 alpha unknown unknown GNU/Linux Architecture: alpha host: alphaev68-unknown-linux-gnu build: alphaev68-unknown-linux-gnu target: alphaev68-unknown-linux-gnu configured with: ../configure --disable-nls --enable-languages=c++ >Description: % cat med.c typedef unsigned long uint64_t; uint64_t median(uint64_t a, uint64_t b, uint64_t c) { return (a < b != b >= c) ? b : ((a < c != c > b) ? c : a); } % gcc -c -mcpu=ev6 -O3 med.c && objdump -d med.o 0000000000000000 : 0: a4 03 12 42 cmpult a0,a2,t3 4: a1 03 32 42 cmpult a1,a2,t0 8: a3 07 51 42 cmpule a2,a1,t2 c: a6 07 30 42 cmpule a1,a0,t5 10: 05 08 81 44 xor t3,t0,t4 14: 02 08 c3 44 xor t5,t2,t1 18: 92 04 b0 44 cmoveq t4,a0,a2 1c: 8a 04 5f 52 itoft a2,$f10 20: 01 00 40 f4 bne t1,28 24: 8a 04 3f 52 itoft a1,$f10 28: 00 0e 5f 71 ftoit $f10,v0 2c: 01 80 fa 6b ret itoft has a latency of 4, and ftoi a latency of 3, so they should really only be used if it cannot be avoided. (Also, the branch can be replaced with a cmov, but that's probably more difficult to fix.) This problem does not occur with -mcpu=ev5, or with -fnew-ra. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: