__sync_synchronize() crashes when compiling OpenMP to a GPU target


I get this error when compiling a code that contains “__sync_synchronize()”

fatal error: error in backend: Cannot select: 0x85ddfb0: ch = AtomicFence 0x85fd8d8, 0x85c7890, 0x85dd9e8 [ORD=4] [ID=27]example.c:378:13
0x85c7890: i64 = Constant<7> [ID=5]example.c:378:13
0x85dd9e8: i64 = Constant<1> [ID=6]example.c:378:13

I believe it should be equivalent to “__threadfence()” in CUDA and “call void @llvm.nvvm.membar.gl()” in LLVM-IR. However, I am not sure where to locate the fix. Any ideas ?

Bests regards,