Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePEj7-0002Dw-TH for pgsql-committers@arkaria.postgresql.org; Wed, 13 Dec 2017 21:38:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePEj7-0002Lx-5b for pgsql-committers@arkaria.postgresql.org; Wed, 13 Dec 2017 21:38:05 +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 1ePEj6-0002Ln-Pk for pgsql-committers@lists.postgresql.org; Wed, 13 Dec 2017 21:38:05 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ePEiz-0001F9-Gq for pgsql-committers@postgresql.org; Wed, 13 Dec 2017 21:38:04 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id F2B9820716; Wed, 13 Dec 2017 16:37:55 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Wed, 13 Dec 2017 16:37:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=cPOaaLKiz612OwJGRhX13H4n87hn4 thjj8dgWQrVGGY=; b=KdTi3Qt4hhuEf/SkLhGWIICccg1m0ARlA0TbwOkeZ+xU3 If1D8sXhFrKOASvMRl8QcPQWltgO8qpR3ukFq2fSsSTGJkXQ99qhOR2gnibS4Qij RmtaDgEHEwZo/GZ4i6RoXPSn5qv2hwUGsOV/fGFb/81mBYmeLexAx6HEHYnfXdrM +HkozZ9GQYX1R4SkifZBtVhwfWrybVMq7dXZxOW1ba1/mUlPQgObC60QPAhsLgsJ gwDlSTQZD1s8hLQ+O04+LmvPUV+FEupO/xuprKq/6uFFexbe2HwvodzZqkenx4GW Ohlxz2msmXiysS3xb1Qffh23RMpQt+n9J3n9AGFgQ== X-ME-Sender: Received: from intern.anarazel.de (unknown [136.24.76.189]) by mail.messagingengine.com (Postfix) with ESMTPA id AE39F2415E; Wed, 13 Dec 2017 16:37:55 -0500 (EST) Date: Wed, 13 Dec 2017 13:37:54 -0800 From: Andres Freund To: pgsql-committers@postgresql.org, Michael Paquier Subject: Re: pgsql: Provide overflow safe integer math inline functions. Message-ID: <20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Michael, On 2017-12-13 01:01:19 +0000, Andres Freund wrote: > Provide overflow safe integer math inline functions. https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=dangomushi&dt=2017-12-13%2018%3A00%3A18 which seems half like a compiler bug to me. But either way, we gotta work around it. I suspect the reason configure test doesn't sufficiently detect this here is because it's testing the function with constant arguments. Could you perhaps test whether replacing PGAC_C_BUILTIN_OP_OVERFLOW's body with something like result PG_INT64_TYPE a; PG_INT64_TYPE b; PG_INT64_TYPE result; __builtin_mul_overflow(*(volatile PG_INT64_TYPE*) &a, *(volatile PG_INT64_TYPE*) &b, &result); makes it fail? I'd rather not test this via the buildfarm, given that dangomushi isn't the most frequently running / fastest animal. - Andres