Messages in this thread | | | Date | Fri, 8 Sep 2000 12:05:06 +0200 | From | Jamie Lokier <> | Subject | Re: spin_lock forgets to clobber memory and other smp fixes [was |
| |
kuznet@ms2.inr.ac.ru wrote: > > Well, now GCC does CSE across "asm" and will eliminate memory loads, > > even though it may not move them! I suspect it always did CSE across > > "asm" and we just never got hit by the bug. > > dummy_lock trick is equivalent to "memory" clobber.
For GCC 2.7.2 yes. For current compilers with -fstrict-aliasing, no: the dummy_lock type doesn't alias with some other memory accesses.
Longer term the compiler may well take into account the array size.
Of course we still need the dummy_lock trick anyway.
-- Jamie - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
| |