On 11/06/2014 05:57 PM, Andrew MacLeod wrote: > It looks like java is deciding whether or not GCC can inline atomic > operations or not, and if it can't, doesn't want the atomic > operations... which presumably means there is no dependency on > libatomic at runtime. > > A call to can_compare_and_swap_p(mode) is analogous to a compile time > version of folding atomic_always_lock_free(mode) to a constant... > Frankly that seems like a reasonable question for some front end to > ask... and elect not to emit atomic calls if so desired. (which is what > java is doing I think) > > whether it still needs to do that is a question for some java person.
I did it because some targets did not have library support for some builtins, so a compile would fail with a (to a Java programmer) baffling error message. The Java operations certainly should use the generic builtins. Andrew.