[Bug tree-optimization/93744] [8/9/10 Regression] Different results between gcc-9 and gcc-7

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Feb 15 12:16:00 GMT 2020


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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As for the signed zeros, I can't really reproduce it.  Tried with:
__attribute__((noipa)) void
foo (int x)
{
  double a = 0.0;
  double b = -0.0;
  _Bool c = x > 0;
  _Bool d = x > 1;
  double e = c;
  double f = d;
  double g = e * a;
  double h = f * b;
  if (__builtin_copysign (1.0, g) != 1.0
      || __builtin_copysign (1.0, h) != -1.0)
    __builtin_abort ();
}

int
main ()
{
  foo (0);
  return 0;
}

The thing is that convert in (convert (cmp $0 $1)) seems to match just
CASE_CONVERT:, but result of a comparison is always integral (or vector
integral) and so there would need to be a FLOAT_EXPR rather than
{NOP,CONVERT}_EXPR to convert it to floating point.
Allowing other comparisons or any boolean results is certainly reasonable, but
would be an enhancement request for GCC 11.


More information about the Gcc-bugs mailing list