This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/520: exp function can't handle -inf in optimized mode on i686
- To: nobody at gcc dot gnu dot org
- Subject: Re: optimization/520: exp function can't handle -inf in optimized mode on i686
- From: "Tim Prince" <tprince at computer dot org>
- Date: 11 Sep 2000 12:06:00 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: "Tim Prince" <tprince at computer dot org>
The following reply was made to PR optimization/520; it has been noted by GNATS.
From: "Tim Prince" <tprince@computer.org>
To: <karsten.trulsen@math.sintef.no>, <gcc-gnats@gcc.gnu.org>
Cc: <karsten.trulsen@math.sintef.no>
Subject: Re: optimization/520: exp function can't handle -inf in optimized mode on i686
Date: Mon, 11 Sep 2000 05:02:19 -0700
Yes,. I still fail to understand why the additional code to fix this is not
acceptable, when no one has even shown any benchmarks to show a significant
loss of performance. But that is a matter for glibc, not part of gcc.
----- Original Message -----
From: <karsten.trulsen@math.sintef.no>
To: <gcc-gnats@gcc.gnu.org>
Cc: <karsten.trulsen@math.sintef.no>
Sent: Monday, September 11, 2000 12:28 AM
Subject: optimization/520: exp function can't handle -inf in optimized mode
on i686
>
> >Number: 520
> >Category: optimization
> >Synopsis: exp function can't handle -inf in optimized mode on i686
> >Confidential: no
> >Severity: serious
> >Priority: medium
> >Responsible: unassigned
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Mon Sep 11 00:36:00 PDT 2000
> >Closed-Date:
> >Last-Modified:
> >Originator: Karsten Trulsen
> >Release: gcc-2.95.2
> >Organization:
> >Environment:
> i686 RedHat 6.2
> >Description:
> exp(-inf) should return 0. However, when compiled with
> optimization turned on, on a i686 (running RedHat 6.2),
> the return value is "nan".
> >How-To-Repeat:
> #include <math.h>
> #include <stdio.h>
>
> int
> main (void)
> {
> double x = 0;
> printf ("%g\n", x);
> x = log (x);
> printf ("%g\n", x);
> x = exp (x);
> printf ("%g\n", x);
> return 1;
> }
> >Fix:
> The error is probably in the assembly code in the file
> /usr/include/bits/mathinlines.h.
> >Release-Note:
> >Audit-Trail:
> >Unformatted: