Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asL8w-0007KA-7x for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Apr 2016 02:11:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1asL8v-0004eX-AR for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Apr 2016 02:11:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1asL8t-0004ds-OZ for pgsql-hackers@postgresql.org; Tue, 19 Apr 2016 02:11:56 +0000 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1asL8p-0004lQ-32 for pgsql-hackers@postgresql.org; Tue, 19 Apr 2016 02:11:54 +0000 Received: by mail-pa0-x22d.google.com with SMTP id r5so1105850pag.1 for ; Mon, 18 Apr 2016 19:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ESoiNfhDntOcVYlcF2Hf1h+zJ1uSFufX0T5MVDNtBb8=; b=C0J1mIXzwu2+fyWosRkeEOvjUBnxeU+r0+tLjGBfKttttyteQFJCurBxV89t4LDv9S x06L9DmJ9RFNHLP4oT8VTgTHZCb/AncecP0tv8Zz81Z/SkUS8ZuwD+yVTPyTRb7F3mrK XJ7wUFtTbjJL5LslIe7M/O3b5ZoTm10XnHyPs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ESoiNfhDntOcVYlcF2Hf1h+zJ1uSFufX0T5MVDNtBb8=; b=ZQ8yb4a1u0enyz85S4X4KL8AliYO6UDDSaxeejM5kikBM9Kmpi5oIDmAdLcyY/77ZH Td03yC3fd5BIJi9c58r92wWEHCSYdfKjqNE89uOp2FFyTZDu287KCAUdtw0odHiiXSgz Jkk2HcXex2gX7MnOfk8R4dSDeXyZ1U7pjFEGQsjMNHBtbEo3uDDhsM9Aymf2ZE4elAJf 9l2SdTm5W/G+tV9JvtxtEBWIJV5bJoWa3vqgLgT62rna27KrCR2LDenuapmj/Ez7W3Lj tKIB67BbIvcJJCwORtW/GY9b3GnJaHmZfvRIBEm2YyD6g+6MftdGUENmC+/zJsJAueXU TNsQ== X-Gm-Message-State: AOPr4FWvmbkYR+6qlFVB8fK/J3Y+Bj+G1FrfhR3yu5Xm7Vrl82U8hJ225LwX/ECrDX44Yg== X-Received: by 10.66.118.106 with SMTP id kl10mr585585pab.78.1461031907574; Mon, 18 Apr 2016 19:11:47 -0700 (PDT) Received: from tornado.leadboat.com (c-98-248-47-228.hsd1.ca.comcast.net. [98.248.47.228]) by smtp.gmail.com with ESMTPSA id g21sm6961433pfb.7.2016.04.18.19.11.46 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Apr 2016 19:11:46 -0700 (PDT) Date: Mon, 18 Apr 2016 22:11:44 -0400 From: Noah Misch To: Tom Lane Cc: Michael Paquier , Peter Eisentraut , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees. Message-ID: <20160419021144.GA1984253@tornado.leadboat.com> References: <570311F1.6020902@gmx.net> <31479.1460152130@sss.pgh.pa.us> <5714552B.5030001@gmx.net> <12238.1460985466@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12238.1460985466@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Mon, Apr 18, 2016 at 09:17:46AM -0400, Tom Lane wrote: > Michael Paquier writes: > > On Mon, Apr 18, 2016 at 12:31 PM, Peter Eisentraut 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