[Bug tree-optimization/126464] [16/17 Regression] wrong code with FP ranges since r16-1108

"jakub at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126464

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[16/17 Regression] wrong    |[16/17 Regression] wrong
                   |code with FP ranges         |code with FP ranges since
                   |                            |r16-1108

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It is indeed that commit.
Slightly improved testcase:

[[gnu::noipa]] double
foo (double x)
{
  float y = (float) x;

  if (y == -__builtin_inff ())
    return x * 0.5;
  return y;
}

[[gnu::noipa]] long double
bar (long double x)
{
  double y = (double) x;

  if (y == __builtin_inf ())
    return x * 0.5L;
  return y;
}

int
main ()
{
  if (!__builtin_isinf ((double) 1e300)
      && __builtin_isinf ((float) 1e300)
      && foo (-1e300) != -5e299)
    __builtin_abort ();

  if (!__builtin_isinf ((long double) 1e4000L)
      && __builtin_isinf ((double) 1e4000L)
      && bar (1e4000L) != 5e3999L)
    __builtin_abort ();
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.