Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XuNa8-0001Kq-B7 for pgsql-bugs@arkaria.postgresql.org; Fri, 28 Nov 2014 15:35:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XuNa6-0007yi-Pp for pgsql-bugs@arkaria.postgresql.org; Fri, 28 Nov 2014 15:35:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XuNa5-0007yb-Op for pgsql-bugs@postgresql.org; Fri, 28 Nov 2014 15:35:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XuNa2-0000t9-Mi for pgsql-bugs@postgresql.org; Fri, 28 Nov 2014 15:35:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sASFZLIY009706; Fri, 28 Nov 2014 10:35:21 -0500 From: Tom Lane To: Mats Erik Andersson cc: pgsql-bugs@postgresql.org Subject: Re: Solaris fails test with float8. In-reply-to: <20141128150104.GA28806@mail.gisladisker.se> References: <20141128150104.GA28806@mail.gisladisker.se> Comments: In-reply-to Mats Erik Andersson message dated "Fri, 28 Nov 2014 16:01:04 +0100" Date: Fri, 28 Nov 2014 10:35:21 -0500 Message-ID: <9705.1417188921@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Mats Erik Andersson writes: > (Please send me a carbon copy when responding.) > A Solaris system like my OpenIndiana oi_151a9 is failing > a single test case, namely float8, when testing either > of PostgreSQL 9.4beta2, 9.4beta3, and 9.4rc1. I do not > know how properly to interpret the output in expressed > in "regression.diffs", so tell whether I could do some > further modification to produce a better diagnosis. It appears that your machine is returning -Infinity, rather than throwing an error, for the case of -1.2345678901234e200 * 1e200 (both inputs being float8 not numeric). That test has been there since forever, so I'm pretty sure any previous Postgres release would also fail this test on such a machine. Looking a bit closer at float8mul leaves me wondering exactly what happened, though. It appears that the result of the multiplication did not satisfy isinf(), else the CHECKFLOATVAL macro would've thrown the expected error ... but then why did float8out print it as "-Infinity"? The most likely theory seems to go like this: the result of the multiplication is initially sitting in a wider-than-double register, which'd be able to represent -1.234e400 without overflow; the compiler applies an isinf operation to that register and decides it ain't infinity; but then when float8mul returns, the value has to be converted to plain double, at which point the hardware changes it to an IEEE infinity since the value is too large. If that's what went down, it's a compiler bug, because the text of the function is very clear that the multiplication result must be stored into a double (not long double) variable before isinf() is applied to it. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs