gcc/libgomp
Chung-Lin Tang 1ac7a8c9e4 fortran: OpenMP/OpenACC array mapping alignment fix (PR90030)
Fix issue with the Fortran front-end when mapping arrays: when creating the
data MEM_REF for the map clause, there was a convention of casting the
referencing pointer to 'c_char *' by
fold_convert (build_pointer_type (char_type_node), ptr).

This causes the alignment passed to the libgomp runtime for array data
hardwared to '1', and causes alignment errors on the offload target.

This patch fixes this by removing the char_type_node pointer converts, and
adding gcc_asserts to ensure POINTER_TYPE_P (TREE_TYPE (ptr)).

	PR fortran/90030

gcc/fortran/ChangeLog:

	* trans-openmp.c (gfc_omp_finish_clause): Remove fold_convert to pointer
	to char_type_node, add gcc_assert of POINTER_TYPE_P.
	(gfc_trans_omp_array_section): Likewise.
	(gfc_trans_omp_clauses): Likewise.

gcc/testsuite/ChangeLog:

	* gfortran.dg/goacc/finalize-1.f: Adjust scan test.
	* gfortran.dg/gomp/affinity-clause-1.f90: Likewise.
	* gfortran.dg/gomp/affinity-clause-5.f90: Likewise.
	* gfortran.dg/gomp/defaultmap-4.f90: Likewise.
	* gfortran.dg/gomp/defaultmap-5.f90: Likewise.
	* gfortran.dg/gomp/defaultmap-6.f90: Likewise.
	* gfortran.dg/gomp/map-3.f90: Likewise.
	* gfortran.dg/gomp/pr78260-2.f90: Likewise.
	* gfortran.dg/gomp/pr78260-3.f90: Likewise.

libgomp/ChangeLog:

	* testsuite/libgomp.oacc-fortran/pr90030.f90: New test.
	* testsuite/libgomp.fortran/pr90030.f90: New test.
2021-12-02 18:27:16 +08:00
..
config openmp: Add support for thread_limit clause on target 2021-11-15 13:20:53 +01:00
plugin
testsuite fortran: OpenMP/OpenACC array mapping alignment fix (PR90030) 2021-12-02 18:27:16 +08:00
.gitattributes
acc_prof.h
acinclude.m4
aclocal.m4
affinity-fmt.c openmp: Avoid PLT relocations for omp_* symbols in libgomp 2021-10-01 10:42:07 +02:00
affinity.c
alloc.c Fix typo. 2021-11-18 10:26:55 -05:00
allocator.c libgomp: Add tests for omp_atv_serialized and deprecate omp_atv_sequential. 2021-10-11 04:34:51 -07:00
atomic.c
barrier.c
ChangeLog Daily bump. 2021-12-01 00:17:04 +00:00
ChangeLog.graphite
config.h.in
configure libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] 2021-09-28 15:15:47 +02:00
configure.ac libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] 2021-09-28 15:15:47 +02:00
configure.tgt
critical.c
env.c Restore 'GOMP_OPENACC_DIM' environment variable parsing 2021-11-09 16:51:57 +01:00
error.c
fortran.c openmp: Add omp_set_num_teams, omp_get_max_teams, omp_[gs]et_teams_thread_limit 2021-10-11 12:20:22 +02:00
hashtab.h
icv-device.c openmp: Avoid PLT relocations for omp_* symbols in libgomp 2021-10-01 10:42:07 +02:00
icv.c openmp: Add omp_set_num_teams, omp_get_max_teams, omp_[gs]et_teams_thread_limit 2021-10-11 12:20:22 +02:00
iter_ull.c
iter.c
libgomp_f.h.in
libgomp_g.h openmp: Honor OpenMP 5.1 num_teams lower bound 2021-11-12 12:41:22 +01:00
libgomp-plugin.c
libgomp-plugin.h
libgomp.h libgomp: Ensure that either gomp_team is properly aligned [PR102838] 2021-11-18 09:10:40 +01:00
libgomp.map openmp: Honor OpenMP 5.1 num_teams lower bound 2021-11-12 12:41:22 +01:00
libgomp.spec.in
libgomp.texi libgomp: Mark thread_limit clause to target construct as implemented 2021-11-16 10:21:56 +01:00
lock.c
loop_ull.c
loop.c
Makefile.am
Makefile.in
oacc-async.c
oacc-cuda.c
oacc-host.c
oacc-init.c
oacc-int.h
oacc-mem.c
oacc-parallel.c
oacc-plugin.c Remove unreachable returns 2021-11-29 11:17:22 +01:00
oacc-plugin.h
oacc-profiling.c
oacc-target.c
omp_lib.f90.in libgomp: Add tests for omp_atv_serialized and deprecate omp_atv_sequential. 2021-10-11 04:34:51 -07:00
omp_lib.h.in openmp: Add omp_set_num_teams, omp_get_max_teams, omp_[gs]et_teams_thread_limit 2021-10-11 12:20:22 +02:00
omp.h.in libgomp: Add tests for omp_atv_serialized and deprecate omp_atv_sequential. 2021-10-11 04:34:51 -07:00
openacc_lib.h
openacc.f90
openacc.h
ordered.c
parallel.c
priority_queue.c
priority_queue.h
scope.c
sections.c
secure_getenv.h
single.c
splay-tree.c
splay-tree.h
target.c openmp: Add support for thread_limit clause on target 2021-11-15 13:20:53 +01:00
task.c openmp: Add support for thread_limit clause on target 2021-11-15 13:20:53 +01:00
taskloop.c
team.c libgomp: Ensure that either gomp_team is properly aligned [PR102838] 2021-11-18 09:10:40 +01:00
teams.c libgomp: Use TLS storage for omp_get_num_teams()/omp_get_team_num() values 2021-11-11 13:57:31 +01:00
work.c libgomp: Ensure that either gomp_team is properly aligned [PR102838] 2021-11-18 09:10:40 +01:00