public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/9651: [Alpha] FPE with NAN in spite of isnan protection
@ 2003-02-11 2:56 Falk Hueffner
0 siblings, 0 replies; 4+ messages in thread
From: Falk Hueffner @ 2003-02-11 2:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR optimization/9651; it has been noted by GNATS.
From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
To: gcc-gnats@gcc.gnu.org,gcc-patches@gcc.gnu.org
Cc: Will Woods <will.woods@hp.com>
Subject: Re: optimization/9651: [Alpha] FPE with NAN in spite of isnan protection
Date: 11 Feb 2003 03:53:46 +0100
--=-=-=
Hi,
This patch marks fix expressions as trappable, preventing them from
being scheduled out of their block.
2003-02-11 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
PR optimization/9651
* rtlanal.c (may_trap_p): Handle FIX.
--
Falk
--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=fix-trap.patch
Index: gcc/rtlanal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtlanal.c,v
retrieving revision 1.145
diff -u -r1.145 rtlanal.c
--- gcc/rtlanal.c 17 Jan 2003 03:28:09 -0000 1.145
+++ gcc/rtlanal.c 11 Feb 2003 02:50:01 -0000
@@ -2517,6 +2517,12 @@
return 1;
break;
+ case FIX:
+ /* Conversion of floating point might trap. */
+ if (flag_trapping_math && HONOR_NANS (GET_MODE (XEXP (x, 0))))
+ return 1;
+ break;
+
case NEG:
case ABS:
/* These operations don't trap even with floating point. */
--=-=-=--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: optimization/9651: [Alpha] FPE with NAN in spite of isnan protection
@ 2003-02-11 20:59 rth
0 siblings, 0 replies; 4+ messages in thread
From: rth @ 2003-02-11 20:59 UTC (permalink / raw)
To: falk.hueffner, gcc-bugs, gcc-prs, nobody
Synopsis: [Alpha] FPE with NAN in spite of isnan protection
State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Tue Feb 11 20:59:18 2003
State-Changed-Why:
Applied 3.3 and mainline.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9651
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: optimization/9651: [Alpha] FPE with NAN in spite of isnan protection
@ 2003-02-11 20:56 Richard Henderson
0 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2003-02-11 20:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR optimization/9651; it has been noted by GNATS.
From: Richard Henderson <rth@redhat.com>
To: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Cc: gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org,
Will Woods <will.woods@hp.com>
Subject: Re: optimization/9651: [Alpha] FPE with NAN in spite of isnan protection
Date: Tue, 11 Feb 2003 12:49:34 -0800
On Tue, Feb 11, 2003 at 03:53:46AM +0100, Falk Hueffner wrote:
> * rtlanal.c (may_trap_p): Handle FIX.
Applied.
r~
^ permalink raw reply [flat|nested] 4+ messages in thread
* optimization/9651: [Alpha] FPE with NAN in spite of isnan protection
@ 2003-02-11 0:36 Falk Hueffner
0 siblings, 0 replies; 4+ messages in thread
From: Falk Hueffner @ 2003-02-11 0:36 UTC (permalink / raw)
To: gcc-gnats
>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 <math.h>
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:
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-02-11 20:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-11 2:56 optimization/9651: [Alpha] FPE with NAN in spite of isnan protection Falk Hueffner
-- strict thread matches above, loose matches on Subject: below --
2003-02-11 20:59 rth
2003-02-11 20:56 Richard Henderson
2003-02-11 0:36 Falk Hueffner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).