Re: git: 9d87c1aac4a8 - main - libc: Add missing kill_dependency macro
Date: Sat, 20 Jun 2026 14:31:05 UTC
On Sat, Jun 20, 2026 at 05:29:52PM +0330, Faraz Vahedi wrote: > Hey, > > I took another look and dug a bit deeper to make sure whether we > should adopt GCC’s form here, and I still think we should stick with > the current one. > > First, although I still need to investigate further, I doubt it adds any > optimisation benefits, nor would omitting it incur a penalty. No, it is not about benefits, my note is that the gcc implementation might disable some optimizations that are important for gcc case. > > More importantly, what we currently have fully conforms to the > §7.17.3.1 and is therefore in its most portable form. There is also > ongoing work (e.g. N3607) to retire `memory_order_consume` and > obsolete `kill_dependency`, with the proposed wording being that > the macro “has no other effect than its result”, which is essentially > just `(y)`, right? So presumably Clang's own `<stdatomic.h>` uses > `(y)` for the same sort of reasons. Yes, this is what I referred to as 'no clear semantic' in my initial mail. What consitues a dependency chain, is up to the compiler. If clang does not have the concept (?) internalized, then the current implementation is fine. But if gcc gives some subtle meaning to consume, its implementation of assigning to the temporal might have some reasons. > > However, I’m happy to discuss it further, and please do correct me > if you have data suggesting otherwise. In the meantime, I’ll do a bit > more research and will keep you posted if I find anything else. > > Cheers, > Faraz >