]> granicus.if.org Git - postgresql/commit
Mark x86's memory barrier inline assembly as clobbering the cpu flags.
authorAndres Freund <andres@anarazel.de>
Fri, 19 Sep 2014 15:04:00 +0000 (17:04 +0200)
committerAndres Freund <andres@anarazel.de>
Fri, 19 Sep 2014 15:13:07 +0000 (17:13 +0200)
commitf9edfc1aa9ea4f0bae87eabcac261d82370c7de4
tree91f26524206b7dfc588fc5d54b09e2806e5564fd
parent78b488d2e3d884e58a670f052400573b33824e04
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.GH4277@alap3.anarazel.de

To keep the code common, backpatch to 9.2 where explicit memory
barriers were introduced.
src/include/storage/barrier.h