This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
optimization/520: exp function can't handle -inf in optimized mode on i686
- To: gcc-gnats at gcc dot gnu dot org
- Subject: optimization/520: exp function can't handle -inf in optimized mode on i686
- From: karsten dot trulsen at math dot sintef dot no
- Date: 11 Sep 2000 07:28:12 -0000
- Cc: karsten dot trulsen at math dot sintef dot no
- Reply-To: karsten dot trulsen at math dot sintef dot no
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, karsten dot trulsen at math dot sintef dot no
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, karsten.trulsen@math.sintef.no
>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: