Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQNnR-0006AX-GM for pgsql-committers@arkaria.postgresql.org; Sun, 17 Dec 2017 01:31:17 +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 1eQNnQ-00057w-Eh for pgsql-committers@arkaria.postgresql.org; Sun, 17 Dec 2017 01:31:16 +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 1eQNnQ-00057m-9q for pgsql-committers@lists.postgresql.org; Sun, 17 Dec 2017 01:31:16 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eQNnI-0004fo-OI for pgsql-committers@postgresql.org; Sun, 17 Dec 2017 01:31:15 +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 vBH1V1Zg022110; Sat, 16 Dec 2017 20:31:01 -0500 From: Tom Lane To: Andres Freund cc: pgsql-committers@postgresql.org, Michael Paquier Subject: Re: pgsql: Provide overflow safe integer math inline functions. In-reply-to: <20171217003207.3myeahkbsm63kbvl@alap3.anarazel.de> References: <20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de> <20171217003207.3myeahkbsm63kbvl@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sat, 16 Dec 2017 16:32:07 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22108.1513474261.1@sss.pgh.pa.us> Date: Sat, 16 Dec 2017 20:31:01 -0500 Message-ID: <22109.1513474261@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > I'm not quite following. Could you check if the same happens without > -O2? Not because that'd be a solution, but to narrow down how this > happens? The committed test looks quite broken to me: it's missing some & operators. Not sure how that translates into failing to fail the configure test, but personally I'd have done this like volatile PG_INT64_TYPE a = 1; volatile PG_INT64_TYPE b = 1; PG_INT64_TYPE result; __builtin_mul_overflow(a, b, &result); regards, tom lane