git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: git@vger.kernel.org,  Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH 2/2] xdiff: optimize xdl_hash_record_verbatim
Date: Mon, 28 Jul 2025 13:50:20 -0700	[thread overview]
Message-ID: <xmqq5xfcujjn.fsf@gitster.g> (raw)
In-Reply-To: <20250728190520.10962-3-amonakov@ispras.ru> (Alexander Monakov's message of "Mon, 28 Jul 2025 22:05:20 +0300")

Alexander Monakov <amonakov@ispras.ru> writes:

> +/*
> + * 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)
> +#endif

With 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))
          |                             ^


  reply	other threads:[~2025-07-28 20:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-28 19:05 [PATCH 0/2] optimize string hashing in xdiff Alexander Monakov
2025-07-28 19:05 ` [PATCH 1/2] xdiff: refactor xdl_hash_record() Alexander Monakov
2025-07-28 19:05 ` [PATCH 2/2] xdiff: optimize xdl_hash_record_verbatim Alexander Monakov
2025-07-28 20:50   ` Junio C Hamano [this message]
2025-07-28 20:57     ` Alexander Monakov
2025-08-04 13:49   ` Phillip Wood
2025-08-04 14:39     ` Alexander Monakov
2025-08-11 13:13       ` Phillip Wood
2025-08-11 14:14         ` Alexander Monakov
2025-08-12 17:56           ` Alexander Monakov
2025-08-20 21:34             ` Junio C Hamano
2025-09-08 19:06               ` Alexander Monakov
2025-09-08 21:04                 ` Junio C Hamano
2025-08-13 13:10           ` Phillip Wood
2025-07-28 19:32 ` [PATCH 0/2] optimize string hashing in xdiff Junio C Hamano
2025-07-28 19:56   ` Eli Schwartz
2025-07-28 20:54     ` Junio C Hamano
2025-07-28 20:25   ` Alexander Monakov
2025-08-14 15:01     ` Junio C Hamano
2025-08-28 23:40     ` Junio C Hamano
2025-08-29  1:13       ` Jacob Keller
2025-08-29  3:09       ` Elijah Newren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq5xfcujjn.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=amonakov@ispras.ru \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).