From: Noah Misch <noah@leadboat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees.
Date: Mon, 18 Apr 2016 22:11:44 -0400
Message-ID: <20160419021144.GA1984253@tornado.leadboat.com> (raw)
In-Reply-To: <12238.1460985466@sss.pgh.pa.us>
References: <E1aMibF-0007DJ-Px@gemulon.postgresql.org>
<570311F1.6020902@gmx.net>
<31479.1460152130@sss.pgh.pa.us>
<CA+Tgmoa1fig2OV0Mam3dPmAOhaf6T_E8CXvQsDunvDV9vYEhwg@mail.gmail.com>
<5714552B.5030001@gmx.net>
<CAB7nPqSvocAX1n9Wbozo8nfdOAZaA0MAxvkpwSKTFjc-0NxadQ@mail.gmail.com>
<12238.1460985466@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On Mon, Apr 18, 2016 at 09:17:46AM -0400, Tom Lane wrote:
> Michael Paquier <michael.paquier@gmail.com> writes:
> > On Mon, Apr 18, 2016 at 12:31 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> >> I don't know if it's worth tracking this as an open item and thus
> >> kind-of release blocker if no one else has the problem. But I
> >> definitely still have it. My initial suspicion was that this had
> >> something to do with a partial upgrade to gcc 6 (not yet released), in
> >> other words a messed up system. But I was able to reproduce it in a
> >> freshly installed chroot. It only happens with various versions of gcc,
> >> but not with clang. So I'm going to have to keep digging.
>
> > gcc is moving slowly but surely to have 6.0 in a released state btw:
> > https://gcc.gnu.org/ml/gcc/2016-04/msg00103.html
>
> Given that it's apparently showing the results of asind as NULL, the
> theory that comes to mind is some sort of optimization issue affecting
> the output tuple's null-flags. I have no idea why only this test would
> be affected, though. Anyway, a good way to test that theory would be
> to see if the -O level affects it.
I doubt asind is returning NULL. Here's the query, which uses a CASE to
report NULL if asind returns any value not on a whitelist:
SELECT x,
CASE WHEN asind(x) IN (-90,-30,0,30,90) THEN asind(x) END AS asind,
CASE WHEN acosd(x) IN (0,60,90,120,180) THEN acosd(x) END AS acosd,
CASE WHEN atand(x) IN (-45,0,45) THEN atand(x) END AS atand
FROM (VALUES (-1), (-0.5), (0), (0.5), (1)) AS t(x);
I can see the benefit for atand(-0.5) and for atand(0.5), since those are
inexact. Does the CASE gain us anything for asind or acosd?
Results under -O0 would be a helpful data point, nonetheless.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: noah@leadboat.com, tgl@sss.pgh.pa.us, michael.paquier@gmail.com, peter_e@gmx.net, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees.
In-Reply-To: <20160419021144.GA1984253@tornado.leadboat.com>
References: <E1aMibF-0007DJ-Px@gemulon.postgresql.org> <570311F1.6020902@gmx.net> <31479.1460152130@sss.pgh.pa.us> <CA+Tgmoa1fig2OV0Mam3dPmAOhaf6T_E8CXvQsDunvDV9vYEhwg@mail.gmail.com> <5714552B.5030001@gmx.net> <CAB7nPqSvocAX1n9Wbozo8nfdOAZaA0MAxvkpwSKTFjc-0NxadQ@mail.gmail.com> <12238.1460985466@sss.pgh.pa.us> <20160419021144.GA1984253@tornado.leadboat.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox