Message ID | 201610102216.u9AMGhpL024615@sellcey-thinkpad.caveonetworks.com |
---|---|
State | New |
Headers | show |
On Mon, 10 Oct 2016, Steve Ellcey wrote: > The easiest fix seems to be to add explicit '!= 0' to these lines. I did this > and verified that the generated code (on aarch64) is identical. > > OK to checkin? OK (this accords with the glibc rule that such implicit boolean conversions should be avoided).
diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c index 663fa39..bd758b5 100644 --- a/sysdeps/ieee754/dbl-64/e_pow.c +++ b/sysdeps/ieee754/dbl-64/e_pow.c @@ -466,15 +466,15 @@ checkint (double x) return (n & 1) ? -1 : 1; /* odd or even */ if (k > 20) { - if (n << (k - 20)) + if (n << (k - 20) != 0) return 0; /* if not integer */ - return (n << (k - 21)) ? -1 : 1; + return (n << (k - 21) != 0) ? -1 : 1; } if (n) return 0; /*if not integer */ if (k == 20) return (m & 1) ? -1 : 1; - if (m << (k + 12)) + if (m << (k + 12) != 0) return 0; - return (m << (k + 11)) ? -1 : 1; + return (m << (k + 11) != 0) ? -1 : 1; }