gcc/libgomp
Tom de Vries 4ac7b66958 [libgomp, nvptx] Add __sync_compare_and_swap_16
As reported here
( https://gcc.gnu.org/pipermail/gcc-patches/2020-September/553070.html  ),
when running test-case libgomp.c-c++-common/reduction-16.c for powerpc host
with nvptx accelerator, we run into:
...
unresolved symbol __sync_val_compare_and_swap_16
...

I can reproduce the problem on x86_64 with a trigger patch that:
- initializes ix86_isa_flags2 to TARGET_ISA2_CX16
- enables define_expand "atomic_load<mode>" in gcc/config/i386/sync.md
  for TImode

The problem is that omp-expand.c generates atomic builtin calls based on
checks whether those are supported on the host, which forces the target to
support these, even though those checks fail for the accelerator target.

Fix this by:
- adding a __sync_val_compare_and_swap_16 in libgomp for nvptx,
  which falls back onto libatomic's __atomic_compare_and_swap_16
- adding -foffload=-latomic in the test-case

Tested libgomp on x86_64-linux with nvptx accelerator.

Tested libgomp with trigger patch on x86_64-linux with nvptx accelerator.

libgomp/ChangeLog:

	* config/nvptx/atomic.c: New file.  Add
	__sync_val_compare_and_swap_16.
	* testsuite/libgomp.c-c++-common/reduction-16.c: Add -latomic for
	target offload_target_nvptx.
2020-09-14 08:28:56 +02:00
..
config [libgomp, nvptx] Add __sync_compare_and_swap_16 2020-09-14 08:28:56 +02:00
plugin libgomp: adjust nvptx_free callback context checking 2020-08-20 07:18:51 -07:00
testsuite [libgomp, nvptx] Add __sync_compare_and_swap_16 2020-09-14 08:28:56 +02:00
.gitattributes libgomp: Fixes + cleanup for OpenACC's Fortran module + openacc_lib.h 2020-02-19 09:13:44 +01:00
acc_prof.h Update copyright years. 2020-01-01 12:51:42 +01:00
acinclude.m4 re PR other/79543 (Inappropriate "ld --version" checking) 2019-09-03 14:10:26 +00:00
aclocal.m4 Removal of HSA offloading from gcc and libgomp 2020-08-03 18:13:00 +02:00
affinity-fmt.c re PR libgomp/93219 (unused return value in affinity-fmt.c) 2020-01-10 21:42:00 +01:00
affinity.c Update copyright years. 2020-01-01 12:51:42 +01:00
alloc.c Update copyright years. 2020-01-01 12:51:42 +01:00
allocator.c libgomp: Add Fortran routine support for allocators 2020-07-15 08:33:20 +02:00
atomic.c Update copyright years. 2020-01-01 12:51:42 +01:00
barrier.c Update copyright years. 2020-01-01 12:51:42 +01:00
ChangeLog Daily bump. 2020-09-09 00:16:29 +00:00
ChangeLog.graphite Add forgotten ChangeLog entries. 2010-03-08 17:49:42 +00:00
config.h.in Removal of HSA offloading from gcc and libgomp 2020-08-03 18:13:00 +02:00
configure Removal of HSA offloading from gcc and libgomp 2020-08-03 18:13:00 +02:00
configure.ac libomp: Add omp_depend_kind to omp_lib.{f90,h} 2020-07-23 15:02:15 +02:00
configure.tgt aix: Add GCC64 configuration and FAT target libraries. 2020-06-21 14:14:46 -04:00
critical.c Update copyright years. 2020-01-01 12:51:42 +01:00
env.c openmp: Add basic library allocator support. 2020-05-19 10:11:01 +02:00
error.c Update copyright years. 2020-01-01 12:51:42 +01:00
fortran.c libgomp: Add Fortran routine support for allocators 2020-07-15 08:33:20 +02:00
hashtab.h Update copyright years. 2020-01-01 12:51:42 +01:00
icv-device.c Update copyright years. 2020-01-01 12:51:42 +01:00
icv.c libgomp: Add Fortran routine support for allocators 2020-07-15 08:33:20 +02:00
iter_ull.c Update copyright years. 2020-01-01 12:51:42 +01:00
iter.c Update copyright years. 2020-01-01 12:51:42 +01:00
libgomp_f.h.in libomp: Add omp_depend_kind to omp_lib.{f90,h} 2020-07-23 15:02:15 +02:00
libgomp_g.h Update copyright years. 2020-01-01 12:51:42 +01:00
libgomp-plugin.c Update copyright years. 2020-01-01 12:51:42 +01:00
libgomp-plugin.h OpenACC 'acc_get_property' cleanup 2020-01-10 23:24:36 +01:00
libgomp.h openacc: Deep copy attach/detach should not affect reference counts 2020-07-27 09:16:57 -07:00
libgomp.map libgomp: Add Fortran routine support for allocators 2020-07-15 08:33:20 +02:00
libgomp.spec.in Generally link to libgomp for -ftree-parallelize-loops=*. 2013-11-07 16:07:34 +01:00
libgomp.texi libgomp: Fix hang when profiling OpenACC programs with CUDA 9.0 nvprof 2020-07-14 10:31:35 -07:00
lock.c Update copyright years. 2020-01-01 12:51:42 +01:00
loop_ull.c Update copyright years. 2020-01-01 12:51:42 +01:00
loop.c Update copyright years. 2020-01-01 12:51:42 +01:00
Makefile.am build: Use -include instead of conditional include. 2020-06-22 21:31:48 +00:00
Makefile.in Removal of HSA offloading from gcc and libgomp 2020-08-03 18:13:00 +02:00
oacc-async.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-cuda.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-host.c OpenACC 'acc_get_property' cleanup 2020-01-10 23:24:36 +01:00
oacc-init.c libgomp: Fix hang when profiling OpenACC programs with CUDA 9.0 nvprof 2020-07-14 10:31:35 -07:00
oacc-int.h Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-mem.c openacc: Deep copy attach/detach should not affect reference counts 2020-07-27 09:16:57 -07:00
oacc-parallel.c OpenACC – support "if" + "if_present" clauses with "host_data" 2020-01-10 16:08:41 +01:00
oacc-plugin.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-plugin.h Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-profiling.c Update copyright years. 2020-01-01 12:51:42 +01:00
oacc-target.c GCN libgomp port 2019-11-13 12:38:04 +00:00
omp_lib.f90.in libomp: Add omp_depend_kind to omp_lib.{f90,h} 2020-07-23 15:02:15 +02:00
omp_lib.h.in libomp: Add omp_depend_kind to omp_lib.{f90,h} 2020-07-23 15:02:15 +02:00
omp.h.in openmp: Change omp_atv_default value and rename omp_atv_sequential to omp_atv_serialized. 2020-07-09 11:29:30 +02:00
openacc_lib.h [OpenACC] Set 'acc_device_current = -1' 2020-04-29 09:54:37 +02:00
openacc.f90 [OpenACC] Set 'acc_device_current = -1' 2020-04-29 09:54:37 +02:00
openacc.h [OpenACC] Set 'acc_device_current = -1' 2020-04-29 09:54:37 +02:00
ordered.c Update copyright years. 2020-01-01 12:51:42 +01:00
parallel.c Update copyright years. 2020-01-01 12:51:42 +01:00
priority_queue.c Update copyright years. 2020-01-01 12:51:42 +01:00
priority_queue.h Update copyright years. 2020-01-01 12:51:42 +01:00
sections.c Update copyright years. 2020-01-01 12:51:42 +01:00
secure_getenv.h Update copyright years. 2020-01-01 12:51:42 +01:00
single.c Update copyright years. 2020-01-01 12:51:42 +01:00
splay-tree.c Update copyright years. 2020-01-01 12:51:42 +01:00
splay-tree.h Update copyright years. 2020-01-01 12:51:42 +01:00
target.c openacc: Deep copy attach/detach should not affect reference counts 2020-07-27 09:16:57 -07:00
task.c Update copyright years. 2020-01-01 12:51:42 +01:00
taskloop.c Update copyright years. 2020-01-01 12:51:42 +01:00
team.c openmp: Add basic library allocator support. 2020-05-19 10:11:01 +02:00
teams.c Update copyright years. 2020-01-01 12:51:42 +01:00
work.c Update copyright years. 2020-01-01 12:51:42 +01:00