------- Comment #3 from dickinsm at gmail dot com  2010-06-26 18:26 -------
Apologies;  I seem to have messed up the original bug report, by accidentally
pasting a slightly edited version of the original bug file.  The minimal
test-case is as follows:


#include <math.h>
#include <stdio.h>

int copysign_bug(double x)
{
  if (x && (x * 0.5 == x))    // note the extra "x &&" here
    return 1;
  if (copysign(1.0, x) < 0.0)
    return 2;
  else
    return 3;
}

int main(void) {
  double x;
  x = -0.0;
  printf("copysign_bug(%.17g) = %d\n", x, copysign_bug(x));

  x = 0.0;
  printf("copysign_bug(%.17g) = %d\n", x, copysign_bug(x));

  return 0;
}


-- 


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

Reply via email to