------- Comment #4 from fxcoudert at gcc dot gnu dot org  2006-02-17 20:33 
-------
This is a problem in libgfortran scalbn fallback version not handling correctly
denormals. A i686-linux testcase is included below. I switch this to severity
"minor".

$ cat a.c
#include <stdio.h>
#include <math.h>

double
gfortran_scalbn(double x, int y)
{
  static double two = 2;
  return x * pow(two, y);
}

int main (void)
{
  double x, y;
  int n, dummy;

  n = 1024;
  x = 2.22507385850720088902458687608585988765042311224e-308;
  y = gfortran_scalbn (frexp (x, &dummy), n);
  printf ("%lg\n", y);
  return 0;
}

$ gcc a.c -lm && ./a.out
inf

If we use the libm scalbn instead (at least on i686-linux), the result printed
is 1.79769e+308.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
  GCC build triplet|hppa1.1-hp-hpux10.20        |
   GCC host triplet|hppa1.1-hp-hpux10.20        |
 GCC target triplet|hppa1.1-hp-hpux10.20        |
   Last reconfirmed|2006-02-15 09:15:24         |2006-02-17 20:33:15
               date|                            |
            Summary|FAIL: gfortran.fortran-     |fallback scalbn doesn't
                   |torture/execute/intrinsic_se|handle denormals correctly
                   |t_exponent.f90 execution    |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253

Reply via email to