pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-committers@lists.postgresql.org, Michael Paquier <michael.paquier@gmail.com>
Subject: Re: pgsql: Provide overflow safe integer math inline functions.
Date: Sat, 16 Dec 2017 20:48:32 -0500
Message-ID: <23537.1513475312@sss.pgh.pa.us> (raw)
In-Reply-To: <99F06D02-BB7E-40F1-93BE-7113713F1AC0@anarazel.de>
References: <E1eOvQF-00075r-Cy@gemulon.postgresql.org>
	<20171213213754.pydkyjs6bt2hvsdb@alap3.anarazel.de>
	<20171217003207.3myeahkbsm63kbvl@alap3.anarazel.de>
	<22109.1513474261@sss.pgh.pa.us>
	<99F06D02-BB7E-40F1-93BE-7113713F1AC0@anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> On December 16, 2017 5:31:01 PM PST, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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,

> Hm, true. As you say, it doesn't explain the problem though, it's just weird int  to ptr cases. Kinda seems like clang links to a different runtime during the configure tests than what's used for postgres...

What I'm thinking is that that somehow prevents the "volatile" from
having any effect.  On my laptop (recent Apple clang), the function call
certainly does seem to get optimized away with the test-as-committed...

Oh!  It seems to get optimized away with my "volatile" version too.

I think the real issue, or part of it, is that you need to assign the
result to a global variable, not a local one, so that the compiler
doesn't decide it can forget the whole thing.  And maybe store the
bool result somewhere, too.

Marking the result and bool-result variables as volatile might
be an OK substitute for making them global.  But the global way
is what we've done in older configure test programs.

			regards, tom lane




view thread (16+ messages)  latest in thread

Message-ID: <23537.1513475312@sss.pgh.pa.us>
Permalink:  ../23537.1513475312@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23537.1513475312@sss.pgh.pa.us

 · 

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: 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: <23537.1513475312@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> <99F06D02-BB7E-40F1-93BE-7113713F1AC0@anarazel.de> <23537.1513475312@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