On Mon, Jun 17, 2019 at 05:16:18PM +0900, 김규래 wrote: > Currently, gcc (specifically libgomp) contains some amount of lock-free code. > Does gcc test for the correctness of the lock-free sections?
No. Well, there is thread sanitizer, -fsanitize=thread, but it isn't able to understand the futex etc. operations used in the Linux code in libgomp, so in order to test the library one needs to use --disable-linux-futex -fsanitize=thread build. > Or is it tested just as any other code? Yes, plus of course when designing the code one needs to think about the consequences of using lock-free code. Some platforms (e.g. aarch64 or ppc64le) have very sensitive hw to bugs in the C/C++ memory model usage, so some bugs only show up on those platforms and not e.g. on x86_64. Jakub