Commit Graph

1182 Commits

Author SHA1 Message Date
GCC Administrator
9bb403dca6 Daily bump. 2020-07-24 00:16:20 +00:00
Julian Brown
25bce75c77 openacc: Remove unnecessary detach finalization
The call to gomp_detach_pointer in gomp_unmap_vars_internal does not
need to force finalization, and doing so may mask mismatched pointer
attachments/detachments. This patch removes the forcing.

2020-07-16  Julian Brown  <julian@codesourcery.com>
	    Thomas Schwinge  <thomas@codesourcery.com>

libgomp/
	* target.c (gomp_unmap_vars_internal): Remove unnecessary forcing of
	finalization for detach operation.
	* testsuite/libgomp.oacc-c-c++-common/structured-detach-underflow.c:
	New test.

Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
2020-07-23 12:50:07 -07:00
Tobias Burnus
2631d95ae2 libomp: Add omp_depend_kind to omp_lib.{f90,h}
gcc/fortran/ChangeLog:

	* intrinsic.texi (OMP_LIB_KINDS): Add omp_depend_kind.

libgomp/ChangeLog:

	* configure.ac: Add OMP_DEPEND_KIND and OMP_INT128_SIZE.
	* libgomp_f.h.in (omp_check_defines): Check whether
	sizeof of determined Fortran kind and C typedef match.
	* omp_lib.f90.in: Add omp_depened_kind.
	* omp_lib.h.in: Likewise; fix omp_alloctrait_key_kind.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
2020-07-23 15:02:15 +02:00
GCC Administrator
3ea9abca71 Daily bump. 2020-07-23 00:16:28 +00:00
Tobias Burnus
ade6e7204c critical-hint-*.{c,f90}: Move from gcc/testsuite to libgomp/testsuite
libgomp/ChangeLog:

	* testsuite/libgomp.c-c++-common/critical-hint-1.c: New; moved from
	gcc/testsuite/c-c++-common/gomp/.
	* testsuite/libgomp.c-c++-common/critical-hint-2.c: Likewise.
	* testsuite/libgomp.fortran/critical-hint-1.f90: New; moved
	from gcc/testsuite/gfortran.dg/gomp/.
	* testsuite/libgomp.fortran/critical-hint-2.f90: Likewise.

gcc/testsuite/ChangeLog:

	* c-c++-common/gomp/critical-hint-1.c: Moved to libgomp/.
	* c-c++-common/gomp/critical-hint-2.c: Moved to libgomp/.
	* gfortran.dg/gomp/critical-hint-1.f90: Moved to libgomp/.
	* gfortran.dg/gomp/critical-hint-2.f90: Moved to libgomp/.
2020-07-22 12:14:22 +02:00
Tobias Burnus
c7c24828cf OpenMP: Fixes for omp critical + hint
gcc/c-family/ChangeLog:

	* c-omp.c (c_finish_omp_critical): Check for no name but
	nonzero hint provided.

gcc/c/ChangeLog:

	* c-parser.c (c_parser_omp_clause_hint): Require nonnegative hint clause.
	(c_parser_omp_critical): Permit hint(0) clause without named critical.
	(c_parser_omp_construct): Don't assert if error_mark_node is returned.

gcc/cp/ChangeLog:

	* parser.c (cp_parser_omp_clause_hint): Require nonnegative hint.
	(cp_parser_omp_critical): Permit hint(0) clause without named critical.
	* pt.c (tsubst_expr): Re-check the latter for templates.

gcc/fortran/ChangeLog:

	* openmp.c (gfc_match_omp_critical): Fix handling hints; permit
	hint clause without named critical.
	(resolve_omp_clauses): Require nonnegative constant integer
	for the hint clause.
	(gfc_resolve_omp_directive): Check for no name but
	nonzero value for hint clause.
	* parse.c (parse_omp_structured_block): Fix same-name check
	for critical.
	* trans-openmp.c (gfc_trans_omp_critical): Handle hint clause properly.

libgomp/ChangeLog:

	* omp_lib.f90.in: Add omp_sync_hint_* and omp_sync_hint_kind.
	* omp_lib.h.in: Likewise.

gcc/testsuite/ChangeLog:

	* g++.dg/gomp/critical-3.C: Add nameless critical with hint testcase.
	* c-c++-common/gomp/critical-hint-1.c: New test.
	* c-c++-common/gomp/critical-hint-2.c: New test.
	* gfortran.dg/gomp/critical-hint-1.f90: New test.
	* gfortran.dg/gomp/critical-hint-2.f90: New test.
2020-07-22 09:57:15 +02:00
GCC Administrator
aeb34e1514 Daily bump. 2020-07-19 00:16:22 +00:00
H.J. Lu
7aa22a8f1a x86-64: Define ASM_OUTPUT_ALIGNED_DECL_LOCAL
Define ASM_OUTPUT_ALIGNED_DECL_LOCAL for large local common symbol.

gcc/

	PR target/95620
	* config/i386/x86-64.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): New.

libgomp/

	PR target/95620
	* testsuite/libgomp.c/pr95620.c: New test.
