]> git.ipfire.org Git - thirdparty/postgresql.git/commit
In s_lock.h, use regular labels with %= instead of local labels.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 2 Feb 2026 16:13:38 +0000 (11:13 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 2 Feb 2026 16:13:38 +0000 (11:13 -0500)
commit0c9f46c4280e31a4f49200f5d2cde37727651869
treeb470fd8d6c38d62a46a7627f3e020e5ab22a32af
parenta9afa021e95f2b0ffaaf26f3a27e685f634f4ac9
In s_lock.h, use regular labels with %= instead of local labels.

Up to now we've used GNU-style local labels for branch targets
in s_lock.h's assembly blocks.  But there's an alternative style,
which I for one didn't know about till recently: use regular
assembler labels, and insert a per-asm-block number in them
using %= to ensure they are distinct across multiple TAS calls
within one source file.  gcc has had %= since gcc 2.0, and
I've verified that clang knows it too.

While the immediate motivation for changing this is that AIX's
assembler doesn't do local labels, it seems to me that this is a
superior solution anyway.  There is nothing mnemonic about "1:",
while a regular label can convey something useful, and at least
to me it feels less error-prone.  Therefore let's standardize on
this approach, also converting the one other usage in s_lock.h.

Discussion: https://postgr.es/m/399291.1769998688@sss.pgh.pa.us
src/include/storage/s_lock.h