https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107569

--- Comment #22 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Note, I was using:
double
foo (int x, int y)
{
  double r;
  if (x >= 0)
    return 0.0;
  switch (y)
    {
    case 1: r = 0.0; break;
    case 2: r = 1.0; break;
    default: r = 0.5; break;
    }
  return r * __builtin_pow (10.0, x);
}
as reduced testcase of what the Fortran testcase does, but I see there some
unrelated problem:
Folding statement: _2 = __builtin_pow (1.0e+1, _1);
Global Exported: _2 = [frange] double [0.0 (0x0.0p+0), +Inf] +NAN
The +NAN looks suspicious, shouldn't that be +-NAN ?
Of course once we handle POW builtins, if we are smart enough we should see
that it is 10.0 ** [INT_MIN, -1] and so [0.0, 1.0e-1] (plus some larger ulp
error because library functions aren't exactly 0.5ulp precise all the time). 
But when we don't know what __builtin_pow does (from frange perspective), I
don't see what
tells us that NAN with negative sign can't appear.

Reply via email to