2020-07-18 08:51:54 -07:00
GCC Administrator
96686b3fcd Daily bump. 2020-07-17 00:16:27 +00:00
Julian Brown
39dda00208 openacc: Fix standalone attach for Fortran assumed-shape array pointers
This patch makes it so that an "attach" operation for a Fortran pointer
with an array descriptor copies that array descriptor to the target,
and similarly that detach operations release the array descriptor.

2020-07-16  Julian Brown  <julian@codesourcery.com>
	    Thomas Schwinge  <thomas@codesourcery.com>

gcc/fortran/
	* trans-openmp.c (gfc_trans_omp_clauses): Rework OpenACC
	attach/detach handling for arrays with descriptors.

gcc/testsuite/
	* gfortran.dg/goacc/attach-descriptor.f90: New test.

libgomp/
	* testsuite/libgomp.oacc-fortran/attach-descriptor-1.f90: New test.
	* testsuite/libgomp.oacc-fortran/attach-descriptor-2.f90: New test.

Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
2020-07-16 14:12:53 -07:00
GCC Administrator
fe8185b509 Daily bump. 2020-07-16 00:16:34 +00:00
Tobias Burnus
51542d9254 libgomp.fortran/alloc-1.F90: Fix testcase for 32bit size_t
libgomp/ChangeLog:

	* testsuite/libgomp.fortran/alloc-1.F90: Use c_size_t to
	avoid conversion on 32bit systems from 32bit to 64bit due
	to -fdefault-integer-8.
2020-07-15 17:23:04 +02:00
Tobias Burnus
e0685fadb6 libgomp.fortran/struct-elem-map-1.f90: Add char kind=4 tests
As the Fortran PR 95837 has been fixed, the test could be be added.

libgomp/ChangeLog:

	* testsuite/libgomp.fortran/struct-elem-map-1.f90: Remove unused
	variables; add character(kind=4) tests; update TODO comment.
2020-07-15 12:34:03 +02:00
Tobias Burnus
fff15bad1a libgomp: Add Fortran routine support for allocators
libgomp/ChangeLog:

	* allocator.c: Add ialias for omp_init_allocator and
	omp_destroy_allocator.
	* configure.ac: Set INTPTR_T_KIND.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* fortran.c (omp_init_allocator_, omp_destroy_allocator_,
	omp_set_default_allocator_, omp_get_default_allocator_): New
	functions and ialias_redirect.
	* icv.c: Add ialias for omp_set_default_allocator and
	omp_get_default_allocator.
	* libgomp.map (OMP_5.0.1): Add omp_init_allocator_,
	omp_destroy_allocator_, omp_set_default_allocator_ and
	omp_get_default_allocator_.
	* omp_lib.f90.in: Add allocator traits parameters, declare
	allocator routines and add related kind parameters.
	* omp_lib.h.in: Likewise.
	* testsuite/libgomp.c-c++-common/alloc-2.c: Fix sizeof.
	* testsuite/libgomp.fortran/alloc-1.F90: New test.
	* testsuite/libgomp.fortran/alloc-2.F90: New test.
	* testsuite/libgomp.fortran/alloc-3.F: New test.
	* testsuite/libgomp.fortran/alloc-4.f90: New test.
	* testsuite/libgomp.fortran/alloc-5.f90: New test.
2020-07-15 08:33:20 +02:00
GCC Administrator
8ca07a3072 Daily bump. 2020-07-15 00:16:35 +00:00
Kwok Cheung Yeung
b52643ab90 libgomp: Fix hang when profiling OpenACC programs with CUDA 9.0 nvprof
The version of nvprof in CUDA 9.0 causes a hang when used to profile an
OpenACC program.  This is because it calls acc_get_device_type from
a callback called during device initialization, which then attempts
to acquire acc_device_lock while it is already taken, resulting in
deadlock.  This works around the issue by returning acc_device_none
from acc_get_device_type without attempting to acquire the lock when
initialization has not completed yet.

2020-07-14  Tom de Vries  <tom@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>
	    Thomas Schwinge  <thomas@codesourcery.com>
	    Kwok Cheung Yeung  <kcy@codesourcery.com>

	libgomp/
	* oacc-init.c (acc_init_state_lock, acc_init_state, acc_init_thread):
	New variable.
	(acc_init_1): Set acc_init_thread to pthread_self ().  Set
	acc_init_state to initializing at the start, and to initialized at the
	end.
	(self_initializing_p): New function.
	(acc_get_device_type): Return acc_device_none if called by thread that
	is currently executing acc_init_1.
	* libgomp.texi (acc_get_device_type): Update documentation.
	(Implementation Status and Implementation-Defined Behavior): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-init-2.c: New.
2020-07-14 10:31:35 -07:00
David Edelsohn
4f97bed9a7 aix: FAT libraries: test native compiler mode directly
The FAT libraries config fragments need to know which library is native
and which is a multilib to choose the correct multilib from which to
append the additional object file or shared object file.  Testing the
top-level archive is fragile because it will fail if rebuilding.  This
patch tests the compiler preprocessing macros for the 64 bit AIX specific
__64BIT__ to determine the native mode of the compiler in MULTILIBTOP.

2020-07-14  David Edelsohn  <dje.gcc@gmail.com>

