git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] xdiff: optimize xdl_hash_record_verbatim

From
Alexander Monakov <amonakov@ispras.ru>
Date
Jul 28, 2025, 20:57 UTC
Message-ID
<3405f274-cef1-b361-7424-840dc55b48a1@ispras.ru>
In-Reply-To
<xmqq5xfcujjn.fsf@gitster.g>
On Mon, 28 Jul 2025, Junio C Hamano wrote:
Show 21 quoted lines
> 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))
>           |                             ^

Sorry, wasn't aware that Clang would warn. The solution is to spell 'asm' with double underscores, __asm__. I'll make this change if I post a v2.

Thanks. Alexander

Previous: Junio C HamanoNext: Phillip Wood
Message 4 of 22 in “optimize string hashing in xdiff”
  1. 0/2 optimize string hashing in xdiffAlexander Monakov, Jul 28, 2025
  2. 2/2 xdiff: optimize xdl_hash_record_verbatimAlexander Monakov, Jul 28, 2025
  3. Junio C HamanoJul 28, 2025
  4. Alexander MonakovJul 28, 2025
  5. Phillip WoodAug 4, 2025
  6. Alexander MonakovAug 4, 2025
  7. Phillip WoodAug 11, 2025
  8. Alexander MonakovAug 11, 2025
  9. Alexander MonakovAug 12, 2025
  10. Junio C HamanoAug 20, 2025
  11. Alexander MonakovSep 8, 2025
  12. Junio C HamanoSep 8, 2025
  13. Phillip WoodAug 13, 2025
  14. 1/2 xdiff: refactor xdl_hash_record()Alexander Monakov, Jul 28, 2025
  15. Junio C HamanoJul 28, 2025
  16. Eli SchwartzJul 28, 2025
  17. Junio C HamanoJul 28, 2025
  18. Alexander MonakovJul 28, 2025
  19. Junio C HamanoAug 14, 2025
  20. Junio C HamanoAug 28, 2025
  21. Jacob KellerAug 29, 2025
  22. Elijah NewrenAug 29, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.