Re: pgsql: Convert contrib/seg's bool-returning SQL functions to V1 call co - Mailing list pgsql-committers

From Noah Misch
Subject Re: pgsql: Convert contrib/seg's bool-returning SQL functions to V1 call co
Date
Msg-id 20160427023828.GA2150695@tornado.leadboat.com
Whole thread Raw
In response to pgsql: Convert contrib/seg's bool-returning SQL functions to V1 call co  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re: pgsql: Convert contrib/seg's bool-returning SQL functions to V1 call co  (Andres Freund <andres@anarazel.de>)
Re: pgsql: Convert contrib/seg's bool-returning SQL functions to V1 call co  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
On Fri, Apr 22, 2016 at 03:54:48PM +0000, Tom Lane wrote:
> Convert contrib/seg's bool-returning SQL functions to V1 call convention.
>
> It appears that we can no longer get away with using V0 call convention
> for bool-returning functions in newer versions of MSVC.  The compiler
> seems to generate code that doesn't clear the higher-order bits of the
> result register, causing the bool result Datum to often read as "true"
> when "false" was intended.  This is not very surprising, since the
> function thinks it's returning a bool-width result but fmgr_oldstyle
> assumes that V0 functions return "char *"; what's surprising is that
> that hack worked for so long on so many platforms.

Does this warrant a change to the "Section 2" comment of postgres.h,
explaining that its precautions no longer suffice everywhere?


pgsql-committers by date:

Previous
From: Noah Misch
Date:
Subject: pgsql: Impose a full barrier in generic-xlc.h atomics functions.
Next
From: Andres Freund
Date:
Subject: Re: Re: pgsql: Convert contrib/seg's bool-returning SQL functions to V1 call co