From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4496 invoked by alias); 11 Feb 2003 00:36:00 -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 4478 invoked by uid 71); 11 Feb 2003 00:36:00 -0000 Resent-Date: 11 Feb 2003 00:36:00 -0000 Resent-Message-ID: <20030211003600.4476.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 2183 invoked from network); 11 Feb 2003 00:29:32 -0000 Received: from unknown (HELO mailout10.sul.t-online.com) (194.25.134.21) by 172.16.49.205 with SMTP; 11 Feb 2003 00:29:32 -0000 Received: from fwd10.sul.t-online.de by mailout10.sul.t-online.com with smtp id 18iOIk-0000Ks-01; Tue, 11 Feb 2003 01:29:30 +0100 Received: from juist (520046482682-0001@[217.81.159.102]) by fmrl10.sul.t-online.com with esmtp id 18iOIg-0KOdvMC; Tue, 11 Feb 2003 01:29:26 +0100 Received: from falk by juist with local (Exim 3.36 #1 (Debian)) id 18iOIX-0003dP-00 for ; Tue, 11 Feb 2003 01:29:17 +0100 Message-Id: Date: Tue, 11 Feb 2003 00:36:00 -0000 From: Falk Hueffner To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: optimization/9651: [Alpha] FPE with NAN in spite of isnan protection X-SW-Source: 2003-02/txt/msg00476.txt.bz2 List-Id: >Number: 9651 >Category: optimization >Synopsis: [Alpha] FPE with NAN in spite of isnan protection >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Tue Feb 11 00:36:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Falk Hueffner >Release: 3.4 20030203 (experimental) >Organization: >Environment: System: Linux juist 2.5.59 #4 Sat Jan 18 12:46:41 CET 2003 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-languags=c++ --with-gcc-version-trigger=/src/gcc-2003.02.03/gcc/version.c --no-create --no-recursion : (reconfigured) ../configure --disable-nls --enable-languages=c++ >Description: % cat test.cc #include double f(void); int foo() { double d = f(); if (isnan(d) || (d != (int) d)) d = 0; return (int) d; } double f(void) { return NAN; } int main() { return foo(); } % g++ -O2 -mcpu=ev4 test.cc && ./a.out zsh: floating point exception (core dumped) ./a.out It looks like a cvttq/c was dragged out of the second condition: [...] .prologue 1 jsr $26,($27),_Z1fv !lituse_jsr!4 ldah $29,0($26) !gpdisp!5 lda $29,0($29) !gpdisp!5 cpys $f0,$f0,$f2 cpys $f0,$f0,$f16 ldq $27,__isnan($29) !literal!2 jsr $26,($27),__isnan !lituse_jsr!2 ldah $29,0($26) !gpdisp!3 lda $29,0($29) !gpdisp!3 -> cvttq/c $f2,$f10 stt $f10,16($30) cpys $f31,$f31,$f31 ldq $1,16($30) bne $0,$L3 >How-To-Repeat: >Fix: -fno-sched-interblock works around it. >Release-Note: >Audit-Trail: >Unformatted: