Date: Sat, 20 Jun 2026 17:31:05 +0300 From: Konstantin Belousov <kib@freebsd.org> To: Faraz Vahedi <kfv@kfv.io> Cc: Warner Losh <imp@freebsd.org>, alc@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9d87c1aac4a8 - main - libc: Add missing kill_dependency macro Message-ID: <ajakKWNfv2dwegqj@kib.kiev.ua> In-Reply-To: <33E8BFC4-EA46-41A7-B54F-1AADD3C19D9E@kfv.io> References: <6a35ddd4.24ba1.2ad9343d@gitrepo.freebsd.org> <ajZxmJoxyjjx0TSO@kib.kiev.ua> <9A21692F-0B53-4303-85A8-57784BFAF8DE@kfv.io> <33E8BFC4-EA46-41A7-B54F-1AADD3C19D9E@kfv.io>
index | next in thread | previous in thread | raw e-mail
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 >home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ajakKWNfv2dwegqj>
