Re: Bug fix for glibc broke freebsd build in REL_11_STABLE
Andrew Gierth <andrew@tao11.riddles.org.uk>
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Victor Wagner <vitus@wagner.pp.ru>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-09-04T20:59:59Z
Lists: pgsql-hackers
>>>>> "Andres" == Andres Freund <andres@anarazel.de> writes:
Andres> Thomas and I are sitting in a cafe and are trying to figure out
Andres> what's going on...
I have a standalone test case:
#include <stdio.h>
#include <math.h>
int main(int argc, char **argv)
{
double d1 = (argc ? 1e180 : 0);
double d2 = (argv ? 1e200 : 0);
int r2 = __builtin_isinf(d1 * d2);
int r1 = isinf(d1 * d2);
printf("r1 = %d, r2 = %d\n", r1, r2);
return 0;
}
Note that swapping the r1 and r2 lines makes the problem disappear (!).
on amd64, clang 3.9.1:
cc -O2 -m32 flttst.c && ./a.out
r1 = 1, r2 = 0
cc -O2 flttst.c && ./a.out
r1 = 1, r2 = 1
Can't reproduce on 32-bit arm.
--
Andrew (irc:RhodiumToad)
Commits
-
Error out for clang on x86-32 without SSE2 support, no -fexcess-precision.
- 978515df2278 9.3.25 landed
- 29196e13cd70 9.4.20 landed
- dbbc98a9ef67 9.5.15 landed
- e553997e3f59 9.6.11 landed
- 1b8f09dbd352 10.6 landed
- 84f14fb78852 11.0 landed
- bd1463e348fc 12.0 landed
-
Fix 8a934d677 for libc++ and make more include order resistant.
- 1f349aa7d9a6 11.0 cited