Re: [WIP 0/3] Memory model and atomic API in Rust

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Mar 24, 2024, at 11:22 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> I don't know if this is what you meant by "in a weak memory model, the 
> escape can ‘time travel'".  Regardless, it seems very clear that any 
> compiler which swaps L1 and L2 in f() has a genuine bug.

Yes, that’s what I meant.  Clang thinks it’s valid to swap L1 and L2.  Though, for it to actually happen, they would have to be in a loop, since the problematic optimization is “loop-invariant code motion".  Here’s a modified version of your f() that shows the optimization in action:

https://godbolt.org/z/bdaTjjvMs

Anyway, my point is just that using LKMM doesn’t save you from the bug.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux