pgsql: Mark x86's memory barrier inline assembly as clobbering the cpu

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Mark x86's memory barrier inline assembly as clobbering the cpu
Date: 2014-09-19 15:16:25
Message-ID: E1XUzv7-0003IN-Rc@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Mark x86's memory barrier inline assembly as clobbering the cpu flags.

x86's memory barrier assembly was marked as clobbering "memory" but
not "cc" even though 'addl' sets various flags. As it turns out gcc on
x86 implicitly assumes "cc" on every inline assembler statement, so
it's not a bug. But as that's poorly documented and might get copied
to architectures or compilers where that's not the case, it seems
better to be precise.

Discussion: 20140919100016(dot)GH4277(at)alap3(dot)anarazel(dot)de

To keep the code common, backpatch to 9.2 where explicit memory
barriers were introduced.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/8557a9f75fa0ac15892b21cb57fa19cce415142b

Modified Files
--------------
src/include/storage/barrier.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2014-09-19 15:41:31 pgsql: Row-Level Security Policies (RLS)
Previous Message Andres Freund 2014-09-19 15:16:13 pgsql: Mark x86's memory barrier inline assembly as clobbering the cpu