Re: Bug fix for glibc broke freebsd build in REL_11_STABLE

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Bug fix for glibc broke freebsd build in REL_11_STABLE
Date: 2018-09-04 20:59:59
Message-ID: 87in3lugm0.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Andres" == Andres Freund <andres(at)anarazel(dot)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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2018-09-04 21:14:19 Re: Bug fix for glibc broke freebsd build in REL_11_STABLE
Previous Message Michael Paquier 2018-09-04 20:58:18 Re: pgsql: Clean up after TAP tests in oid2name and vacuumlo.