libatomic/ChangeLog

	* config/t-aix: Set BITS from compiler cpp macro.

libgcc/ChangeLog

	* config/rs6000/t-slibgcc-aix: Set BITS from compiler cpp macro.

libgfortran/ChangeLog

	* config/t-aix: Set BITS from compiler cpp macro.

libgomp/ChangeLog

	* config/t-aix: Set BITS from compiler cpp macro.

libstdc++-v3/ChangeLog

	* config/os/aix/t-aix: Set BITS from compiler cpp macro.
2020-07-14 10:41:40 -04:00
Tobias Burnus
102502e32e [OpenMP, Fortran] Add structure/derived-type element mapping
gcc/fortran/ChangeLog:

	* openmp.c (gfc_match_omp_clauses): Match also derived-type
	component refs in OMP_CLAUSE_MAP.
	(resolve_omp_clauses): Resolve those.
	* trans-openmp.c (gfc_trans_omp_array_section, gfc_trans_omp_clauses):
	Handle OpenMP structure-element mapping.
	(gfc_trans_oacc_construct, gfc_trans_oacc_executable_directive,
	(gfc_trans_oacc_combined_directive, gfc_trans_oacc_declare): Update
	add openacc=true in gfc_trans_omp_clauses call.

gcc/testsuite/ChangeLog:

	* gfortran.dg/goacc/finalize-1.f: Update dump scan pattern.
	* gfortran.dg/gomp/map-1.f90: Update dg-error.
	* gfortran.dg/gomp/map-2.f90: New test.

libgomp/ChangeLog:

	* testsuite/libgomp.fortran/struct-elem-map-1.f90: New test.
2020-07-14 13:39:46 +02:00
Tobias Burnus
174e79bf73 [Fortran, OpenMP] Fix allocatable-components check (PR67311)
gcc/fortran/ChangeLog:

	PR fortran/67311
	* trans-openmp.c (gfc_has_alloc_comps): Return false also for
	pointers to arrays.

libgomp/ChangeLog:

	PR fortran/67311
	* testsuite/libgomp.fortran/target-map-1.f90: New test.
2020-07-14 12:55:53 +02:00
Jakub Jelinek
f418bd4b92 openmp: Adjust outer bounds of non-rect loops
In loops like:
  #pragma omp parallel for collapse(2)
  for (i = -4; i < 8; i++)
    for (j = 3 * i; j > 2 * i; j--)
for some outer loop iterations there are no inner loop iterations at all,
the condition is false.  In order to use Summæ Potestate to count number
of iterations or to transform the logical iteration number to actual
iterator values using quadratic non-equation root discovery the outer
iterator range needs to be adjusted, such that the inner loop has at least
one iteration for each of the outer loop iterator value in the reduced
range.  Sometimes this adjustment is done at the start of the range,
at other times at the end.

This patch implements it during the compile time number of loop computation
(if all expressions are compile time constants).

2020-07-14  Jakub Jelinek  <jakub@redhat.com>

	* omp-general.h (struct omp_for_data): Add adjn1 member.
	* omp-general.c (omp_extract_for_data): For non-rect loop, punt on
	count computing if n1, n2 or step are not INTEGER_CST earlier.
	Narrow the outer iterator range if needed so that non-rect loop
	has at least one iteration for each outer range iteration.  Compute
	adjn1.
	* omp-expand.c (expand_omp_for_init_vars): Use adjn1 if non-NULL
	instead of the outer loop's n1.

	* testsuite/libgomp.c/loop-21.c: New test.
2020-07-14 10:31:59 +02:00
GCC Administrator
ea69fcf9a0 Daily bump. 2020-07-14 00:16:30 +00:00
Julian Brown
b20097c65d openacc: Don't strip TO_PSET/POINTER for enter/exit data
OpenACC 2.6 specifies that the array descriptor (when present) must be
copied to the target before attaching pointers in Fortran. This patch
reverses the stripping of GOMP_MAP_TO_PSET and GOMP_MAP_POINTER that
was introduced by the "OpenACC reference count overhaul" patch.

2020-07-10  Julian Brown  <julian@codesourcery.com>
	    Thomas Schwinge  <thomas@codesourcery.com>

gcc/
	* gimplify.c (gimplify_scan_omp_clauses): Do not strip
	GOMP_MAP_TO_PSET/GOMP_MAP_POINTER for OpenACC enter/exit data
	directives (see also PR92929).

gcc/testsuite/
	* gfortran.dg/goacc/finalize-1.f: Update expected dump output.

libgomp/
	* testsuite/libgomp.oacc-fortran/dynamic-pointer-1.f90: New test.

Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
2020-07-13 03:21:20 -07:00
GCC Administrator
865362954f Daily bump. 2020-07-11 00:16:31 +00:00
Julian Brown
6f5b4b64d2 openacc: Adjust dynamic reference count semantics
This patch adjusts how dynamic reference counts work so that they match
the semantics of the source program more closely, instead of representing
"excess" reference counts beyond those that represent pointers in the
internal libgomp splay-tree data structure. This allows some corner
cases to be handled more gracefully.

2020-07-10  Julian Brown  <julian@codesourcery.com>
	    Thomas Schwinge  <thomas@codesourcery.com>

	libgomp/
	* libgomp.h (struct splay_tree_key_s): Change virtual_refcount to
	dynamic_refcount.
	(struct gomp_device_descr): Remove GOMP_MAP_VARS_OPENACC_ENTER_DATA.
	* oacc-mem.c (acc_map_data): Substitute virtual_refcount for
	dynamic_refcount.
	(acc_unmap_data): Update comment.
	(goacc_map_var_existing, goacc_enter_datum): Adjust for
	dynamic_refcount semantics.
	(goacc_exit_datum_1, goacc_exit_datum): Re-add some error checking.
	Adjust for dynamic_refcount semantics.
	(goacc_enter_data_internal): Implement "present" case of dynamic
	memory-map handling here.  Update "non-present" case for
	dynamic_refcount semantics.
	(goacc_exit_data_internal): Use goacc_exit_datum_1.
	* target.c (gomp_map_vars_internal): Remove
	GOMP_MAP_VARS_OPENACC_ENTER_DATA handling.  Update for dynamic_refcount
	handling.
	(gomp_unmap_vars_internal): Remove virtual_refcount handling.
	(gomp_load_image_to_device): Substitute dynamic_refcount for
	virtual_refcount.
	* testsuite/libgomp.oacc-c-c++-common/pr92843-1.c: Remove XFAILs.
	* testsuite/libgomp.oacc-c-c++-common/refcounting-1.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/refcounting-2.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/struct-3-1-1.c: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-6.f90: Remove XFAILs and
	trace output.
	* testsuite/libgomp.oacc-fortran/deep-copy-6-no_finalize.F90: Remove
	trace output.
	* testsuite/libgomp.oacc-fortran/dynamic-incr-structural-1.f90: New
	test.
	* testsuite/libgomp.oacc-c-c++-common/structured-dynamic-lifetimes-4.c:
	Remove stale comment.
	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-1-1.f90: Remove XFAILs.
	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-1-2.F90: Likewise.
	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-2-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-2-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-3-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-4-1.f90: Adjust XFAIL.

Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
2020-07-10 08:07:12 -07:00
Julian Brown
cb7effde6f openacc: Helper functions for enter/exit data using single mapping
This patch factors out the parts of goacc_enter_datum and
goacc_exit_datum that can be shared with goacc_enter_data_internal
and goacc_exit_data_internal respectively (in the next patch),
without overloading function return values or complicating code paths
unnecessarily.

2020-07-10  Julian Brown  <julian@codesourcery.com>
	    Thomas Schwinge  <thomas@codesourcery.com>

libgomp/
	* oacc-mem.c (goacc_map_var_existing): New function.
	(goacc_enter_datum): Use above function.
	(goacc_exit_datum_1): New function.
	(goacc_exit_datum): Use above function.

Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
2020-07-10 08:07:12 -07:00
GCC Administrator
3f8ca9cb86 Daily bump. 2020-07-10 00:16:28 +00:00
Julian Brown
0d00fe404c openacc: Set bias to zero for explicit attach/detach clauses in C and C++
This is a fix for the pointer (or array) size inadvertently being used
for the bias with attach and detach mapping kinds, for both C and C++.

2020-07-09  Julian Brown  <julian@codesourcery.com>
	    Thomas Schwinge  <thomas@codesourcery.com>

gcc/c/
	PR middle-end/95270
	* c-typeck.c (c_finish_omp_clauses): Set OMP_CLAUSE_SIZE (bias) to zero
	for standalone attach/detach clauses.

gcc/cp/
	PR middle-end/95270
	* semantics.c (finish_omp_clauses): Likewise.

include/
	PR middle-end/95270
	* gomp-constants.h (gomp_map_kind): Expand comment for attach/detach
	mapping kinds.

gcc/testsuite/
	PR middle-end/95270
	* c-c++-common/goacc/mdc-1.c: Update expected dump output for zero
	bias.

libgomp/
	PR middle-end/95270
	* testsuite/libgomp.oacc-c-c++-common/pr95270-1.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/pr95270-2.c: New test.
2020-07-09 15:17:52 -07:00
Julian Brown
8d2e5026d2 openacc: GOMP_MAP_ATTACH handling in find_group_last
Arrange for GOMP_MAP_ATTACH to be grouped together with a preceding
GOMP_MAP_TO_PSET or other "to" data movement clause, except in cases
where an explicit "attach" clause is used.

2020-07-09  Julian Brown  <julian@codesourcery.com>

include/
	* gomp-constants.h (gomp_map_kind): Update comment for GOMP_MAP_TO_PSET.

libgomp/
	* oacc-mem.c (find_group_last): Group data-movement clauses
	(GOMP_MAP_TO_PSET, GOMP_MAP_TO, etc.) together with a subsequent
	GOMP_MAP_ATTACH.  Allow standalone GOMP_MAP_ATTACH also.
2020-07-09 14:16:00 -07:00
Jakub Jelinek
5acef69f9d openmp: Optimize triangular loop logical iterator to actual iterators computation using search for quadratic equation root(s)
This patch implements the optimized logical to actual iterators
computation for triangular loops.

I have a rough implementation using integers, but this one uses floating
point.  There is a small problem that -fopenmp programs aren't linked with
-lm, so it does it only if the hw has sqrt optab (and uses ifn rather than
__builtin_sqrt because it obviously doesn't need errno handling etc.).

Do you think it is ok this way, or should I use the integral computation
using inlined isqrt (we have inequation of the form
start >= x * t10 + t11 * (((x - 1) * x) / 2)
where t10 and t11 are signed long long values and start unsigned long long,
and the division by 2 actually is a problem for accuracy in some cases, so
if we do it in integral, we need to do actually
      long long t12 = 2 * t10 - t11;
      unsigned long long t13 = t12 * t12 + start * 8 * t11;
      unsigned long long isqrt_ = isqrtull (t13);
      long long x = (((long long) isqrt_ - t12) / t11) >> 1;
with careful overflow checking on all the computations before isqrtull
(and on overflows use the fallback implementation).

2020-07-09  Jakub Jelinek  <jakub@redhat.com>

	* omp-general.h (struct omp_for_data): Add min_inner_iterations
	and factor members.
	* omp-general.c (omp_extract_for_data): Initialize them and remember
	them in OMP_CLAUSE_COLLAPSE_COUNT if needed and restore from there.
	* omp-expand.c (expand_omp_for_init_counts): Fix up computation of
	counts[fd->last_nonrect] if fd->loop.n2 is INTEGER_CST.
	(expand_omp_for_init_vars): For
	fd->first_nonrect + 1 == fd->last_nonrect loops with for now
	INTEGER_CST fd->loop.n2 find quadratic equation roots instead of
	using fallback method when possible.

	* testsuite/libgomp.c/loop-19.c: New test.
	* testsuite/libgomp.c/loop-20.c: New test.
2020-07-09 12:07:17 +02:00
Jakub Jelinek
ea82325afe openmp: Change omp_atv_default value and rename omp_atv_sequential to omp_atv_serialized.
While this is an OpenMP 5.1 change, it is undesirable to let people use different
values and then deal with ABI backwards compatibility in a year or two.

2020-07-09  Jakub Jelinek  <jakub@redhat.com>

	* omp.h.in (omp_alloctrait_value_t): Change omp_atv_default from
	2 to -1.  Add omp_atv_serialized and define omp_atv_sequential using
	it.  Remove __omp_alloctrait_value_max__.
	* allocator.c (omp_init_allocator): Handle omp_atv_default for
	omp_atk_alignment and omp_atk_pool_size.
2020-07-09 11:29:30 +02:00
GCC Administrator
b991c83463 Daily bump. 2020-07-04 00:16:26 +00:00
Thomas Schwinge
e7f3f7fe08 [OpenACC] Revert always-copyfrom behavior for 'GOMP_MAP_FORCE_FROM' in 'libgomp/oacc-mem.c:goacc_exit_data_internal'
As done for 'GOMP_MAP_FROM', also for 'GOMP_MAP_FORCE_FROM' we should only
'gomp_copy_dev2host' if 'n->refcount == 0'.

This had gotten altered in commit 378da98fcc
(r279621) "OpenACC reference count overhaul".

	libgomp/
	* oacc-mem.c (goacc_exit_data_internal): Revert always-copyfrom
	behavior for 'GOMP_MAP_FORCE_FROM'.
	* testsuite/libgomp.oacc-c-c++-common/pr92843-1.c: Adjust XFAIL.
2020-07-03 17:14:40 +02:00
Thomas Schwinge
995aba5867 [OpenACC] Remove (unused) 'GOMP_MAP_ALWAYS_FROM' handling from 'libgomp/oacc-mem.c:goacc_exit_data_internal'
This had gotten added in commit 378da98fcc
(r279621) "OpenACC reference count overhaul", but it doesn't have any use in
OpenACC.

	libgomp/
	* oacc-mem.c (goacc_exit_data_internal): Remove
	'GOMP_MAP_ALWAYS_FROM' handling.
2020-07-03 17:14:21 +02:00
GCC Administrator
46fbb6c682 Daily bump. 2020-07-01 00:16:26 +00:00
Thomas Schwinge
8a8efad098 [testsuite] Replace fragile 'scan-assembler' with 'scan-offload-rtl' in 'libgomp.oacc-c-c++-common/pr85381*.c'
These test cases use directives similar to:

    /* { dg-additional-options "-save-temps" } */

    /* { dg-final { scan-assembler-times "bar.sync" 2 } } */

This expects to scan the PTX offloading compilation assembler code (not host
code!), expecting that nvptx offloading code assembly is produced after the
host code, and thus overwrites the latter file.  (Yes, that's certainly
ugly/fragile...)

..., and this broke with recent commit 1dedc12d18
"revamp dump and aux output names" plus fix-up commit commit
efc16503ca "handle dumpbase in offloading, adjust
testsuite" (short summary: file names changed), so let's finally make that
robust.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/pr85381-2.c: Replace fragile
	'scan-assembler' with 'scan-offload-rtl'.
	* testsuite/libgomp.oacc-c-c++-common/pr85381-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/pr85381-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/pr85381-5.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/pr85381.c: Likewise.
2020-06-30 17:48:36 +02:00
Thomas Schwinge
aff43ac0ae Mark up unreachable OpenACC 'attach' code path
... introduced in commit 8e7e71ff24 (r279625)
"OpenACC 2.6 deep copy: libgomp parts".

	libgomp/
	* target.c (gomp_map_vars_existing): Assert 'kind !=
	GOMP_MAP_ATTACH'.
	(gomp_map_vars_internal): Clean up.
2020-06-30 17:48:36 +02:00
GCC Administrator
9a33c41fe4 Daily bump. 2020-06-28 00:16:21 +00:00
Jakub Jelinek
aed3ab253d openmp: Non-rectangular loop support for non-composite worksharing loops and distribute
This implements the fallback mentioned in
https://gcc.gnu.org/pipermail/gcc/2020-June/232874.html
Special cases for triangular loops etc. to follow later, also composite
constructs not supported yet (need to check the passing of temporaries around)
and lastprivate might not give the same answers as serial loop if the last
innermost body iteration isn't the last one for some of the outer loops
(that will need to be solved separately together with rectangular loops that have no
innermost body iterations, but some of the outer loops actually iterate).
Also, simd needs work.

2020-06-27  Jakub Jelinek  <jakub@redhat.com>

	* omp-general.h (struct omp_for_data_loop): Add non_rect_referenced
	member, move outer member.
	(struct omp_for_data): Add first_nonrect and last_nonrect members.
	* omp-general.c (omp_extract_for_data): Initialize first_nonrect,
	last_nonrect and non_rect_referenced members.
	* omp-expand.c (expand_omp_for_init_counts): Handle non-rectangular
	loops.
	(expand_omp_for_init_vars): Add nonrect_bounds parameter.  Handle
	non-rectangular loops.
	(extract_omp_for_update_vars): Likewise.
	(expand_omp_for_generic, expand_omp_for_static_nochunk,
	expand_omp_for_static_chunk, expand_omp_simd,
	expand_omp_taskloop_for_outer, expand_omp_taskloop_for_inner): Adjust
	expand_omp_for_init_vars and extract_omp_for_update_vars callers.
	(expand_omp_for): Don't sorry on non-composite worksharing-loop or
	distribute.

	* testsuite/libgomp.c/loop-17.c: New test.
	* testsuite/libgomp.c/loop-18.c: New test.
2020-06-27 12:43:36 +02:00
GCC Administrator
c9c05f7323 Daily bump. 2020-06-27 00:16:24 +00:00
Marek Polacek
0801f41944 c++: Change the default dialect to C++17.
Since GCC 9, C++17 support is no longer experimental.  It was too late
to change the default C++ dialect to C++17 in GCC 10, but I think now
it's time to pull the trigger (C++14 was made the default in GCC 6.1).
We're still missing two C++17 library features, but that shouldn't stop
us.  See
<https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2017>
and
<https://gcc.gnu.org/projects/cxx-status.html#cxx17>
for the C++17 status.

I won't list all C++17 features here, but just a few heads-up:

- trigraphs were removed (hardly anyone cares, unless your keyboard is
  missing the # key),
- operator++(bool) was removed (so some tests now run in C++14 and down
  only),
- the keyword register was removed (some legacy code might trip on
  this),
- noexcept specification is now part of the type system and C++17 does
  not allow dynamic exception specifications anymore (the empty throw
  specification is still available, but it is deprecated),
- the evaluation order rules are different in C++17,
- static constexpr data members are now implicitly inline (which makes
  them definitions),
- C++17 requires guaranteed copy elision, meaning that a copy/move
  constructor call might be elided completely.  That means that if
  something relied on a constructor being instantiated via e.g. copying
  a function parameter, it might now fail.

I'll post an update for cxx-status.html and add a new caveat to changes.html
once this is in.

gcc/ChangeLog:
	* doc/invoke.texi (C Dialect Options): Adjust -std default for C++.
	* doc/standards.texi (C Language): Correct the default dialect.
	(C++ Language): Update the default for C++ to gnu++17.

gcc/c-family/ChangeLog:
	* c-opts.c (c_common_init_options): Default to gnu++17.

gcc/testsuite/ChangeLog:
	* c-c++-common/torture/vector-subscript-3.c: In C++17, define away
	the keyword register.
	* g++.dg/cpp1z/attributes-enum-1a.C: Only run pre-C++17.
	* g++.dg/cpp1z/fold7a.C: Likewise.
	* g++.dg/cpp1z/nontype3a.C: Likewise.
	* g++.dg/cpp1z/utf8-2a.C: Likewise.
	* g++.dg/parse/error11.C: Update expected diagnostics for C++17.
	* g++.dg/torture/pr34850.C: Add -Wno-attribute-warning.
	* g++.dg/torture/pr49394.C: In C++17, use noexcept(false).
	* g++.dg/torture/pr82154.C: Use -std=c++14.
	* lib/target-supports.exp: Set to C++17.
	* obj-c++.dg/try-catch-9.mm: Use -Wno-register.

libgomp/ChangeLog:
	* testsuite/libgomp.c++/atomic-3.C: Use -std=gnu++14.
2020-06-26 15:29:07 -04:00
GCC Administrator
4543acc874 Daily bump. 2020-06-24 00:16:31 +00:00
Alexandre Oliva
efc16503ca handle dumpbase in offloading, adjust testsuite
Pass dumpbase on to mkoffloads and their offload-target compiler runs,
using different suffixes for different offloading targets.
Obey -save-temps in naming temporary files while at that.

Adjust the testsuite offload dump scanning machinery to look for dump
files named under the new conventions, iterating internally over all
configured offload targets, or recognizing libgomp's testsuite's own
iteration.


for  gcc/ChangeLog

	* collect-utils.h (dumppfx): New.
	* collect-utils.c (dumppfx): Likewise.
	* lto-wrapper.c (run_gcc): Set global dumppfx.
	(compile_offload_image): Pass a -dumpbase on to mkoffload.
	* config/nvptx/mkoffload.c (ptx_dumpbase): New.
	(main): Handle incoming -dumpbase.  Set ptx_dumpbase.  Obey
	save_temps.
	(compile_native): Pass -dumpbase et al to compiler.
	* config/gcn/mkoffload.c (gcn_dumpbase): New.
	(main): Handle incoming -dumpbase.  Set gcn_dumpbase.  Obey
	save_temps.  Pass -dumpbase et al to offload target compiler.
	(compile_native): Pass -dumpbase et al to compiler.

for  gcc/testsuite/ChangeLog

	* lib/scanoffload.exp: New.
	* lib/scanoffloadrtl.exp: Load it.  Replace ".o" with ""
	globally, and use scanoffload's scoff wrapper to fill it in.
	* lib/scanoffloadtree.exp: Likewise.

for libgomp/ChangeLog

	* testsuite/lib/libgomp.exp: Load gcc lib scanoffload.exp.
	* testsuite/lib/libgomp-dg.exp: Drop now-obsolete -save-temps.
2020-06-23 06:31:18 -03:00
GCC Administrator
605a8f3bbc Daily bump. 2020-06-23 00:16:23 +00:00
David Edelsohn
0164e59835 build: Use -include instead of conditional include.
Automake and GNU Make both use the endif keyword, which conflicts and
elicits an error for matching if/ifdef and endif.

This patch changes the conditional include to use "-include" to prevent
a warning about a possible empty tmake_file.

libgomp/ChangeLog

2020-06-22  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am: Use -include.
	* Makefile.in: Regenerate.

libatomic/ChangeLog

2020-06-22  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am: Use -include.
	* Makefile.in: Regenerate.

libstdc++-v3/ChangeLog

2020-06-22  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am: Use -include.
	* Makefile.in: Regenerate.

libgfortran/ChangeLog

2020-06-22  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am: Use -include.
	* Makefile.in: Regenerate.
2020-06-22 21:31:48 +00:00
GCC Administrator
f86e11a267 Daily bump. 2020-06-22 00:16:23 +00:00
David Edelsohn
47ddb895df aix: Add GCC64 configuration and FAT target libraries.
This patch adds the ability to configure GCC on AIX to build as a
64 bit application and to build target libraries "FAT" libraries in both
32 bit and 64 bit mode.

The patch adds makefile fragment hooks to target libraries that allows
them to include target-specific rules.  The target specific rules for
AIX place both 32 bit and 64 bit objects and shared objects
in archives at the top-level, not multilib subdirectories.  The
multilibs are built in subdirectories, but must be combined during the
last parts of the target library build process.  Because of the way
that GCC bootstrap works, the libraries must be combined during the
multiple stages of GCC bootstrap, not solely when installed in the
final destination, so the libraries are correct at the end of
each target library build stage, not solely an install recipe.

gcc/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* config.gcc: Use t-aix64, biarch64 and default64 for cpu_is_64bit.
	* config/rs6000/aix72.h (ASM_SPEC): Remove aix64 option.
	(ASM_SPEC32): New.
	(ASM_SPEC64): New.
	(ASM_CPU_SPEC): Remove vsx and altivec options.
	(CPP_SPEC_COMMON): Rename from CPP_SPEC.
	(CPP_SPEC32): New.
	(CPP_SPEC64): New.
	(CPLUSPLUS_CPP_SPEC): Rename to CPLUSPLUS_CPP_SPEC_COMMON..
	(TARGET_DEFAULT): Only define if not BIARCH.
	(LIB_SPEC_COMMON): Rename from LIB_SPEC.
	(LIB_SPEC32): New.
	(LIB_SPEC64): New.
	(LINK_SPEC_COMMON): Rename from LINK_SPEC.
	(LINK_SPEC32): New.
	(LINK_SPEC64): New.
	(STARTFILE_SPEC): Add 64 bit version of crtcxa and crtdbase.
	(ASM_SPEC): Define 32 and 64 bit alternatives using DEFAULT_ARCH64_P.
	(CPP_SPEC): Same.
	(CPLUSPLUS_CPP_SPEC): Same.
	(LIB_SPEC): Same.
	(LINK_SPEC): Same.
	(SUBTARGET_EXTRA_SPECS): Add new 32/64 specs.
	* config/rs6000/defaultaix64.h: New file.
	* config/rs6000/t-aix64: New file.

libgcc/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* config.host (extra_parts): Add crtcxa_64 and crtdbase_64.
	* config/rs6000/t-aix-cxa: Explicitly compile 32 bit with -maix32
	and 64 bit with -maix64.
	* config/rs6000/t-slibgcc-aix: Remove extra @multilib_dir@ level.
	Build and install AIX-style FAT libraries.

libgomp/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.tgt (powerpc-ibm-aix*): Define tmake_file.
	* config/t-aix: New file.

libstdc++-v3/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.host (aix*): Define tmake_file.
	* config/os/aix/t-aix: New file.

libatomic/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.tgt (powerpc-ibm-aix*): Define tmake_file.
	* config/t-aix: New file.

libgfortran/ChangeLog

2020-06-21  David Edelsohn  <dje.gcc@gmail.com>

	* Makefile.am (tmake_file): Build and install AIX-style FAT libraries.
	* Makefile.in: Regenerate.
	* configure.ac (tmake_file): Substitute.
	* configure: Regenerate.
	* configure.host: Add system configury stanza. Define tmake_file.
	* config/t-aix: New file.
2020-06-21 14:14:46 -04:00
GCC Administrator
aff95ee7cc Daily bump. 2020-06-18 00:16:37 +00:00
Thomas Schwinge
5864930754 Add 'dg-do run' to 'libgomp.fortran/use_device_ptr-optional-3.f90' [PR94848]
Fix-up for r279858/commit f760c0c77f "Fortran]
OpenMP/OpenACC – fix more issues with OPTIONAL".

With offloading enabled, we then saw:

    PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O0  (test for excess errors)
    PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O0  execution test
    PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O1  (test for excess errors)
    PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O1  execution test
    FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -O2  (test for excess errors)
    UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -O2  compilation failed to produce executable
    FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess errors)
    UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  compilation failed to produce executable
    FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -g  (test for excess errors)
    UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -g  compilation failed to produce executable
    FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -Os  (test for excess errors)
    UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -Os  compilation failed to produce executable

 ... due to:

    /tmp/cciVc43I.o:(.gnu.offload_vars+0x10): undefined reference to `A.12.4064'
    [...]

..., but after the recent PR94848, PR95551 changes, that problem is now gone.

	libgomp/
	PR lto/94848
	* testsuite/libgomp.fortran/use_device_ptr-optional-3.f90: Add
	'dg-do run'.
2020-06-18 00:14:46 +02:00
Andrew Stubbs
f062c3f115 amdgcn: Switch to HSACO v3 binary format
This upgrades the compiler to emit HSA Code Object v3 binaries.  This means
changing the assembler directives, and linker command line options.

The gcn-run and libgomp loaders need corresponding alterations.  The
relocations no longer need to be fixed up manually, and the kernel symbol
names have changed slightly.

This move makes the binaries compatible with the new rocgdb from ROCm 3.5.

2020-06-17  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/gcn/gcn-hsa.h (TEXT_SECTION_ASM_OP): Use ".text".
	(BSS_SECTION_ASM_OP): Use ".bss".
	(ASM_SPEC): Remove "-mattr=-code-object-v3".
	(LINK_SPEC): Add "--export-dynamic".
	* config/gcn/gcn-opts.h (processor_type): Replace PROCESSOR_VEGA with
	PROCESSOR_VEGA10 and PROCESSOR_VEGA20.
	* config/gcn/gcn-run.c (HSA_RUNTIME_LIB): Use ".so.1" variant.
	(load_image): Remove obsolete relocation handling.
	Add ".kd" suffix to the symbol names.
	* config/gcn/gcn.c (MAX_NORMAL_SGPR_COUNT): Set to 62.
	(gcn_option_override): Update gcn_isa test.
	(gcn_kernel_arg_types): Update all the assembler directives.
	Remove the obsolete options.
	(gcn_conditional_register_usage): Update MAX_NORMAL_SGPR_COUNT usage.
	(gcn_omp_device_kind_arch_isa): Handle PROCESSOR_VEGA10 and
	PROCESSOR_VEGA20.
	(output_file_start): Rework assembler file header.
	(gcn_hsa_declare_function_name): Rework kernel metadata.
	* config/gcn/gcn.h (GCN_KERNEL_ARG_TYPES): Set to 16.
	* config/gcn/gcn.opt (PROCESSOR_VEGA): Remove enum.
	(PROCESSOR_VEGA10): New enum value.
	(PROCESSOR_VEGA20): New enum value.

	libgomp/
	* plugin/plugin-gcn.c (init_environment_variables): Use ".so.1"
	variant for HSA_RUNTIME_LIB name.
	(find_executable_symbol_1): Delete.
	(find_executable_symbol): Delete.
	(init_kernel_properties): Add ".kd" suffix to symbol names.
	(find_load_offset): Delete.
	(create_and_finalize_hsa_program): Remove relocation handling.
2020-06-17 10:06:21 +01:00
GCC Administrator
56638b9b18 Daily bump. 2020-06-17 00:16:36 +00:00