Re: Bug fix for glibc broke freebsd build in REL_11_STABLE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, vitus(at)wagner(dot)pp(dot)ru
Subject: Re: Bug fix for glibc broke freebsd build in REL_11_STABLE
Date: 2018-09-04 19:48:24
Message-ID: 29486.1536090504@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> writes:
> On Tue, Sep 4, 2018 at 9:39 AM Andrew Gierth
> <andrew(at)tao11(dot)riddles(dot)org(dot)uk> wrote:
>> I also confirmed that without #define isinf(x) __builtin_isinf(x), on
>> both 32bit and 64bit fbsd isinf() compiles as a function call, so the
>> OP's proposed change would not be desirable.

Presumably what we are looking at here is a compiler codegen bug for
__builtin_isinf(). The proposed change dodges it precisely by
substituting the library function instead --- at a performance penalty.
I agree that this isn't a real desirable fix, and we definitely ought
not cause it to happen on platforms that haven't got the bug.

> I installed FreeBSD 11.2 i386 on a virtual machine. I couldn't
> reproduce the problem with either the base cc (clang 6.0.0) or clang38
> (clang 3.8.1) installed via pkg.
> The OP reported clang 3.8.0, so a minor version behind what I tested.

I tried to reproduce the problem, without success, on a few different
FreeBSD images I had laying about:

FreeBSD 11.0/x86_64, clang version 3.8.0
(this confirms OP's report that x86_64 is OK)

FreeBSD 10.3/ppc, gcc 4.2.1

FreeBSD 12.0-CURRENT (from around mid-May)/arm64, clang version 6.0.0

(I was testing PG HEAD, not the 11 branch, but I don't see a reason
to think that'd make a difference.)

I also looked for evidence of a bug of this sort in the clang bugzilla.
I couldn't find anything, but it's possible that "isinf" isn't what
I should have searched on.

Anyway, my estimation is that this is a compiler bug that's been
repaired, and it probably isn't widespread enough to justify our
inserting some klugy workaround.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Victor Wagner 2018-09-04 19:52:49 Re: Bug fix for glibc broke freebsd build in REL_11_STABLE
Previous Message Tom Lane 2018-09-04 19:16:55 Re: pgsql: Clean up after TAP tests in oid2name and vacuumlo.