jfbastien wrote:

> One observation on the example: it's a `fetch_add`, and with the fix I pushed 
> it converges (old 5, new 6) and writes the padding back canonical instead of 
> looping; GCC-14 appears to do the same. `compare_exchange` on that same 
> dirtied object does fail in both, since it's a single native `cmpxchg` over 
> the whole word. The object is out-of-contract either way, so happy to go with 
> whatever behavior you'd prefer to mandate here.
> 
> For the well-formed test I'll switch to your 
> store-`b`-then-store-`a`-then-atomics shape.

Yes I think this is the right outcome. If it's a single-instruction cmpxchg 
that gets emitted, there ain't much we can do.

@Bigcheese and @chandlerc might be able to provide more input, they both cared 
about this a lot when we were talking about padding bits in atomics.

https://github.com/llvm/llvm-project/pull/204815
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to