Re: [PATCH 2/2] xdiff: optimize xdl_hash_record_verbatim
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 28, 2025, 20:50 UTC
- Message-ID
- <xmqq5xfcujjn.fsf@gitster.g>
- In-Reply-To
- <20250728190520.10962-3-amonakov@ispras.ru>
Alexander Monakov <amonakov@ispras.ru> writes:
Show 9 quoted lines
> +/*
> + * Compiler reassociation barrier: pretend to modify X and Y to disallow
> + * changing evaluation order with respect to following uses of X and Y.
> + */
> +#ifdef __GNUC__
> +#define REASSOC_FENCE(x, y) asm("" : "+r"(x), "+r"(y))
> +#else
> +#define REASSOC_FENCE(x, y)
> +#endifWith gcc we can build, but with clang, we unfortunately get this:
$ make CC=clang DEVELOPER=YesPlease
xdiff/xutils.c:330:4: error: extension used [-Werror,-Wlanguage-extension-token]
330 | REASSOC_FENCE(c0, ha);
| ^
xdiff/xutils.c:302:29: note: expanded from macro 'REASSOC_FENCE'
302 | #define REASSOC_FENCE(x, y) asm("" : "+r"(x), "+r"(y))
| ^