pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org, Michael Paquier <michael.paquier@gmail.com>
Subject: Re: pgsql: Provide overflow safe integer math inline functions.
Date: Wed, 13 Dec 2017 13:37:54 -0800
Message-ID: <20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de> (raw)
In-Reply-To: <E1eOvQF-00075r-Cy@gemulon.postgresql.org>
References: <E1eOvQF-00075r-Cy@gemulon.postgresql.org>

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




view thread (16+ messages)  latest in thread

Message-ID: <20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de>
Permalink:  ../20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de

 · 

reply

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: andres@anarazel.de, michael.paquier@gmail.com
  Subject: Re: pgsql: Provide overflow safe integer math inline functions.
  In-Reply-To: <20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de>
  References: <E1eOvQF-00075r-Cy@gemulon.postgresql.org> <20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de>

* 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