From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-committers@postgresql.org, Michael Paquier <michael.paquier@gmail.com>
Subject: Re: pgsql: Provide overflow safe integer math inline functions.
Date: Sat, 16 Dec 2017 20:31:01 -0500
Message-ID: <22109.1513474261@sss.pgh.pa.us> (raw)
In-Reply-To: <20171217003207.3myeahkbsm63kbvl@alap3.anarazel.de>
References: <E1eOvQF-00075r-Cy@gemulon.postgresql.org>
<20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de>
<20171217003207.3myeahkbsm63kbvl@alap3.anarazel.de>
Andres Freund <andres@anarazel.de> 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
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: tgl@sss.pgh.pa.us, andres@anarazel.de, michael.paquier@gmail.com
Subject: Re: pgsql: Provide overflow safe integer math inline functions.
In-Reply-To: <22109.1513474261@sss.pgh.pa.us>
References: <E1eOvQF-00075r-Cy@gemulon.postgresql.org> <20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de> <20171217003207.3myeahkbsm63kbvl@alap3.anarazel.de> <22109.1513474261@sss.pgh.pa.us>
* 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