Commit Graph

899 Commits

Author SHA1 Message Date
Nicolas Koenig 0fc1c4290b re PR fortran/25829 ([F03] Asynchronous IO support)
2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
	Thomas Koenig <tkoenig@gcc.gnu.org>

	PR fortran/25829
	* testsuite/libgomp.fortran/async_io_1.f90: Really commit.
	* testsuite/libgomp.fortran/async_io_2.f90: Really commit.
	* testsuite/libgomp.fortran/async_io_3.f90: Really commit.
	* testsuite/libgomp.fortran/async_io_4.f90: Really commit.
	* testsuite/libgomp.fortran/async_io_5.f90: Really commit.
	* testsuite/libgomp.fortran/async_io_6.f90: Really commit.
	* testsuite/libgomp.fortran/async_io_7.f90: Really commit.

From-SVN: r262979
2018-07-25 19:34:33 +00:00
Nicolas Koenig b1f45884f6 re PR fortran/25829 ([F03] Asynchronous IO support)
2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
	Thomas Koenig <tkoenig@gcc.gnu.org>

	PR fortran/25829
	* gfortran.texi: Add description of asynchronous I/O.
	* trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
	as volatile.
	* trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
	st_wait_async and change argument spec from ".X" to ".w".
	(gfc_trans_wait): Pass ID argument via reference.

2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
	Thomas Koenig <tkoenig@gcc.gnu.org>

	PR fortran/25829
	* gfortran.dg/f2003_inquire_1.f03: Add write statement.
	* gfortran.dg/f2003_io_1.f03: Add wait statement.

2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
	Thomas Koenig <tkoenig@gcc.gnu.org>

	PR fortran/25829
	* Makefile.am: Add async.c to gfor_io_src.
	Add async.h to gfor_io_headers.
	* Makefile.in: Regenerated.
	* gfortran.map: Add _gfortran_st_wait_async.
	* io/async.c: New file.
	* io/async.h: New file.
	* io/close.c: Include async.h.
	(st_close): Call async_wait for an asynchronous unit.
	* io/file_pos.c (st_backspace): Likewise.
	(st_endfile): Likewise.
	(st_rewind): Likewise.
	(st_flush): Likewise.
	* io/inquire.c: Add handling for asynchronous PENDING
	and ID arguments.
	* io/io.h (st_parameter_dt): Add async bit.
	(st_parameter_wait): Correct.
	(gfc_unit): Add au pointer.
	(st_wait_async): Add prototype.
	(transfer_array_inner): Likewise.
	(st_write_done_worker): Likewise.
	* io/open.c: Include async.h.
	(new_unit): Initialize asynchronous unit.
	* io/transfer.c (async_opt): New struct.
	(wrap_scalar_transfer): New function.
	(transfer_integer): Call wrap_scalar_transfer to do the work.
	(transfer_real): Likewise.
	(transfer_real_write): Likewise.
	(transfer_character): Likewise.
	(transfer_character_wide): Likewise.
	(transfer_complex): Likewise.
	(transfer_array_inner): New function.
	(transfer_array): Call transfer_array_inner.
	(transfer_derived): Call wrap_scalar_transfer.
	(data_transfer_init): Check for asynchronous I/O.
	Perform a wait operation on any pending asynchronous I/O
	if the data transfer is synchronous. Copy PDT and enqueue
	thread for data transfer.
	(st_read_done_worker): New function.
	(st_read_done): Enqueue transfer or call st_read_done_worker.
	(st_write_done_worker): New function.
	(st_write_done): Enqueue transfer or call st_read_done_worker.
	(st_wait): Document as no-op for compatibility reasons.
	(st_wait_async): New function.
	* io/unit.c (insert_unit): Use macros LOCK, UNLOCK and TRYLOCK;
	add NOTE where necessary.
	(get_gfc_unit): Likewise.
	(init_units): Likewise.
	(close_unit_1): Likewise. Call async_close if asynchronous.
	(close_unit): Use macros LOCK and UNLOCK.
	(finish_last_advance_record): Likewise.
	(newunit_alloc): Likewise.
	* io/unix.c (find_file): Likewise.
	(flush_all_units_1): Likewise.
	(flush_all_units): Likewise.
	* libgfortran.h (generate_error_common): Add prototype.
	* runtime/error.c: Include io.h and async.h.
	(generate_error_common): New function.

2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
	Thomas Koenig <tkoenig@gcc.gnu.org>

	PR fortran/25829
	* testsuite/libgomp.fortran/async_io_1.f90: New test.
	* testsuite/libgomp.fortran/async_io_2.f90: New test.
	* testsuite/libgomp.fortran/async_io_3.f90: New test.
	* testsuite/libgomp.fortran/async_io_4.f90: New test.
	* testsuite/libgomp.fortran/async_io_5.f90: New test.
	* testsuite/libgomp.fortran/async_io_6.f90: New test.
	* testsuite/libgomp.fortran/async_io_7.f90: New test.


Co-Authored-By: Thomas Koenig <tkoenig@gcc.gnu.org>

From-SVN: r262978
2018-07-25 18:48:39 +00:00
Jakub Jelinek ffb164c7df re PR testsuite/86649 (g++.dg/tree-ssa/pr19476-1.C fails starting with r262928)
PR testsuite/86649
	* g++.dg/tree-ssa-/pr19476-1.C: Check dom2 dump instead of ccp1.
	* g++.dg/tree-ssa-/pr19476-5.C: Likewise.
	* g++.dg/tree-ssa-/pr19476-6.C: New test.
	* g++.dg/tree-ssa-/pr19476-7.C: New test.

From-SVN: r262942
2018-07-24 12:24:00 +02:00
Jakub Jelinek a3bccfa17c re PR middle-end/86542 (wrong-code for collapsed taskloop which needs omp_cpyfn)
PR middle-end/86542
	* omp-low.c (create_task_copyfn): Copy over also fields corresponding
	to _looptemp_ clauses, other than the first two.

	* testsuite/libgomp.c++/pr86542.C: New test.

From-SVN: r262815
2018-07-17 12:54:52 +02:00
Jakub Jelinek 3a10621137 re PR middle-end/86539 (OpenMP wrong-code with taskloop and references)
PR middle-end/86539
	* gimplify.c (gimplify_omp_for): Ensure taskloop firstprivatized init
	and cond temporaries don't have reference type if iterator has
	pointer type.  For init use &for_pre_body instead of pre_p if
	for_pre_body is non-empty.

	* testsuite/libgomp.c++/pr86539.C: New test.

From-SVN: r262776
2018-07-17 10:06:25 +02:00
Jakub Jelinek 2bae8b2fad re PR c++/86443 (ICEs on #pragma omp distribute parallel for with class iterators)
PR c++/86443
	* testsuite/libgomp.c++/for-15.C (a): Remove unused variable.
	(results): Make sure the variable is not inside declare target region.
	(qux): Remove unused function.

From-SVN: r262552
2018-07-11 15:13:31 +02:00
Jakub Jelinek 0b27c3eda9 re PR c++/86443 (ICEs on #pragma omp distribute parallel for with class iterators)
PR c++/86443
	* gimplify.c (find_combined_omp_for): Add DATA argument, in addition
	to finding the inner OMP_FOR/OMP_SIMD stmt find non-trivial wrappers,
	BLOCKs with BLOCK_VARs, OMP_PARALLEL in between, OMP_FOR in between.
	(gimplify_omp_for): For composite loops, move outer
	OMP_{DISTRIBUTE,TASKLOOP,FOR,PARALLEL} right around innermost
	OMP_FOR/OMP_SIMD if there are any non-trivial wrappers.  For class
	iterators add any needed clauses.  Allow OMP_FOR_ORIG_DECLS to contain
	TREE_LIST for both the original class iterator and the "last" helper
	var.  Gimplify OMP_FOR_PRE_BODY before the outermost composite
	loop, remember has_decl_expr from outer composite loops for the
	innermost OMP_SIMD in TREE_PRIVATE bit on OMP_FOR_INIT.
gcc/c-family/
	* c-omp.c (c_omp_check_loop_iv_r, c_omp_check_loop_iv): Allow declv
	to contain TREE_LIST for both the original class iterator and the
	"last" helper var.
gcc/cp/
	* semantics.c (handle_omp_for_class_iterator): Remove lastp argument,
	instead of setting *lastp turn orig_declv elt into a TREE_LIST.
	(finish_omp_for): Adjust handle_omp_for_class_iterator caller.
	* pt.c (tsubst_omp_for_iterator): Allow OMP_FOR_ORIG_DECLS to contain
	TREE_LIST for both the original class iterator and the "last" helper
	var.
libgomp/
	* testsuite/libgomp.c++/for-15.C: New test.

From-SVN: r262534
2018-07-10 09:12:37 +02:00
Jakub Jelinek f03915116b re PR c++/86291 (OpenMP incorrect for-loop collapsing with iterators and at least 5 nested loops)
PR c++/86291
	* parser.c (cp_parser_omp_for_loop_init): Change for_block argument
	type from vec<tree, va_gc> * to vec<tree, va_gc> *&.

	* testsuite/libgomp.c++/pr86291.C: New test.

From-SVN: r262137
2018-06-26 12:40:50 +02:00
Gerald Pfeifer 1a6d1d2421 libgomp.texi (Top): Move www.openmp.org to https.
* libgomp.texi (Top): Move www.openmp.org to https.
	(Enabling OpenMP): Ditto.
	(omp_get_active_level): Ditto.
	(omp_get_ancestor_thread_num): Ditto.
	(omp_get_cancellation): Ditto.
	(omp_get_default_device): Ditto.
	(omp_get_dynamic): Ditto.
	(omp_get_level): Ditto.
	(omp_get_max_active_levels): Ditto.
	(omp_get_max_task_priority): Ditto.
	(omp_get_max_threads): Ditto.
	(omp_get_nested): Ditto.
	(omp_get_num_devices): Ditto.
	(omp_get_num_procs): Ditto.
	(omp_get_num_teams): Ditto.
	(omp_get_num_threads): Ditto.
	(omp_get_proc_bind): Ditto.
	(omp_get_schedule): Ditto.
	(omp_get_team_num): Ditto.
	(omp_get_team_size): Ditto.
	(omp_get_thread_limit): Ditto.
	(omp_get_thread_num): Ditto.
	(omp_in_parallel): Ditto.
	(omp_in_final): Ditto.
	(omp_is_initial_device): Ditto.
	(omp_set_default_device): Ditto.
	(omp_set_dynamic): Ditto.
	(omp_set_max_active_levels): Ditto.
	(omp_set_nested): Ditto.
	(omp_set_num_threads): Ditto.
	(omp_set_schedule): Ditto.
	(omp_init_lock): Ditto.
	(omp_set_lock): Ditto.
	(omp_test_lock): Ditto.
	(omp_unset_lock): Ditto.
	(omp_destroy_lock): Ditto.
	(omp_init_nest_lock): Ditto.
	(omp_set_nest_lock): Ditto.
	(omp_test_nest_lock): Ditto.
	(omp_unset_nest_lock): Ditto.
	(omp_destroy_nest_lock): Ditto.
	(omp_get_wtick): Ditto.
	(omp_get_wtime): Ditto.
	(OMP_CANCELLATION): Ditto.
	(OMP_DISPLAY_ENV): Ditto.
	(OMP_DEFAULT_DEVICE): Ditto.
	(OMP_DYNAMIC): Ditto.
	(OMP_MAX_ACTIVE_LEVELS): Ditto.
	(OMP_MAX_TASK_PRIORITY): Ditto.
	(OMP_NESTED): Ditto.
	(OMP_NUM_THREADS): Ditto.
	(OMP_PROC_BIND): Ditto.
	(OMP_PLACES): Ditto.
	(OMP_STACKSIZE): Ditto.
	(OMP_SCHEDULE): Ditto.
	(OMP_THREAD_LIMIT): Ditto.
	(OMP_WAIT_POLICY): Ditto.

From-SVN: r261997
2018-06-24 20:38:14 +00:00
Cesar Philippidis 31dd69b7ff Update OpenACC testcases
gcc/testsuite/
	* c-c++-common/goacc/deviceptr-4.c: New file.
	* c-c++-common/goacc/kernels-counter-var-redundant-load.c:
	Likewise.
	* c-c++-common/goacc/kernels-loop-data-2.c: Likewise.
	* c-c++-common/goacc/kernels-loop-data-enter-exit-2.c: Likewise.
	* c-c++-common/goacc/kernels-loop-data-enter-exit.c: Likewise.
	* c-c++-common/goacc/kernels-loop-data-update.c: Likewise.
	* c-c++-common/goacc/kernels-loop-data.c: Likewise.
	* c-c++-common/goacc/kernels-parallel-loop-data-enter-exit.c:
	Likewise.
	* c-c++-common/goacc/parallel-reduction.c: Likewise.
	* c-c++-common/goacc/private-reduction-1.c: Likewise.
	* gfortran.dg/goacc/kernels-parallel-loop-data-enter-exit.f95:
	Likewise.
	* gfortran.dg/goacc/modules.f95: Likewise.
	* gfortran.dg/goacc/routine-8.f90: Likewise.
	* gfortran.dg/goacc/routine-level-of-parallelism-1.f90: Likewise.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/loop-red-wv-1.c: Don't force "-O2".
	* testsuite/libgomp.oacc-c-c++-common/data-2.c: Update.
	* testsuite/libgomp.oacc-c-c++-common/host_data-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/mode-transitions.c: Likewise.
	* testsuite/libgomp.oacc-fortran/data-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/data-2.f90: Likewise.
	* testsuite/libgomp.oacc-c++/non-scalar-data.C: New file.
	* testsuite/libgomp.oacc-c-c++-common/declare-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/enter-data.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-enter-exit-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-enter-exit.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-update.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-data.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-parallel-loop-data-enter-exit.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-local-worker-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-local-worker-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-local-worker-3.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-local-worker-4.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-local-worker-5.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-3.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-4.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-5.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-6.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-vector-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-vector-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-3.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-4.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-5.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-6.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-7.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-reduction-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-loop-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-loop-1.h: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-loop-2.h: Likewise.
	* testsuite/libgomp.oacc-fortran/cublas-fixed.h: Likewise.
	* testsuite/libgomp.oacc-fortran/dummy-array.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/host_data-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/host_data-3.f: Likewise.
	* testsuite/libgomp.oacc-fortran/host_data-4.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-acc-loop-reduction-2.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-acc-loop-reduction.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-collapse-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-collapse-4.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-independent.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-map-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-parallel-loop-data-enter-exit.f95:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-1.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-2.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-3.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-6.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-vector-1.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-vector-2.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-1.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-2.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-3.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-4.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-5.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-6.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-7.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-reduction-1.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/lib-12.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-13.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-14.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-15.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/parallel-loop-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reference-reductions.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/vector-routine.f90: Likewise.

Co-Authored-By: James Norris <jnorris@codesourcery.com>
Co-Authored-By: Julian Brown <julian@codesourcery.com>
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r261884
2018-06-22 12:04:14 +02:00
Chung-Lin Tang 829c6349e9 Update OpenACC data clause semantics to the 2.5 behavior
gcc/c-family/
	* c-pragma.h (enum pragma_omp_clause): Add
	PRAGMA_OACC_CLAUSE_{FINALIZE,IF_PRESENT}. Remove
	PRAGMA_OACC_CLAUSE_PRESENT_OR_{COPY,COPYIN,COPYOUT,CREATE}.

	gcc/c/
	* c-parser.c (c_parser_omp_clause_name): Add support for finalize
	and if_present. Make present_or_{copy,copyin,copyout,create} aliases
	to their non-present_or_* counterparts. Make 'self' an alias to
	PRAGMA_OACC_CLAUSE_HOST.
	(c_parser_oacc_data_clause): Update GOMP mappings for
	PRAGMA_OACC_CLAUSE_{COPY,COPYIN,COPYOUT,CREATE,DELETE}. Remove
	PRAGMA_OACC_CLAUSE_{SELF,PRESENT_OR_*}.
	(c_parser_oacc_all_clauses): Handle finalize and if_present clauses.
	Remove support for present_or_* clauses.
	(OACC_KERNELS_CLAUSE_MASK): Remove PRESENT_OR_* clauses.
	(OACC_PARALLEL_CLAUSE_MASK): Likewise.
	(OACC_DECLARE_CLAUSE_MASK): Likewise.
	(OACC_DATA_CLAUSE_MASK): Likewise.
	(OACC_ENTER_DATA_CLAUSE_MASK): Remove PRESENT_OR_* clauses.
	(OACC_EXIT_DATA_CLAUSE_MASK): Add FINALIZE clause.
	(OACC_UPDATE_CLAUSE_MASK): Remove SELF, add IF_PRESENT.
	(c_parser_oacc_declare): Remove PRESENT_OR_* clauses.
	* c-typeck.c (c_finish_omp_clauses): Handle IF_PRESENT and FINALIZE.

	gcc/cp/
	* parser.c (cp_parser_omp_clause_name): Add support for finalize
	and if_present. Make present_or_{copy,copyin,copyout,create} aliases
	to their non-present_or_* counterparts. Make 'self' an alias to
	PRAGMA_OACC_CLAUSE_HOST.
	(cp_parser_oacc_data_clause): Update GOMP mappings for
	PRAGMA_OACC_CLAUSE_{COPY,COPYIN,COPYOUT,CREATE,DELETE}. Remove
	PRAGMA_OACC_CLAUSE_{SELF,PRESENT_OR_*}.
	(cp_parser_oacc_all_clauses): Handle finalize and if_present clauses.
	Remove support for present_or_* clauses.
	(OACC_KERNELS_CLAUSE_MASK): Remove PRESENT_OR_* clauses.
	(OACC_PARALLEL_CLAUSE_MASK): Likewise.
	(OACC_DECLARE_CLAUSE_MASK): Likewise.
	(OACC_DATA_CLAUSE_MASK): Likewise.
	(OACC_ENTER_DATA_CLAUSE_MASK): Remove PRESENT_OR_* clauses.
	(OACC_EXIT_DATA_CLAUSE_MASK): Add FINALIZE clause.
	(OACC_UPDATE_CLAUSE_MASK): Remove SELF, add IF_PRESENT.
	(cp_parser_oacc_declare): Remove PRESENT_OR_* clauses.
	* pt.c (tsubst_omp_clauses): Handle IF_PRESENT and FINALIZE.
	* semantics.c (finish_omp_clauses): Handle IF_PRESENT and FINALIZE.

	gcc/fortran/
	* gfortran.h (gfc_omp_clauses): Add unsigned if_present, finalize
	bitfields.
	* openmp.c (enum omp_mask2): Remove OMP_CLAUSE_PRESENT_OR_*. Add
	OMP_CLAUSE_{IF_PRESENT,FINALIZE}.
	(gfc_match_omp_clauses): Update handling of copy, copyin, copyout,
	create, deviceptr, present_of_*. Add support for finalize and
	if_present.
	(OACC_PARALLEL_CLAUSES): Remove PRESENT_OR_* clauses.
	(OACC_KERNELS_CLAUSES): Likewise.
	(OACC_DATA_CLAUSES): Likewise.
	(OACC_DECLARE_CLAUSES): Likewise.
	(OACC_UPDATE_CLAUSES): Add IF_PRESENT clause.
	(OACC_ENTER_DATA_CLAUSES): Remove PRESENT_OR_* clauses.
	(OACC_EXIT_DATA_CLAUSES): Add FINALIZE clause.
	(gfc_match_oacc_declare): Update to OpenACC 2.5 semantics.
	* trans-openmp.c (gfc_trans_omp_clauses): Add support for IF_PRESENT
	and FINALIZE.

	gcc/
	* gimplify.c (gimplify_scan_omp_clauses): Add support for
	OMP_CLAUSE_{IF_PRESENT,FINALIZE}.
	(gimplify_adjust_omp_clauses): Likewise.
	(gimplify_oacc_declare_1): Add support for GOMP_MAP_RELEASE, remove
	support for GOMP_MAP_FORCE_{ALLOC,TO,FROM,TOFROM}.
	(gimplify_omp_target_update): Update handling of acc update and
	enter/exit data.
	* omp-low.c (install_var_field): Remove unused parameter
	base_pointers_restrict.
	(scan_sharing_clauses): Remove base_pointers_restrict parameter.
	Update call to install_var_field. Handle OMP_CLAUSE_{IF_PRESENT,
	FINALIZE}
	(omp_target_base_pointers_restrict_p): Delete.
	(scan_omp_target): Update call to scan_sharing_clauses.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_{IF_PRESENT,
	FINALIZE}.
	* tree-nested.c (convert_nonlocal_omp_clauses): Handle
	OMP_CLAUSE_{IF_PRESENT,FINALIZE}.
	(convert_local_omp_clauses): Likewise.
	* tree-pretty-print.c (dump_omp_clause): Likewise.
	* tree.c (omp_clause_num_ops): Add entries for 	OMP_CLAUSE_{IF_PRESENT,
	FINALIZE}.
	(omp_clause_code_name): Likewise.

	gcc/testsuite/
	* c-c++-common/goacc/declare-1.c: Update test case to utilize OpenACC
	2.5 data clause semantics.
	* c-c++-common/goacc/declare-2.c: Likewise.
	* c-c++-common/goacc/default-4.c: Likewise.
	* c-c++-common/goacc/finalize-1.c: New test.
	* c-c++-common/goacc/kernels-alias-2.c: Update test case to utilize
	OpenACC 2.5 data clause semantics.
	* c-c++-common/goacc/kernels-alias.c: Likewise.
	* c-c++-common/goacc/routine-5.c: Likewise.
	* c-c++-common/goacc/update-if_present-1.c: New test.
	* c-c++-common/goacc/update-if_present-2.c: New test.
	* g++.dg/goacc/template.C: Update test case to utilize OpenACC
	2.5 data clause semantics.
	* gfortran.dg/goacc/combined-directives.f90: Likewise.
	* gfortran.dg/goacc/data-tree.f95: Likewise.
	* gfortran.dg/goacc/declare-2.f95: Likewise.
	* gfortran.dg/goacc/default-4.f: Likewise.
	* gfortran.dg/goacc/enter-exit-data.f95: Likewise.
	* gfortran.dg/goacc/finalize-1.f: New test.
	* gfortran.dg/goacc/kernels-alias-2.f95: Update test case to utilize
	OpenACC 2.5 data clause semantics.
	* gfortran.dg/goacc/kernels-alias.f95: Likewise.
	* gfortran.dg/goacc/kernels-tree.f95: Likewise.
	* gfortran.dg/goacc/nested-function-1.f90: Likewise.
	* gfortran.dg/goacc/parallel-tree.f95: Likewise.
	* gfortran.dg/goacc/reduction-promotions.f90: Likewise.
	* gfortran.dg/goacc/update-if_present-1.f90: New test.
	* gfortran.dg/goacc/update-if_present-2.f90: New test.

	libgomp/
	* libgomp.h (struct splay_tree_key_s): Add dynamic_refcount member.
	(gomp_acc_remove_pointer): Update declaration.
	(gomp_acc_declare_allocate): Declare.
	(gomp_remove_var): Declare.
	* libgomp.map (OACC_2.5): Define.
	* oacc-mem.c (acc_map_data): Update refcount.
	(acc_unmap_data): Likewise.
	(present_create_copy): Likewise.
	(acc_create): Add FLAG_PRESENT when calling present_create_copy.
	(acc_copyin): Likewise.
	(FLAG_FINALIZE): Define.
	(delete_copyout): Update dynamic refcounts, add support for FINALIZE.
	(acc_delete_finalize): New function.
	(acc_delete_finalize_async): New function.
	(acc_copyout_finalize): New function.
	(acc_copyout_finalize_async): New function.
	(gomp_acc_insert_pointer): Update refcounts.
	(gomp_acc_remove_pointer): Return if data is not present on the
	accelerator.
	* oacc-parallel.c (find_pset): Rename to find_pointer.
	(find_pointer): Add support for GOMP_MAP_POINTER.
	(handle_ftn_pointers): New function.
	(GOACC_parallel_keyed): Update refcounts of variables.
	(GOACC_enter_exit_data): Add support for finalized data mappings.
	Add support for GOMP_MAP_{TO,ALLOC,RELESE,FROM}. Update handling
	of fortran arrays.
	(GOACC_update): Add support for GOMP_MAP_{ALWAYS_POINTER,TO,FROM}.
	(GOACC_declare): Add support for GOMP_MAP_RELEASE, remove support
	for GOMP_MAP_FORCE_FROM.
	* openacc.f90 (module openacc_internal): Add
	acc_copyout_finalize_{32_h,64_h,array_h,_l}, and
	acc_delete_finalize_{32_h,64_h,array_h,_l}. Add interfaces for
	acc_copyout_finalize and acc_delete_finalize.
	(acc_copyout_finalize_32_h): New subroutine.
	(acc_copyout_finalize_64_h): New subroutine.
	(acc_copyout_finalize_array_h): New subroutine.
	(acc_delete_finalize_32_h): New subroutine.
	(acc_delete_finalize_64_h): New subroutine.
	(acc_delete_finalize_array_h): New subroutine.
	* openacc.h (acc_copyout_finalize): Declare.
	(acc_copyout_finalize_async): Declare.
	(acc_delete_finalize): Declare.
	(acc_delete_finalize_async): Declare.
	* openacc_lib.h (acc_copyout_finalize): New interface.
	(acc_delete_finalize): New interface.
	* target.c (gomp_map_vars): Update dynamic_refcount.
	(gomp_remove_var): New function.
	(gomp_unmap_vars): Use it.
	(gomp_unload_image_from_device): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-1.c: Update test
	case to utilize OpenACC 2.5 data clause semantics.
	* testsuite/libgomp.oacc-c-c++-common/data-already-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-5.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-6.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-7.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-8.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-16.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-25.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-32.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-83.c: Likewise.
	* testsuite/libgomp.oacc-fortran/data-5.f90: New test.
	* testsuite/libgomp.oacc-fortran/data-already-1.f: Update test case to
	utilize OpenACC 2.5 data clause semantics.
	* testsuite/libgomp.oacc-fortran/data-already-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-3.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-4.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-5.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-6.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-7.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-8.f: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-32-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-32-2.f: Likewise.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>

From-SVN: r261813
2018-06-20 09:35:15 -07:00
Janus Weil 4358400b3f re PR fortran/85841 ([F2018] reject deleted features)
2018-05-21  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/85841
	PR testsuite/85865
	* testsuite/libgomp.fortran/collapse2.f90: Add option "-std=legacy".
	* testsuite/libgomp.fortran/omp_atomic2.f90: Ditto.
	* testsuite/libgomp.fortran/omp_parse1.f90: Ditto.
	* testsuite/libgomp.fortran/omp_parse3.f90: Ditto.
	* testsuite/libgomp.fortran/task2.f90: Ditto.
	* testsuite/libgomp.fortran/vla1.f90: Ditto.
	* testsuite/libgomp.fortran/vla2.f90: Ditto.
	* testsuite/libgomp.fortran/vla3.f90: Ditto.
	* testsuite/libgomp.fortran/vla4.f90: Ditto.
	* testsuite/libgomp.fortran/vla5.f90: Ditto.
	* testsuite/libgomp.fortran/vla6.f90: Ditto.
	* testsuite/libgomp.fortran/vla8.f90: Ditto.
	* testsuite/libgomp.oacc-fortran/collapse-2.f90: Ditto.
	* testsuite/libgomp.oacc-fortran/nested-function-1.f90: Ditto.

From-SVN: r260487
2018-05-21 22:48:59 +02:00
Cesar Philippidis 950ad0bafe re PR c++/85782 (acc loops with continue statements ICE in c++)
PR c++/85782

	gcc/cp/
	* cp-gimplify.c (cp_genericize_r): Call genericize_omp_for_stmt for
	OACC_LOOPs.

	gcc/testsuite/
	* c-c++-common/goacc/pr85782.c: New test.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/pr85782.c: New test.

From-SVN: r260369
2018-05-18 08:43:09 -07:00
Tom de Vries f5ad16f1db [openacc, libgomp] Use GOMP_ASYNC_SYNC in GOACC_declare
2018-05-09  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/82901
	* oacc-parallel.c (GOACC_declare): Use GOMP_ASYNC_SYNC as async argument
	to GOACC_enter_exit_data.

From-SVN: r260085
2018-05-09 16:01:30 +00:00
Tom de Vries edbd038a5f [openacc] Factor out async argument utility functions
2018-05-09  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/83792
	* oacc-int.h (async_valid_stream_id_p, async_valid_p)
	(async_synchronous_p): New function.
	* oacc-async.c (acc_async_test, acc_wait, acc_wait_all_async): Use
	async_valid_p.
	* oacc-cuda.c (acc_get_cuda_stream, acc_set_cuda_stream): Use
	async_valid_stream_id_p.
	* oacc-mem.c (gomp_acc_remove_pointer): Use async_synchronous_p.
	* oacc-parallel.c (GOACC_parallel_keyed): Same.

From-SVN: r260081
2018-05-09 13:52:49 +00:00
Tom de Vries 37d6c719c4 [openacc, testsuite] Allow installed testing of libgomp to find gomp-constants.h
2018-05-07  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/85677
	* testsuite/lib/libgomp.exp (libgomp_init): Move inclusion of top-level
	include directory in ALWAYS_CFLAGS out of $blddir != "" condition.

From-SVN: r259992
2018-05-07 11:33:45 +00:00
Tom de Vries 63f122152f [testsuite] Add scan-offload-tree-dump
2018-05-03  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/85106
	* lib/scanoffloadtree.exp: New file.

	* testsuite/lib/libgomp-dg.exp (libgomp-dg-test): Add save-temps to
	extra_tool_flags if it contains an -foffload=-fdump-* flag.
	* testsuite/lib/libgomp.exp: Include scanoffloadtree.exp.
	* testsuite/libgomp.oacc-c/vec.c: Use scan-offload-tree-dump.

	* doc/sourcebuild.texi (Commands for use in dg-final, Scan optimization
	dump files): Add offload-tree.

From-SVN: r259892
2018-05-03 13:47:14 +00:00
Tom de Vries ec00d3faf4 [openacc] Move GOMP_OPENACC_DIM parsing out of nvptx plugin
2018-05-02  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/85411
	* plugin/plugin-nvptx.c (nvptx_exec): Move parsing of
	GOMP_OPENACC_DIM ...
	* env.c (parse_gomp_openacc_dim): ... here.  New function.
	(initialize_env): Call parse_gomp_openacc_dim.
	(goacc_default_dims): Define.
	* libgomp.h (goacc_default_dims): Declare.
	* oacc-plugin.c (GOMP_PLUGIN_acc_default_dim): New function.
	* oacc-plugin.h (GOMP_PLUGIN_acc_default_dim): Declare.
	* libgomp.map: New version "GOMP_PLUGIN_1.2". Add
	GOMP_PLUGIN_acc_default_dim.
	* testsuite/libgomp.oacc-c-c++-common/loop-default-runtime.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/loop-default.h: New test.

From-SVN: r259852
2018-05-02 17:53:56 +00:00
Tom de Vries 92243e7cea [libgomp, testsuite] Move tests to libgomp.c-c++-common
2018-05-02  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/83791
	* testsuite/libgomp.c++/udr-9.C: Update.
	* testsuite/libgomp.c++/atomic-16.C: Remove.
	* testsuite/libgomp.c++/cancel-taskgroup-2.C: Remove.
	* testsuite/libgomp.c++/loop-13.C: Remove.
	* testsuite/libgomp.c++/loop-14.C: Remove.
	* testsuite/libgomp.c++/loop-15.C: Remove.
	* testsuite/libgomp.c++/monotonic-1.C: Remove.
	* testsuite/libgomp.c++/monotonic-2.C: Remove.
	* testsuite/libgomp.c++/nonmonotonic-1.C: Remove.
	* testsuite/libgomp.c++/nonmonotonic-2.C: Remove.
	* testsuite/libgomp.c++/ordered-1.C: Remove.
	* testsuite/libgomp.c++/pr45784.C: Remove.
	* testsuite/libgomp.c++/pr64824.C: Remove.
	* testsuite/libgomp.c++/pr64868.C: Remove.
	* testsuite/libgomp.c++/pr66199-1.C: Remove.
	* testsuite/libgomp.c++/pr66199-2.C: Remove.
	* testsuite/libgomp.c++/pr66199-3.C: Remove.
	* testsuite/libgomp.c++/pr66199-4.C: Remove.
	* testsuite/libgomp.c++/pr66199-5.C: Remove.
	* testsuite/libgomp.c++/pr66199-6.C: Remove.
	* testsuite/libgomp.c++/pr66199-7.C: Remove.
	* testsuite/libgomp.c++/pr66199-8.C: Remove.
	* testsuite/libgomp.c++/pr66199-9.C: Remove.
	* testsuite/libgomp.c++/pr69389.C: Remove.
	* testsuite/libgomp.c++/simd10.C: Remove.
	* testsuite/libgomp.c++/simd11.C: Remove.
	* testsuite/libgomp.c++/simd12.C: Remove.
	* testsuite/libgomp.c++/simd13.C: Remove.
	* testsuite/libgomp.c++/target-1.C: Remove.
	* testsuite/libgomp.c++/target-3.C: Remove.
	* testsuite/libgomp.c++/target-4.C: Remove.
	* testsuite/libgomp.c++/target-5.C: Remove.
	* testsuite/libgomp.c++/taskgroup-1.C: Remove.
	* testsuite/libgomp.c++/taskloop-1.C: Remove.
	* testsuite/libgomp.c++/taskloop-2.C: Remove.
	* testsuite/libgomp.c++/taskloop-3.C: Remove.
	* testsuite/libgomp.c++/taskloop-4.C: Remove.
	* testsuite/libgomp.c++/udr-9.C: Remove.
	* testsuite/libgomp.c++/for-10.C: Remove.
	* testsuite/libgomp.c++/for-11.C: Remove.
	* testsuite/libgomp.c++/for-12.C: Remove.
	* testsuite/libgomp.c++/for-13.C: Remove.
	* testsuite/libgomp.c++/for-14.C: Remove.
	* testsuite/libgomp.c++/for-9.C: Remove.
	* testsuite/libgomp.c/atomic-18.c: Move ...
	* testsuite/libgomp.c-c++-common/atomic-18.c: ... here.
	* testsuite/libgomp.c/cancel-taskgroup-2.c: Move ...
	* testsuite/libgomp.c-c++-common/cancel-taskgroup-2.c: here.
	* testsuite/libgomp.c/loop-13.c: Move ...
	* testsuite/libgomp.c-c++-common/loop-13.c: ... here.
	* testsuite/libgomp.c/loop-14.c: Move ...
	* testsuite/libgomp.c-c++-common/loop-14.c: ... here.
	* testsuite/libgomp.c/loop-15.c: Remove.
	* testsuite/libgomp.c-c++-common/loop-15.c: New test.
	* testsuite/libgomp.c/monotonic-1.c: Move ...
	* testsuite/libgomp.c-c++-common/monotonic-1.c: ... here.
	* testsuite/libgomp.c/monotonic-2.c: Move ...
	* testsuite/libgomp.c-c++-common/monotonic-2.c: ... here.
	* testsuite/libgomp.c/nonmonotonic-1.c: Move ...
	* testsuite/libgomp.c-c++-common/nonmonotonic-1.c: ... here.
	* testsuite/libgomp.c/nonmonotonic-2.c: Move ...
	* testsuite/libgomp.c-c++-common/nonmonotonic-2.c: ... here.
	* testsuite/libgomp.c/ordered-4.c: Move ...
	* testsuite/libgomp.c-c++-common/ordered-4.c: ... here.
	* testsuite/libgomp.c/pr45784.c: Move ...
	* testsuite/libgomp.c-c++-common/pr45784.c: ... here.
	* testsuite/libgomp.c/pr64824.c: Move ...
	* testsuite/libgomp.c-c++-common/pr64824.c: ... here.
	* testsuite/libgomp.c/pr64868.c: Move ...
	* testsuite/libgomp.c-c++-common/pr64868.c: ... here.
	* testsuite/libgomp.c/pr66199-1.c: Move ...
	* testsuite/libgomp.c-c++-common/pr66199-1.c: ... here.
	* testsuite/libgomp.c/pr66199-2.c: Move ...
	* testsuite/libgomp.c-c++-common/pr66199-2.c: ... here.
	* testsuite/libgomp.c/pr66199-3.c: Move ...
	* testsuite/libgomp.c-c++-common/pr66199-3.c: ... here.
	* testsuite/libgomp.c/pr66199-4.c: Move ...
	* testsuite/libgomp.c-c++-common/pr66199-4.c: ... here.
	* testsuite/libgomp.c/pr66199-5.c: Move ...
	* testsuite/libgomp.c-c++-common/pr66199-5.c: ... here.
	* testsuite/libgomp.c/pr66199-6.c: Move ...
	* testsuite/libgomp.c-c++-common/pr66199-6.c: ... here.
	* testsuite/libgomp.c/pr66199-7.c: Move ...
	* testsuite/libgomp.c-c++-common/pr66199-7.c: ... here.
	* testsuite/libgomp.c/pr66199-8.c: Move ...
	* testsuite/libgomp.c-c++-common/pr66199-8.c: ... here.
	* testsuite/libgomp.c/pr66199-9.c: Move ...
	* testsuite/libgomp.c-c++-common/pr66199-9.c: ... here.
	* testsuite/libgomp.c/pr69389.c: Move ...
	* testsuite/libgomp.c-c++-common/pr69389.c: ... here.
	* testsuite/libgomp.c/simd-14.c: Move ...
	* testsuite/libgomp.c-c++-common/simd-14.c: ... here.
	* testsuite/libgomp.c/simd-15.c: Move ...
	* testsuite/libgomp.c-c++-common/simd-15.c: ... here.
	* testsuite/libgomp.c/simd-16.c: Move ...
	* testsuite/libgomp.c-c++-common/simd-16.c: ... here.
	* testsuite/libgomp.c/simd-17.c: Move ...
	* testsuite/libgomp.c-c++-common/simd-17.c: ... here.
	* testsuite/libgomp.c/target-1.c: Move ...
	* testsuite/libgomp.c-c++-common/target-1.c: ... here.
	* testsuite/libgomp.c/target-10.c: Move ...
	* testsuite/libgomp.c-c++-common/target-10.c: ... here.
	* testsuite/libgomp.c/target-13.c: Move ...
	* testsuite/libgomp.c-c++-common/target-13.c: ... here.
	* testsuite/libgomp.c/target-2.c: Move ...
	* testsuite/libgomp.c-c++-common/target-2.c: ... here.
	* testsuite/libgomp.c/taskgroup-1.c: Move ...
	* testsuite/libgomp.c-c++-common/taskgroup-1.c: ... here.
	* testsuite/libgomp.c/taskloop-1.c: Move ...
	* testsuite/libgomp.c-c++-common/taskloop-1.c: ... here.
	* testsuite/libgomp.c/taskloop-2.c: Move ...
	* testsuite/libgomp.c-c++-common/taskloop-2.c: ... here.
	* testsuite/libgomp.c/taskloop-3.c: Move ...
	* testsuite/libgomp.c-c++-common/taskloop-3.c: ... here.
	* testsuite/libgomp.c/taskloop-4.c: Move ...
	* testsuite/libgomp.c-c++-common/taskloop-4.c: ... here.
	* testsuite/libgomp.c/udr-1.c: Move ...
	* testsuite/libgomp.c-c++-common/udr-1.c: ... here.
	* testsuite/libgomp.c/for-1.c: Move ...
	* testsuite/libgomp.c-c++-common/for-1.c: ... here.
	* testsuite/libgomp.c/for-1.h: Move ...
	* testsuite/libgomp.c-c++-common/for-1.h: ... here.
	* testsuite/libgomp.c/for-2.c: Move ...
	* testsuite/libgomp.c-c++-common/for-2.c: ... here.
	* testsuite/libgomp.c/for-2.h: Move ...
	* testsuite/libgomp.c-c++-common/for-2.h: ... here.
	* testsuite/libgomp.c/for-3.c: Move ...
	* testsuite/libgomp.c-c++-common/for-3.c: ... here.
	* testsuite/libgomp.c/for-4.c: Move ...
	* testsuite/libgomp.c-c++-common/for-4.c: ... here.
	* testsuite/libgomp.c/for-5.c: Move ...
	* testsuite/libgomp.c-c++-common/for-5.c: ... here.
	* testsuite/libgomp.c/for-6.c: Move ...
	* testsuite/libgomp.c-c++-common/for-6.c: ... here.

From-SVN: r259851
2018-05-02 17:53:43 +00:00
Tom de Vries 1f62d6375b [openacc] Add __builtin_goacc_parlevel_{id,size}
2018-05-02  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/82428
	* builtins.def (DEF_GOACC_BUILTIN_ONLY): Define.
	* omp-builtins.def (BUILT_IN_GOACC_PARLEVEL_ID)
	(BUILT_IN_GOACC_PARLEVEL_SIZE): New builtin.
	* builtins.c (expand_builtin_goacc_parlevel_id_size): New function.
	(expand_builtin): Call expand_builtin_goacc_parlevel_id_size.
	* doc/extend.texi (Other Builtins): Add __builtin_goacc_parlevel_id and
	__builtin_goacc_parlevel_size.

	* f95-lang.c (DEF_GOACC_BUILTIN_ONLY): Define.

	* c-c++-common/goacc/builtin-goacc-parlevel-id-size-2.c: New test.
	* c-c++-common/goacc/builtin-goacc-parlevel-id-size.c: New test.

	* testsuite/libgomp.oacc-c-c++-common/gang-static-2.c: Use
	__builtin_goacc_parlevel_{id,size}.
	* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-g-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-g-2.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-wv-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-v-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/routine-g-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/routine-v-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/tile-1.c: Same.

From-SVN: r259850
2018-05-02 17:53:29 +00:00
Tom de Vries 9220b5116d [testsuite] Add scan-ltrans-tree-dump
2018-05-02  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/85106
	* gcc.dg/ipa/ipa-icf-38.c: Use scan-ltrans-tree-dump.
	* lib/scanltranstree.exp: New file.
	* lib/target-supports.exp (scan-ltrans-tree-dump_required_options)
	(scan-ltrans-tree-dump-times_required_options)
	(scan-ltrans-tree-dump-not_required_options)
	(scan-ltrans-tree-dump-dem_required_options)
	(scan-ltrans-tree-dump-dem-not_required_options): New proc.
	* lib/gcc-dg.exp: Include scanltranstree.exp.

	* testsuite/lib/libatomic.exp: Include scanltranstree.exp.

	* testsuite/lib/libgomp.exp: Include scanltranstree.exp.

	* testsuite/lib/libitm.exp: Include scanltranstree.exp.

	* testsuite/lib/libvtv.exp: Include scanltranstree.exp.

	* doc/sourcebuild.texi (Commands for use in dg-final, Scan optimization
	dump files): Add ltrans-tree.

From-SVN: r259838
2018-05-02 12:16:32 +00:00
Tom de Vries 6c3c13c181 [testsuite] Add scan-wpa-ipa-dump
2018-05-02  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/85106
	* gcc.dg/ipa/ipa-icf-38.c: New test.
	* gcc.dg/ipa/ipa-icf-38a.c: New test.
	* lib/scandump.exp (dump-base): New proc.
	(scan-dump, scan-dump-times, scan-dump-not, scan-dump-dem)
	(scan-dump-dem-not): Add and handle parameter for suffix of the dump
	base.
	* lib/scanipa.exp: Add "" argument to scan-dump calls.
	* lib/scanlang.exp: Same.
	* lib/scanrtl.exp: Same.
	* lib/scantree.exp: Same.
	* lib/scanwpaipa.exp: New file.
	* lib/gcc-dg.exp: Include scanwpaipa.exp.

	* testsuite/lib/libatomic.exp: Include scanwpaipa.exp.

	* testsuite/lib/libgomp.exp: Include scanwpaipa.exp.

	* testsuite/lib/libitm.exp: Include scanwpaipa.exp.

	* testsuite/lib/libvtv.exp: Include scanwpaipa.exp.

	* doc/sourcebuild.texi (Commands for use in dg-final, Scan optimization
	dump files): Add wpa-ipa.

From-SVN: r259837
2018-05-02 12:16:15 +00:00
Julian Brown 8d70b61edd [openacc, testsuite] Fix undefined behaviour in atomic_capture-1.c
2018-04-29  Julian Brown  <julian@codesourcery.com>
	    Tom de Vries  <tom@codesourcery.com>

	PR testsuite/85527
	* testsuite/libgomp.oacc-c-c++-common/atomic_capture-1.c: Allow
	arbitrary order for iterations of atomic subtract check.

Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r259748
2018-04-29 10:26:56 +00:00
Tom de Vries 4a57a4b629 [openacc, testsuite] Fix undefined behaviour in atomic_capture-1.f90
2018-04-28  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/85527
	* testsuite/libgomp.oacc-fortran/atomic_capture-1.f90 (main): Store
	atomic capture results obtained in parallel loop to an array, instead of
	to a scalar.

From-SVN: r259733
2018-04-27 22:11:12 +00:00
Tom de Vries df36a3d3be [nvptx, libgomp] Add GOMP_NVPTX_JIT=-O[0-4] in nvptx libgomp plugin
2018-04-26  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/84020
	* plugin/cuda/cuda.h (CUjit_option): Add CU_JIT_OPTIMIZATION_LEVEL.
	* plugin/plugin-nvptx.c (_GNU_SOURCE): Define.
	(process_GOMP_NVPTX_JIT): New function.
	(link_ptx): Use process_GOMP_NVPTX_JIT.

From-SVN: r259678
2018-04-26 13:27:04 +00:00
Richard Biener d160ae7814 [lto] Fixup loops before lto write-out
2018-04-26  Richard Biener <rguenther@suse.de>
	    Tom de Vries  <tom@codesourcery.com>

	PR lto/85422
	* lto-streamer-out.c (output_function): Fixup loops if required to match
	discovery done in the reader.

	* testsuite/libgomp.oacc-c-c++-common/pr85422.c: New test.

Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r259675
2018-04-26 13:26:25 +00:00
Tom de Vries ca9dc64220 [nvptx, libgomp, testsuite] Reduce recursion depth in declare_target-{1,2}.f90
2018-04-26  Tom de Vries  <tom@codesourcery.com>

	PR target/85519
	* testsuite/libgomp.fortran/examples-4/declare_target-1.f90: Reduce
	recursion depth from 25 to 23.
	* testsuite/libgomp.fortran/examples-4/declare_target-2.f90: Same.

From-SVN: r259674
2018-04-26 13:26:09 +00:00
H.J. Lu 7b47ecf2f7 Regenerate configure of target libraries
* configure: Regenerated.

From-SVN: r259610
2018-04-24 09:45:26 -07:00
Nathan Sidwell e91eba31fd [nvptx] Fix calls to vector and worker routines
2018-04-20  Nathan Sidwell  <nathan@codesourcery.com>
	    Tom de Vries  <tom@codesourcery.com>

	PR target/85445
	* config/nvptx/nvptx.c (nvptx_emit_forking, nvptx_emit_joining):
	Emit insns for calls too.
	(nvptx_find_par): Always look for worker-level predecessor insn.
	(nvptx_propagate): Add is_call parm, return bool.  Copy frame for
	calls.
	(nvptx_vpropagate, nvptx_wpropagate): Adjust.
	(nvptx_process_pars): Propagate frames for calls.

	* testsuite/libgomp.oacc-c++/ref-1.C: New.

Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r259523
2018-04-20 13:46:07 +00:00
Thomas Schwinge 6e0d40b6f8 PR85463 '[nvptx] "exit" in offloaded region doesn't terminate process'
libgomp/
	PR libfortran/85166
	* testsuite/libgomp.oacc-fortran/abort-1.f90: Switch back to "call
	abort".
	* testsuite/libgomp.oacc-fortran/abort-2.f90: Likewise.

	libgfortran/
	PR libfortran/85166
	PR libgomp/85463
	* runtime/minimal.c (stop_numeric): Reimplement.
	(stop_string, error_stop_string, error_stop_numeric): New
	functions.
	libgomp/
	PR libgomp/85463
	* testsuite/libgomp.oacc-fortran/error_stop-1.f: New file.
	* testsuite/libgomp.oacc-fortran/error_stop-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/error_stop-3.f: Likewise.
	* testsuite/libgomp.oacc-fortran/stop-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/stop-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/stop-3.f: Likewise.

From-SVN: r259491
2018-04-19 10:53:38 +02:00
Jakub Jelinek a0e1df888d cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace --enable-cet=default with --enable-cet=auto.
* config/cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace
	--enable-cet=default with --enable-cet=auto.

	* doc/install.texi: Document --disable-cet being the default and
	--enable-cet=auto.

	* configure: Regenerated.

From-SVN: r259487
2018-04-19 09:45:51 +02:00
David Malcolm 001ddaa852 re PR jit/85384 (libgccjit does not work if --with-gcc-major-version is used)
PR jit/85384
	* acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.

	* configure.ac (gcc-driver-name.h): Honor --with-gcc-major-version
	by using gcc_base_ver to generate a gcc_driver_version, and use
	it when generating GCC_DRIVER_NAME.
	* configure: Regenerate.

	* configure: Regenerate.

From-SVN: r259462
2018-04-18 11:46:58 +02:00
Cesar Philippidis 05e0af4386 [openacc] Fix ICE when compiling tile loop containing infinite loop
2018-04-16  Cesar Philippidis  <cesar@codesourcery.com>
	    Tom de Vries  <tom@codesourcery.com>

	PR middle-end/84955
	* omp-expand.c (expand_oacc_for): Add dummy false branch for
	tiled basic blocks without omp continue statements.

	* testsuite/libgomp.oacc-c-c++-common/pr84955.c: New test.
	* testsuite/libgomp.oacc-fortran/pr84955.f90: New test.

Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r259406
2018-04-16 18:01:09 +00:00
Thomas Koenig bc436e10e0 re PR fortran/83064 (DO CONCURRENT and auto-parallelization)
2018-04-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/83064
	PR testsuite/85346
	* trans-stmt.c (gfc_trans_forall_loop): Use annot_expr_ivdep_kind
	for annotation and remove dependence on -ftree-parallelize-loops.

2018-04-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/83064
	PR testsuite/85346
	* gfortran.dg/do_concurrent_5.f90: Dynamically allocate main work
	array and move test to libgomp/testsuite/libgomp.fortran.
	* gfortran.dg/do_concurrent_6.f90: New test.

2018-04-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/83064
	PR testsuite/85346
	* testsuite/libgomp.fortran/do_concurrent_5.f90: Move modified
	test from gfortran.dg to here.

From-SVN: r259359
2018-04-12 21:58:54 +00:00
Cesar Philippidis 6b95d1af3e Revert 259346.
gcc/
	* lto-streamer-out.c (output_function): Revert 259346.
	* omp-expand.c (expand_oacc_for): Likewise.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/pr84955.c: Revert 259346.
	* testsuite/libgomp.oacc-fortran/pr84955.f90:Likewise.

From-SVN: r259351
2018-04-12 11:48:56 -07:00
Cesar Philippidis 2e5efa6760 re PR middle-end/84955 (Incorrect OpenACC tile expansion)
PR middle-end/84955

	gcc/
	* lto-streamer-out.c (output_function): Fix CFG loop state before
	streaming out.
	* omp-expand.c (expand_oacc_for): Handle calls to internal
	functions like regular functions.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/pr84955.c: New test.
	* testsuite/libgomp.oacc-fortran/pr84955.f90: New test.

Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r259346
2018-04-12 06:15:45 -07:00
Tom de Vries 2ba16fd2eb [nvptx] Fix neutering of bb with only cond jump
2018-04-05  Tom de Vries  <tom@codesourcery.com>

	PR target/85204
	* config/nvptx/nvptx.c (nvptx_single): Fix neutering of bb with only
	cond jump.

	* testsuite/libgomp.oacc-c-c++-common/broadcast-1.c: New test.

From-SVN: r259125
2018-04-05 08:36:37 +00:00
Tom de Vries 46dbeb4085 Fix switch conversion in offloading functions
2018-03-26  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/85063
	* omp-general.c (offloading_function_p): New function.  Factor out
	of ...
	* omp-offload.c (pass_omp_target_link::gate): ... here.
	* omp-general.h (offloading_function_p): Declare.
	* tree-switch-conversion.c (build_one_array): Mark CSWTCH.x variable
	with attribute omp declare target for offloading functions.

	* testsuite/libgomp.c/switch-conversion-2.c: New test.
	* testsuite/libgomp.c/switch-conversion.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/switch-conversion-2.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/switch-conversion.c: New test.

From-SVN: r258852
2018-03-26 09:45:49 +00:00
Thomas Koenig bfc24e32b9 re PR fortran/84381 (replace non-std 'call abort' by 'stop 1' in gfortran testsuite)
2018-03-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/84381
	* testsuite/libgomp.fortran/aligned1.f03: Replace non-standard
	call abort by STOP n.
	* testsuite/libgomp.fortran/alloc-comp-1.f90: Likewise.
	* testsuite/libgomp.fortran/alloc-comp-2.f90: Likewise.
	* testsuite/libgomp.fortran/alloc-comp-3.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable1.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable10.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable11.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable12.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable2.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable3.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable4.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable5.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable6.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable7.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable8.f90: Likewise.
	* testsuite/libgomp.fortran/allocatable9.f90: Likewise.
	* testsuite/libgomp.fortran/appendix-a/a.18.1.f90: Likewise.
	* testsuite/libgomp.fortran/appendix-a/a.19.1.f90: Likewise.
	* testsuite/libgomp.fortran/associate1.f90: Likewise.
	* testsuite/libgomp.fortran/associate2.f90: Likewise.
	* testsuite/libgomp.fortran/associate3.f90: Likewise.
	* testsuite/libgomp.fortran/cancel-do-1.f90: Likewise.
	* testsuite/libgomp.fortran/cancel-do-2.f90: Likewise.
	* testsuite/libgomp.fortran/cancel-parallel-1.f90: Likewise.
	* testsuite/libgomp.fortran/cancel-sections-1.f90: Likewise.
	* testsuite/libgomp.fortran/cancel-taskgroup-2.f90: Likewise.
	* testsuite/libgomp.fortran/character1.f90: Likewise.
	* testsuite/libgomp.fortran/character2.f90: Likewise.
	* testsuite/libgomp.fortran/collapse1.f90: Likewise.
	* testsuite/libgomp.fortran/collapse2.f90: Likewise.
	* testsuite/libgomp.fortran/collapse3.f90: Likewise.
	* testsuite/libgomp.fortran/collapse4.f90: Likewise.
	* testsuite/libgomp.fortran/crayptr1.f90: Likewise.
	* testsuite/libgomp.fortran/crayptr2.f90: Likewise.
	* testsuite/libgomp.fortran/crayptr3.f90: Likewise.
	* testsuite/libgomp.fortran/declare-simd-1.f90: Likewise.
	* testsuite/libgomp.fortran/declare-simd-3.f90: Likewise.
	* testsuite/libgomp.fortran/declare-target-2.f90: Likewise.
	* testsuite/libgomp.fortran/depend-1.f90: Likewise.
	* testsuite/libgomp.fortran/depend-2.f90: Likewise.
	* testsuite/libgomp.fortran/depend-3.f90: Likewise.
	* testsuite/libgomp.fortran/do1.f90: Likewise.
	* testsuite/libgomp.fortran/do2.f90: Likewise.
	* testsuite/libgomp.fortran/doacross1.f90: Likewise.
	* testsuite/libgomp.fortran/doacross2.f90: Likewise.
	* testsuite/libgomp.fortran/doacross3.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/array_sections-3.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/array_sections-4.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/async_target-1.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/async_target-2.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/declare_target-1.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/declare_target-2.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/declare_target-3.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/declare_target-4.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/declare_target-5.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/device-1.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/device-2.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/device-3.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/simd-1.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/simd-2.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/simd-3.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/simd-4.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/simd-5.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/simd-6.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/simd-7.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/simd-8.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target-1.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target-2.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target-3.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target-4.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target-5.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target_data-1.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target_data-2.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target_data-3.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target_data-4.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target_data-5.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target_data-6.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target_data-7.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target_update-1.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/target_update-2.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/task_dep-1.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/task_dep-2.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/task_dep-3.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/task_dep-4.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/task_dep-5.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/teams-2.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/teams-3.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/teams-4.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/teams-5.f90: Likewise.
	* testsuite/libgomp.fortran/examples-4/teams-6.f90: Likewise.
	* testsuite/libgomp.fortran/lastprivate1.f90: Likewise.
	* testsuite/libgomp.fortran/lastprivate2.f90: Likewise.
	* testsuite/libgomp.fortran/lib1.f90: Likewise.
	* testsuite/libgomp.fortran/lib2.f: Likewise.
	* testsuite/libgomp.fortran/lib3.f: Likewise.
	* testsuite/libgomp.fortran/lib4.f90: Likewise.
	* testsuite/libgomp.fortran/lock-1.f90: Likewise.
	* testsuite/libgomp.fortran/lock-2.f90: Likewise.
	* testsuite/libgomp.fortran/nested1.f90: Likewise.
	* testsuite/libgomp.fortran/nestedfn1.f90: Likewise.
	* testsuite/libgomp.fortran/nestedfn2.f90: Likewise.
	* testsuite/libgomp.fortran/nestedfn3.f90: Likewise.
	* testsuite/libgomp.fortran/nestedfn4.f90: Likewise.
	* testsuite/libgomp.fortran/nestedfn5.f90: Likewise.
	* testsuite/libgomp.fortran/omp_atomic1.f90: Likewise.
	* testsuite/libgomp.fortran/omp_atomic2.f90: Likewise.
	* testsuite/libgomp.fortran/omp_atomic3.f90: Likewise.
	* testsuite/libgomp.fortran/omp_atomic4.f90: Likewise.
	* testsuite/libgomp.fortran/omp_atomic5.f90: Likewise.
	* testsuite/libgomp.fortran/omp_cond1.f: Likewise.
	* testsuite/libgomp.fortran/omp_cond2.f: Likewise.
	* testsuite/libgomp.fortran/omp_cond3.F90: Likewise.
	* testsuite/libgomp.fortran/omp_cond4.F90: Likewise.
	* testsuite/libgomp.fortran/omp_parse1.f90: Likewise.
	* testsuite/libgomp.fortran/omp_parse2.f90: Likewise.
	* testsuite/libgomp.fortran/omp_parse3.f90: Likewise.
	* testsuite/libgomp.fortran/omp_parse4.f90: Likewise.
	* testsuite/libgomp.fortran/openmp_version-1.f: Likewise.
	* testsuite/libgomp.fortran/openmp_version-2.f90: Likewise.
	* testsuite/libgomp.fortran/parloops-exit-first-loop-alt-2.f95: Likewise.
	* testsuite/libgomp.fortran/parloops-exit-first-loop-alt.f95: Likewise.
	* testsuite/libgomp.fortran/pointer1.f90: Likewise.
	* testsuite/libgomp.fortran/pointer2.f90: Likewise.
	* testsuite/libgomp.fortran/pr25162.f: Likewise.
	* testsuite/libgomp.fortran/pr25219.f90: Likewise.
	* testsuite/libgomp.fortran/pr27395-1.f90: Likewise.
	* testsuite/libgomp.fortran/pr27395-2.f90: Likewise.
	* testsuite/libgomp.fortran/pr27416-1.f90: Likewise.
	* testsuite/libgomp.fortran/pr27916-1.f90: Likewise.
	* testsuite/libgomp.fortran/pr27916-2.f90: Likewise.
	* testsuite/libgomp.fortran/pr28390.f: Likewise.
	* testsuite/libgomp.fortran/pr29629.f90: Likewise.
	* testsuite/libgomp.fortran/pr32550.f90: Likewise.
	* testsuite/libgomp.fortran/pr33880.f90: Likewise.
	* testsuite/libgomp.fortran/pr34020.f90: Likewise.
	* testsuite/libgomp.fortran/pr35130.f90: Likewise.
	* testsuite/libgomp.fortran/pr42162.f90: Likewise.
	* testsuite/libgomp.fortran/pr46753.f90: Likewise.
	* testsuite/libgomp.fortran/pr48894.f90: Likewise.
	* testsuite/libgomp.fortran/pr49792-1.f90: Likewise.
	* testsuite/libgomp.fortran/pr49792-2.f90: Likewise.
	* testsuite/libgomp.fortran/pr63938-1.f90: Likewise.
	* testsuite/libgomp.fortran/pr63938-2.f90: Likewise.
	* testsuite/libgomp.fortran/pr65597.f90: Likewise.
	* testsuite/libgomp.fortran/pr66199-1.f90: Likewise.
	* testsuite/libgomp.fortran/pr71014.f90: Likewise.
	* testsuite/libgomp.fortran/pr81304.f90: Likewise.
	* testsuite/libgomp.fortran/pr81841.f90: Likewise.
	* testsuite/libgomp.fortran/pr84418-1.f90: Likewise.
	* testsuite/libgomp.fortran/pr84418-2.f90: Likewise.
	* testsuite/libgomp.fortran/procptr1.f90: Likewise.
	* testsuite/libgomp.fortran/recursion1.f90: Likewise.
	* testsuite/libgomp.fortran/reduction1.f90: Likewise.
	* testsuite/libgomp.fortran/reduction2.f90: Likewise.
	* testsuite/libgomp.fortran/reduction3.f90: Likewise.
	* testsuite/libgomp.fortran/reduction4.f90: Likewise.
	* testsuite/libgomp.fortran/reduction5.f90: Likewise.
	* testsuite/libgomp.fortran/reduction6.f90: Likewise.
	* testsuite/libgomp.fortran/reference1.f90: Likewise.
	* testsuite/libgomp.fortran/reference2.f90: Likewise.
	* testsuite/libgomp.fortran/retval1.f90: Likewise.
	* testsuite/libgomp.fortran/retval2.f90: Likewise.
	* testsuite/libgomp.fortran/sharing1.f90: Likewise.
	* testsuite/libgomp.fortran/sharing2.f90: Likewise.
	* testsuite/libgomp.fortran/simd1.f90: Likewise.
	* testsuite/libgomp.fortran/simd2.f90: Likewise.
	* testsuite/libgomp.fortran/simd3.f90: Likewise.
	* testsuite/libgomp.fortran/simd4.f90: Likewise.
	* testsuite/libgomp.fortran/simd5.f90: Likewise.
	* testsuite/libgomp.fortran/simd6.f90: Likewise.
	* testsuite/libgomp.fortran/simd7.f90: Likewise.
	* testsuite/libgomp.fortran/stack.f90: Likewise.
	* testsuite/libgomp.fortran/strassen.f90: Likewise.
	* testsuite/libgomp.fortran/tabs1.f90: Likewise.
	* testsuite/libgomp.fortran/tabs2.f: Likewise.
	* testsuite/libgomp.fortran/target1.f90: Likewise.
	* testsuite/libgomp.fortran/target2.f90: Likewise.
	* testsuite/libgomp.fortran/target3.f90: Likewise.
	* testsuite/libgomp.fortran/target4.f90: Likewise.
	* testsuite/libgomp.fortran/target5.f90: Likewise.
	* testsuite/libgomp.fortran/target6.f90: Likewise.
	* testsuite/libgomp.fortran/target7.f90: Likewise.
	* testsuite/libgomp.fortran/target8.f90: Likewise.
	* testsuite/libgomp.fortran/task1.f90: Likewise.
	* testsuite/libgomp.fortran/task2.f90: Likewise.
	* testsuite/libgomp.fortran/task3.f90: Likewise.
	* testsuite/libgomp.fortran/task4.f90: Likewise.
	* testsuite/libgomp.fortran/taskgroup1.f90: Likewise.
	* testsuite/libgomp.fortran/taskloop1.f90: Likewise.
	* testsuite/libgomp.fortran/taskloop2.f90: Likewise.
	* testsuite/libgomp.fortran/taskloop3.f90: Likewise.
	* testsuite/libgomp.fortran/taskloop4.f90: Likewise.
	* testsuite/libgomp.fortran/threadprivate1.f90: Likewise.
	* testsuite/libgomp.fortran/threadprivate2.f90: Likewise.
	* testsuite/libgomp.fortran/threadprivate3.f90: Likewise.
	* testsuite/libgomp.fortran/threadprivate4.f90: Likewise.
	* testsuite/libgomp.fortran/udr1.f90: Likewise.
	* testsuite/libgomp.fortran/udr10.f90: Likewise.
	* testsuite/libgomp.fortran/udr11.f90: Likewise.
	* testsuite/libgomp.fortran/udr12.f90: Likewise.
	* testsuite/libgomp.fortran/udr13.f90: Likewise.
	* testsuite/libgomp.fortran/udr14.f90: Likewise.
	* testsuite/libgomp.fortran/udr15.f90: Likewise.
	* testsuite/libgomp.fortran/udr2.f90: Likewise.
	* testsuite/libgomp.fortran/udr3.f90: Likewise.
	* testsuite/libgomp.fortran/udr4.f90: Likewise.
	* testsuite/libgomp.fortran/udr5.f90: Likewise.
	* testsuite/libgomp.fortran/udr6.f90: Likewise.
	* testsuite/libgomp.fortran/udr7.f90: Likewise.
	* testsuite/libgomp.fortran/udr8.f90: Likewise.
	* testsuite/libgomp.fortran/udr9.f90: Likewise.
	* testsuite/libgomp.fortran/vla1.f90: Likewise.
	* testsuite/libgomp.fortran/vla2.f90: Likewise.
	* testsuite/libgomp.fortran/vla3.f90: Likewise.
	* testsuite/libgomp.fortran/vla4.f90: Likewise.
	* testsuite/libgomp.fortran/vla5.f90: Likewise.
	* testsuite/libgomp.fortran/vla6.f90: Likewise.
	* testsuite/libgomp.fortran/vla7.f90: Likewise.
	* testsuite/libgomp.fortran/vla8.f90: Likewise.
	* testsuite/libgomp.fortran/workshare1.f90: Likewise.
	* testsuite/libgomp.fortran/workshare2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/abort-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/abort-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/acc_on_device-1-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/acc_on_device-1-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/acc_on_device-1-3.f: Likewise.
	* testsuite/libgomp.oacc-fortran/asyncwait-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/asyncwait-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/asyncwait-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/atomic_capture-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/atomic_rw-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/atomic_update-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/c2.pl: Likewise.
	* testsuite/libgomp.oacc-fortran/clauses-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/collapse-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/collapse-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/collapse-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/collapse-4.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/collapse-5.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/collapse-6.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/collapse-7.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/collapse-8.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/combined-directives-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/combined-reduction.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/data-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/data-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/data-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/data-4-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/data-4.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/declare-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/declare-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/declare-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/declare-4.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/declare-5.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/default-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/firstprivate-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/gang-static-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/host_data-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/if-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/implicit-firstprivate-ref.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-2.f95: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-data.f95: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop.f95: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-10.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-3.f: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-32-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-32-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-4.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-5.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-6.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-7.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-8.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/map-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/nested-function-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/nested-function-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/nested-function-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/non-scalar-data.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/openacc_version-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/openacc_version-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/par-reduction-2-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/par-reduction-2-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/pointer-align-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/pr70643.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/pr81352.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/pr83920.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/pr84028.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/private-variables.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/pset-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-7.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-8.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/routine-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/routine-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/routine-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/routine-4.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/routine-5.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/routine-7.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/routine-9.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/subarrays-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/subarrays-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/update-1.f90: Likewise.

From-SVN: r258846
2018-03-25 16:00:52 +00:00
Richard Biener 79cf14ae15 force-parallel-4.c: XFAIL one parallelizable loop.
2018-03-20  Richard Biener  <rguenther@suse.de>

	* testsuite/libgomp.graphite/force-parallel-4.c: XFAIL one
	parallelizable loop.

From-SVN: r258679
2018-03-20 12:42:59 +00:00
Igor Tsimbalist 14e335edc8 CET shouldn't be enabled in 32-bit run-time libraries by defualt
ENDBR32 and RDSSPD are multi-byte NOPs on x86-64 processors and
newer x86 processors, starting Pentium Pro.  They are UD on older
32-bit processors. Detect this at configure time and adjust the
default value for enable_cet. GCC will enable CET in 32-bit run-time
libraries in any case if --enable-cet is used to configure GCC.

	PR target/84148
	* config/cet.m4: Check if target support multi-byte NOPS (SSE).
	* libatomic/configure: Regenerate.
	* libbacktrace/configure: Likewise.
	* libgcc/configure: Likewise.
	* libgfortran/configure: Likewise.
	* libgomp/configure: Likewise.
	* libitm/configure: Likewise.
	* libmpx/configure: Likewise.
	* libobjc/configure: Likewise.
	* libquadmath/configure: Likewise.
	* libsanitizer/configure: Likewise.
	* libssp/configure: Likewise.
	* libstdc++-v3/configure: Likewise.
	* libvtv/configure: Likewise.

From-SVN: r257809
2018-02-19 17:25:49 +01:00
Jakub Jelinek 83d9be5581 re PR fortran/84418 (ICE with fortran OpenMP linear (ref ()) clause)
PR fortran/84418
	* trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF
	kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step.

	* libgomp.fortran/pr84418-1.f90: New test.
	* libgomp.fortran/pr84418-2.f90: New test.

From-SVN: r257771
2018-02-16 23:40:32 +01:00
Jakub Jelinek d1fe612461 re PR fortran/84313 ([F08] reject procedure pointers in COMMON blocks)
PR fortran/84313
	* testsuite/libgomp.fortran/threadprivate4.f90: Add
	-std=f2003 -fall-intrinsics into dg-additional-options.

From-SVN: r257654
2018-02-14 13:12:15 +01:00
Martin Jambor 3d2249215e [hsa] Fix PR82416 testcase
2018-02-08  Martin Jambor  <mjambor@suse.cz>

	* testsuite/libgomp.hsa.c/pr82416.c: Make the function with target
	clonable.

From-SVN: r257485
2018-02-08 14:06:26 +01:00
Martin Jambor c7c30edd4a [hsa] Set program allocation for static local variables
2018-02-08  Martin Jambor  <mjambor@suse.cz>

	* hsa-gen.c (get_symbol_for_decl): Set program allocation for
	static local variables.

libgomp/
	* testsuite/libgomp.hsa.c/staticvar.c: New test.

From-SVN: r257484
2018-02-08 14:03:52 +01:00
Rainer Orth f320fdfd22 Fix libgomp.oacc-c-c++-common/pr84217.c for C++
* testsuite/libgomp.oacc-c-c++-common/pr84217.c (abort)
	[__cplusplus]: Declare extern "C".

From-SVN: r257457
2018-02-07 19:32:21 +00:00
Tom de Vries c31bc4ac37 [openacc] Fix diff_type in expand_oacc_collapse_init
2018-02-07  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/84217
	* omp-expand.c (expand_oacc_collapse_init): Ensure diff_type is large
	enough.

	* c-c++-common/goacc/pr84217.c: New test.
	* gfortran.dg/goacc/pr84217.f90: New test.

	* testsuite/libgomp.oacc-c-c++-common/pr84217.c: New test.

From-SVN: r257443
2018-02-07 10:37:55 +00:00
Christoph Spiel 99ae7ce5ca re PR libgomp/84096 (Wrong prototype for omp_init_nest_lock_with_hint() in "omp.h.in")
PR libgomp/84096
	* omp.h.in (omp_init_nest_lock_with_hint): Use omp_nest_lock_t
	instead of omp_lock_t.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r257167
2018-01-30 00:38:01 +01:00
Tom de Vries e77a1236a7 [nvptx, PR84028] Add exit insn after noreturn call for neutered workers
2018-01-25  Tom de Vries  <tom@codesourcery.com>

	PR target/84028
	* config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
	for neutered workers.

	* testsuite/libgomp.oacc-fortran/pr84028.f90: New test.

From-SVN: r257046
2018-01-25 10:25:14 +00:00
Tom de Vries 3dede32b88 [nvptx, PR83589] Workaround for branch-around-nothing JIT bug
2018-01-24  Tom de Vries  <tom@codesourcery.com>

	PR target/83589
	* config/nvptx/nvptx.c (WORKAROUND_PTXJIT_BUG_2): Define to 1.
	(nvptx_pc_set, nvptx_condjump_label): New function. Copy from jump.c.
	Add strict parameter.
	(prevent_branch_around_nothing): Insert dummy insn between branch to
	label and label with no ptx insn inbetween.
	* config/nvptx/nvptx.md (define_insn "fake_nop"): New insn.

	* testsuite/libgomp.oacc-c-c++-common/pr83589.c: New test.

From-SVN: r257016
2018-01-24 13:52:12 +00:00
Tom de Vries be606483c9 [nvptx, PR81352] Add exit insn after noreturn call for neutered threads in warp
2018-01-24  Tom de Vries  <tom@codesourcery.com>

	PR target/81352
	* config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
	for neutered threads in warp.
	* config/nvptx/nvptx.md (define_insn "exit"): New insn.

	* testsuite/libgomp.oacc-fortran/pr81352.f90: New test.

From-SVN: r257014
2018-01-24 11:27:10 +00:00
Tom de Vries 8c8e9a6bb6 [nvptx] Fix bug in jit bug workaround
2018-01-19  Tom de Vries  <tom@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>

	PR target/83920

	* config/nvptx/nvptx.c (nvptx_single): Fix jit workaround.

	* testsuite/libgomp.oacc-c-c++-common/pr83920.c: New test.
	* testsuite/libgomp.oacc-fortran/pr83920.f90: New test.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>

From-SVN: r256894
2018-01-19 16:29:41 +00:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Jakub Jelinek 65e6aea386 gcc.c (process_command): Update copyright notice dates.
gcc/
	* gcc.c (process_command): Update copyright notice dates.
	* gcov-dump.c (print_version): Ditto.
	* gcov.c (print_version): Ditto.
	* gcov-tool.c (print_version): Ditto.
	* gengtype.c (create_file): Ditto.
	* doc/cpp.texi: Bump @copying's copyright year.
	* doc/cppinternals.texi: Ditto.
	* doc/gcc.texi: Ditto.
	* doc/gccint.texi: Ditto.
	* doc/gcov.texi: Ditto.
	* doc/install.texi: Ditto.
	* doc/invoke.texi: Ditto.
gcc/fortran/
	* gfortranspec.c (lang_specific_driver): Update copyright notice
	dates.
	* gfc-internals.texi: Bump @copying's copyright year.
	* gfortran.texi: Ditto.
	* intrinsic.texi: Ditto.
	* invoke.texi: Ditto.
gcc/ada/
 	* gnat_ugn.texi: Bump @copying's copyright year.
 	* gnat_rm.texi: Likewise.
gcc/go/
	* gccgo.texi: Bump @copyrights-go year.
libitm/
	* libitm.texi: Bump @copying's copyright year.
libgomp/
	* libgomp.texi: Bump @copying's copyright year.
libquadmath/
	* libquadmath.texi: Bump @copying's copyright year.

From-SVN: r256166
2018-01-03 10:17:54 +01:00
Tom de Vries 60bf575ccb Prune removed funcs from offload table
2017-12-30  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/83046
	* omp-expand.c (expand_omp_target): If in_lto_p, mark offload_funcs with
	DECL_PRESERVE_P.
	* lto-streamer-out.c (prune_offload_funcs): New function.  Remove
	offload_funcs entries that no longer have a corresponding cgraph_node.
	Mark the remaining ones as DECL_PRESERVE_P.
	(output_lto): Call prune_offload_funcs.

	* testsuite/libgomp.oacc-c-c++-common/pr83046.c: New test.
	* testsuite/libgomp.c-c++-common/pr83046.c: New test.

From-SVN: r256045
2017-12-30 17:02:00 +00:00
Tom de Vries 7ec16b79f0 Workaround PR83046 in gang-static-2.c
2017-12-27  Tom de Vries  <tom@codesourcery.com>

	PR c++/83046
	* testsuite/libgomp.oacc-c-c++-common/gang-static-2.c (test_static)
	(test_nonstatic): Fix return type to workaround PR83046.

From-SVN: r256008
2017-12-27 07:50:04 +00:00
Jakub Jelinek ac550b9a0e re PR testsuite/83281 (libgomp.oacc-c-c++-common/reduction-cplx-flt.c and reduction-cplx-dbl.c fail starting with r255335)
PR testsuite/83281
	* testsuite/libgomp.oacc-c-c++-common/reduction-cplx-flt.c (main): Use
	j suffix instead of i.
	* testsuite/libgomp.oacc-c-c++-common/reduction-cplx-dbl.c (main):
	Likewise.

From-SVN: r255418
2017-12-05 14:34:41 +01:00
Cesar Philippidis ebdc83f0a8 Fix bug in an OpenACC async test case
libgomp/
	* testsuite/libgomp.oacc-c-c++-common/data-2-lib.c: Add missing
	call to acc_wait (1).

From-SVN: r255308
2017-12-01 06:26:07 -08:00
Jakub Jelinek 3b3e6283a4 re PR fortran/81304 (Bogus warning with -Wsurprising and -fopenmp: Type specified for intrinsic function 'min' / 'max')
PR fortran/81304
	* trans-openmp.c (gfc_trans_omp_array_reduction_or_udr): Set
	attr.implicit_type in intrinsic_sym to avoid undesirable warning.

	* testsuite/libgomp.fortran/pr81304.f90: New test.

From-SVN: r255144
2017-11-24 22:40:21 +01:00
Jakub Jelinek 3b575376fb re PR fortran/81841 (THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA)
PR fortran/81841
	* parse.c (parse_spec): Allow ST_OMP_THREADPRIVATE inside of
	BLOCK DATA.

	* libgomp.fortran/pr81841.f90: New test.

From-SVN: r255115
2017-11-23 21:16:38 +01:00
Jakub Jelinek b13547d821 re PR libgomp/83106 (libgomp/target.c:2671:2: error: ‘strncat’ specified bound 5 equals source length [-Werror=stringop-overflow=])
PR libgomp/83106
	* target.c (gomp_target_init): Compute lengths just once and
	use them in both malloc size and subsequent copying.

From-SVN: r255080
2017-11-22 21:49:56 +01:00
Igor Tsimbalist efe33ced33 Enable building libgomp with Intel CET
libgomp/
	* configure.ac: Set CET_FLAGS, update XCFLAGS and FCFLAGS.
	* acinclude.m4: Add cet.m4.
	* configure: Regenerate.
	* Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

From-SVN: r254894
2017-11-17 22:22:09 +01:00
Tom de Vries a7cf26127a Add libgomp.oacc-c-c++-common/f-asyncwait-{1,2,3}.c
2017-11-15  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-1.c: New test, copied
	from asyncwait-1.f90.  Rewrite into C.  Rewrite from float to int.
	* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-2.c: New test, copied
	from asyncwait-2.f90.  Rewrite into C.  Rewrite from float to int.
	* testsuite/libgomp.oacc-c-c++-common/f-asyncwait-3.c: New test, copied
	from asyncwait-3.f90.  Rewrite into C.  Rewrite from float to int.

From-SVN: r254769
2017-11-15 13:40:58 +00:00
Tom de Vries dde76623dd Allow asyncwait-1.c to run for non-nvidia devices
2017-11-14  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c: Allow to run for
	non-nvidia devices.

From-SVN: r254723
2017-11-14 09:12:14 +00:00
Jakub Jelinek 4dbeb71612 re PR c++/82835 (ICE on valid code with -fopenmp)
PR c++/82835
	* cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
	convert_default_arg instead of i.

	* testsuite/libgomp.c++/pr82835.C: New test.

From-SVN: r254511
2017-11-07 21:51:05 +01:00
Martin Liska 454f8b2b0c Fix -Wreturn-type fallout.
2017-11-06  Martin Liska  <mliska@suse.cz>

	* c-c++-common/cilk-plus/AN/pr57541-2.c (foo1): Return a value
	for functions with non-void return type, or change type to void,
	or add -Wno-return-type for test.
	(foo2): Likewise.
	* c-c++-common/cilk-plus/AN/pr57541.c (foo): Likewise.
	(foo1): Likewise.
	* c-c++-common/cilk-plus/CK/errors.c: Likewise.
	* c-c++-common/cilk-plus/CK/pr60197.c: Likewise.
	* c-c++-common/cilk-plus/CK/spawn_in_return.c: Likewise.
	* c-c++-common/fold-masked-cmp-1.c (test_pic): Likewise.
	(test_exe): Likewise.
	* c-c++-common/fold-masked-cmp-2.c (test_exe): Likewise.
	* g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.cc (my_func): Likewise.
	* g++.dg/cilk-plus/CK/pr68997.cc (fa2): Likewise.
	* g++.dg/eh/sighandle.C (dosegv): Likewise.
	* g++.dg/ext/vector14.C (foo): Likewise.
	(main): Likewise.
	* g++.dg/graphite/pr41305.C: Likewise.
	* g++.dg/graphite/pr42930.C: Likewise.
	* g++.dg/opt/pr46640.C (struct QBasicAtomicInt): Likewise.
	(makeDir): Likewise.
	* g++.dg/other/i386-8.C (foo): Likewise.
	* g++.dg/pr45788.C: Likewise.
	* g++.dg/pr64688.C (at_c): Likewise.
	* g++.dg/pr65032.C (G::DecodeVorbis): Likewise.
	* g++.dg/pr71633.C (c3::fn2): Likewise.
	* g++.dg/stackprotectexplicit2.C (A): Likewise.
	* g++.old-deja/g++.law/weak.C (main): Likewise.
2017-11-06  Martin Liska  <mliska@suse.cz>

	* testsuite/libgomp.c++/loop-2.C: Return a value
	for functions with non-void return type, or change type to void,
	or add -Wno-return-type for test.
	* testsuite/libgomp.c++/loop-4.C: Likewise.
	* testsuite/libgomp.c++/parallel-1.C: Likewise.
	* testsuite/libgomp.c++/shared-1.C: Likewise.
	* testsuite/libgomp.c++/single-1.C: Likewise.
	* testsuite/libgomp.c++/single-2.C: Likewise.
2017-11-06  Martin Liska  <mliska@suse.cz>

	* testsuite/27_io/basic_fstream/cons/char/path.cc (main):
	  Return a value for functions with non-void return type,
	  or change type to void, or add -Wno-return-type for test.
	* testsuite/27_io/basic_ifstream/cons/char/path.cc (main):
	Likewise.
	* testsuite/27_io/basic_ofstream/open/char/path.cc (main):
	Likewise.

From-SVN: r254451
2017-11-06 13:41:35 +00:00
Tom de Vries 12e9c8ce6c Remove semicolon after do {} while (false) in HSA_LOG
2017-10-31  Tom de Vries  <tom@codesourcery.com>

	* plugin/plugin-hsa.c (HSA_LOG): Remove semicolon after
	"do {} while (false)".
	(init_single_kernel, GOMP_OFFLOAD_async_run): Add missing semicolon
	after HSA_DEBUG call.

From-SVN: r254264
2017-10-31 12:56:41 +00:00
Jakub Jelinek 7324369a12 target.c (struct gomp_coalesce_buf): New type.
* target.c (struct gomp_coalesce_buf): New type.
	(MAX_COALESCE_BUF_SIZE, MAX_COALESCE_BUF_GAP): Define.
	(gomp_coalesce_buf_add, gomp_to_device_kind_p): New functions.
	(gomp_copy_host2dev): Add CBUF argument, if copying into
	the cached ranges, memcpy into buffer instead of copying
	into device.
	(gomp_map_vars_existing, gomp_map_pointer, gomp_map_fields_existing):
	Add CBUF argument, pass it through to other calls.
	(gomp_map_vars): Aggregate copies from host to device if small enough
	and with small enough gaps in between into memcpy into a buffer and
	fewer host to device copies from the buffer.
	(gomp_update): Adjust gomp_copy_host2dev caller.

From-SVN: r254194
2017-10-28 09:02:39 +02:00
Thomas Schwinge 933ab0e61c Restore "dg-do run" directives for libgomp.oacc-fortran/declare-*.f90
libgomp/
	* testsuite/libgomp.oacc-fortran/declare-1.f90: Restore "dg-do
	run" directive.
	* testsuite/libgomp.oacc-fortran/declare-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/declare-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/declare-4.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/declare-5.f90: Likewise.

From-SVN: r253808
2017-10-17 13:17:00 +02:00
Tom de Vries 92d5d01ac6 Enable libgomp.oacc-*/declare-*.{c,f90} for non-nvidia devices
2017-10-16  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/declare-1.c: Don't require
	openacc_nvidia_accel_selected.
	* testsuite/libgomp.oacc-c-c++-common/declare-2.c: Same.
	* testsuite/libgomp.oacc-c-c++-common/declare-4.c: Same.
	* testsuite/libgomp.oacc-fortran/declare-2.f90: Same.
	* testsuite/libgomp.oacc-fortran/declare-4.f90: Same
	* testsuite/libgomp.oacc-fortran/declare-5.f90: Same.
	* testsuite/libgomp.oacc-c-c++-common/declare-5.c: Don't require
	openacc_nvidia_accel_selected. Skip for shared memory device.
	* testsuite/libgomp.oacc-fortran/declare-1.f90: Same.
	* testsuite/libgomp.oacc-fortran/declare-3.f90: Same.

From-SVN: r253779
2017-10-16 08:44:42 +00:00
Martin Jambor 191411e43a [PR 82416] Do not extend operands to at least 32 bits
2017-10-09  Martin Jambor  <mjambor@suse.cz>

	PR hsa/82416
gcc/
	* hsa-common.h (hsa_op_with_type): New method extend_int_to_32bit.
	* hsa-gen.c (hsa_extend_inttype_to_32bit): New function.
	(hsa_type_for_scalar_tree_type): Use it.  Always force min32int for
	COMPLEX types.
	(hsa_fixup_mov_insn_type): New function.
	(hsa_op_with_type::get_in_type): Use it.
	(hsa_build_append_simple_mov): Likewise.  Allow sub-32bit
	immediates in an assert.
	(hsa_op_with_type::extend_int_to_32bit): New method.
	(gen_hsa_insns_for_bitfield): Fixup instruction and intermediary
	types.  Convert to dest type if necessary.
	(gen_hsa_insns_for_bitfield_load): Fixup load type if necessary.
	(reg_for_gimple_ssa): Pass false as min32int to
	hsa_type_for_scalar_tree_type.
	(gen_hsa_addr): Fixup type when creating addresable temporary.
	(gen_hsa_cmp_insn_from_gimple): Extend operands if necessary.
	(gen_hsa_unary_operation): Extend operands and convert to dest type if
	necessary.  Call hsa_fixup_mov_insn_type.
	(gen_hsa_binary_operation): Changed operand types to hsa_op_with_type,
	extend operands and convert to dest type if necessary.
	(gen_hsa_insns_for_operation_assignment): Extend operands and convert
	to dest type if necessary.
	(set_output_in_type): Call hsa_fixup_mov_insn_type.  Just ude dest
	if conversion nt necessary and size matches.
	(gen_hsa_insns_for_load): Call hsa_fixup_mov_insn_type, convert
	to dest type if necessary.
	(gen_hsa_insns_for_store): Call hsa_fixup_mov_insn_type.
	(gen_hsa_insns_for_switch_stmt): Likewise. Also extend operands if
	necessary.
	(gen_hsa_clrsb): Likewise.
	(gen_hsa_ffs): Likewise.
	(gen_hsa_divmod): Extend operands and convert to dest type if
	necessary.
	(gen_hsa_atomic_for_builtin): Change type of op to hsa_op_with_type.

libgomp/
	* testsuite/libgomp.hsa.c/pr82416.c: New test.

From-SVN: r253538
2017-10-09 11:41:44 +02:00
Tom de Vries e923330e1b Fix libgomp.oacc-fortran/{firstprivate-1,parallel-reduction}.f90 for non-nvidia devices
2017-10-07  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-fortran/firstprivate-1.f90 (firstprivate):
	Remove acc_device_nvidia references.
	* testsuite/libgomp.oacc-fortran/parallel-reduction.f90 (reduction):
	Same.

From-SVN: r253507
2017-10-07 08:46:00 +00:00
Tom de Vries 8fe3ed4c10 Fix libgomp.oacc-c-c++-common/{loop-red-g-1,routine-g-1}.c for non-nvidia devices
2017-10-05  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c (main): Remove
	vector_length(32) clause from acc parallel directive.
	* testsuite/libgomp.oacc-c-c++-common/routine-g-1.c (main): Same.

From-SVN: r253439
2017-10-05 08:31:46 +00:00
Tom de Vries 26596ee50d Fix openacc float reduction testcases
2017-10-04  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-3.c
	(main): Reduce sum of arr elements.  Assert that hres is exactly
	representable in 32-bit floating point.
	* testsuite/libgomp.oacc-c-c++-common/par-loop-comb-reduction-4.c
	(main): Reduce sum of arr elements.  Assert that hres and hmres are
	exactly representable in 32-bit floating point.
	* testsuite/libgomp.oacc-c-c++-common/reduction-7.c (gwv_np_4): Same.

From-SVN: r253398
2017-10-04 08:39:09 +00:00
Tom de Vries 5c561fa938 Remove superfluous -fopenmp from libgomp testcases
Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>

2017-09-28  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c++/for-12.C: Remove superfluous -fopenmp option
	setting.
	* testsuite/libgomp.c++/pr69393.C: Same.
	* testsuite/libgomp.c++/taskloop-1.C: Same.
	* testsuite/libgomp.c++/taskloop-3.C: Same.
	* testsuite/libgomp.c++/taskloop-4.C: Same.
	* testsuite/libgomp.c/for-4.c: Same.
	* testsuite/libgomp.c/pr66199-3.c: Same.
	* testsuite/libgomp.c/pr66199-4.c: Same.
	* testsuite/libgomp.c/pr66199-6.c: Same.
	* testsuite/libgomp.c/taskloop-1.c: Same.
	* testsuite/libgomp.c/taskloop-3.c: Same.
	* testsuite/libgomp.c/taskloop-4.c: Same.
	* testsuite/libgomp.fortran/aligned1.f03: Same.
	* testsuite/libgomp.fortran/condinc1.f: Same.
	* testsuite/libgomp.fortran/condinc3.f90: Same.
	* testsuite/libgomp.fortran/crayptr1.f90: Same.
	* testsuite/libgomp.fortran/crayptr2.f90: Same.
	* testsuite/libgomp.fortran/crayptr3.f90: Same.
	* testsuite/libgomp.fortran/omp_cond1.f: Same.
	* testsuite/libgomp.fortran/omp_cond3.F90: Same.
	* testsuite/libgomp.fortran/pr66199-1.f90: Same.
	* testsuite/libgomp.fortran/pr66199-2.f90: Same.
	* testsuite/libgomp.fortran/recursion1.f90: Same.
	* testsuite/libgomp.fortran/target2.f90: Same.
	* testsuite/libgomp.fortran/target5.f90: Same.
	* testsuite/libgomp.fortran/task3.f90: Same.

From-SVN: r253250
2017-09-28 09:32:00 +00:00
Tom de Vries 7d6206fe29 Fix libgomp.oacc-c-c++-common/loop-g-{1,2}.c for non-nvidia devices
2017-09-28  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/loop-g-1.c (main): Remove
	vector_length(32) clause from acc parallel directive.
	* testsuite/libgomp.oacc-c-c++-common/loop-g-2.c (main): Same.

From-SVN: r253249
2017-09-28 06:35:23 +00:00
Tom de Vries 84c8627ce0 Fix libgomp.oacc-c-c++-common/parallel-reduction.c for non-nvidia devices
2017-09-27  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c (main):
	Remove acc_device_nvidia references.

From-SVN: r253228
2017-09-27 12:35:54 +00:00
Tom de Vries ebc6a85e3e Fix condition folding in c_parser_omp_for_loop
2017-09-16  Tom de Vries  <tom@codesourcery.com>

	PR c/81875
	* c-parser.c (c_parser_omp_for_loop): Fold only operands of cond, not
	cond itself.

	* testsuite/libgomp.c-c++-common/pr81875.c: New test.

From-SVN: r252873
2017-09-16 13:11:43 +00:00
Tom de Vries 82419efbbf Introduce libgomp/testsuite/libgomp.c-c++-common
2017-09-14  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c++/cancel-taskgroup-1.C: Remove.
	* testsuite/libgomp.c/cancel-taskgroup-1.c: Move to ...
	* testsuite/libgomp.c-c++-common/cancel-taskgroup-1.c: ... here.
	* testsuite/libgomp.c/c.exp: Include test-cases from
	libgomp.c-c++-common.
	* testsuite/libgomp.c++/c++.exp: Same.  Force c++-mode compilation of .c
	files.

From-SVN: r252775
2017-09-14 21:15:40 +00:00
Jakub Jelinek 8b5865104c re PR c++/81314 (Undefined reference to a function with -fopenmp)
PR c++/81314
	* cp-gimplify.c (omp_var_to_track): Look through references.
	(omp_cxx_notice_variable): Likewise.

	* testsuite/libgomp.c++/pr81314.C: New test.

From-SVN: r252770
2017-09-14 22:18:17 +02:00
Gerald Pfeifer 9651fbafd1 libgomp.texi (Top): www.openacc.org now uses https.
* libgomp.texi (Top): www.openacc.org now uses https.
	(Enabling OpenACC): Ditto.
	(acc_get_num_devices): Ditto.
	(acc_set_device_type): Ditto.
	(acc_get_device_type): Ditto.
	(acc_set_device_num): Ditto.
	(acc_get_device_num): Ditto.
	(acc_async_test): Ditto.
	(acc_async_test_all): Ditto.
	(acc_wait): Ditto.
	(acc_wait_all): Ditto.
	(acc_wait_all_async): Ditto.
	(acc_wait_async): Ditto.
	(acc_init): Ditto.
	(acc_shutdown): Ditto.
	(acc_on_device): Ditto.
	(acc_malloc): Ditto.
	(acc_free): Ditto.
	(acc_copyin): Ditto.
	(acc_present_or_copyin): Ditto.
	(acc_create): Ditto.
	(acc_present_or_create): Ditto.
	(acc_copyout): Ditto.
	(acc_delete): Ditto.
	(acc_update_device): Ditto.
	(acc_update_self): Ditto.
	(acc_map_data): Ditto.
	(acc_unmap_data): Ditto.
	(acc_deviceptr): Ditto.
	(acc_hostptr): Ditto.
	(acc_is_present): Ditto.
	(acc_memcpy_to_device): Ditto.
	(acc_memcpy_from_device): Ditto.
	(acc_get_current_cuda_device): Ditto.
	(acc_get_current_cuda_context): Ditto.
	(acc_get_cuda_stream): Ditto.
	(acc_set_cuda_stream): Ditto.
	(ACC_DEVICE_TYPE): Ditto.
	(ACC_DEVICE_NUM): Ditto.
	(OpenACC Library Interoperability): Ditto.

From-SVN: r251888
2017-09-08 12:27:14 +00:00
Jakub Jelinek 50aa16c388 re PR c/81687 (Compiler drops label in OpenMP region)
PR c/81687
	* omp-low.c (omp_copy_decl): Don't remap FORCED_LABEL or DECL_NONLOCAL
	LABEL_DECLs.
	* tree-cfg.c (move_stmt_op): Don't adjust DECL_CONTEXT of FORCED_LABEL
	or DECL_NONLOCAL labels.
	(move_stmt_r) <case GIMPLE_LABEL>: Adjust DECL_CONTEXT of FORCED_LABEL
	or DECL_NONLOCAL labels here.

	* testsuite/libgomp.c/pr81687-1.c: New test.
	* testsuite/libgomp.c/pr81687-2.c: New test.

From-SVN: r251019
2017-08-10 02:33:20 +02:00
Jakub Jelinek 56b5041c02 re PR c/69389 (bit field incompatible with OpenMP atomic update)
PR c/69389
	* gimplify.c (goa_stabilize_expr): Handle BIT_INSERT_EXPR and
	BIT_FIELD_REF.

	* c-omp.c (c_finish_omp_atomic): Handle atomics on bitfields.

	* testsuite/libgomp.c/pr69389.c: New test.
	* testsuite/libgomp.c++/pr69389.C: New test.

From-SVN: r250929
2017-08-07 20:34:29 +02:00
Tom de Vries f4c222c035 Fix diff_type in expand_oacc_for char iter_type
2017-08-07  Tom de Vries  <tom@codesourcery.com>

	PR middle-end/78266
	* omp-expand.c (expand_oacc_for): Ensure diff_type is large enough.

	* testsuite/libgomp.oacc-c-c++-common/vprop-2.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/vprop.c: Remove xfail.

From-SVN: r250925
2017-08-07 17:06:11 +00:00
Jakub Jelinek a40ff0ae8b re PR c/45784 (gcc OpenMP - error: invalid controlling predicate)
PR c/45784
	* c-omp.c (c_finish_omp_for): If the condition is wrapped in
	rhs of COMPOUND_EXPR(s), skip them and readd their lhs into
	new COMPOUND_EXPRs around the rhs of the comparison.

	* testsuite/libgomp.c/pr45784.c: New test.
	* testsuite/libgomp.c++/pr45784.C: New test.

From-SVN: r250635
2017-07-27 21:13:42 +02:00
Tom de Vries 3717fbe35e Add v2di support for nvptx
2017-07-19  Tom de Vries  <tom@codesourcery.com>

	* config/nvptx/nvptx-modes.def: Add V2DImode.
	* config/nvptx/nvptx-protos.h (nvptx_data_alignment): Declare.
	* config/nvptx/nvptx.c (nvptx_ptx_type_from_mode): Handle V2DImode.
	(nvptx_output_mov_insn): Handle lack of mov.b128.
	(nvptx_print_operand): Handle 'H' and 'L' codes.
	(nvptx_vector_mode_supported): Allow V2DImode.
	(nvptx_preferred_simd_mode): New function.
	(nvptx_data_alignment): New function.
	(TARGET_VECTORIZE_PREFERRED_SIMD_MODE): Redefine to
	nvptx_preferred_simd_mode.
	* config/nvptx/nvptx.h (STACK_BOUNDARY, BIGGEST_ALIGNMENT): Change from
	64 to 128 bits.
	(DATA_ALIGNMENT): Define.  Set to nvptx_data_alignment.

	* config/nvptx/nvptx.md (VECIM): Add V2DI.

	* gcc.target/nvptx/decl-init.c: Update alignment.
	* gcc.target/nvptx/slp-2-run.c: New test.
	* gcc.target/nvptx/slp-2.c: New test.
	* gcc.target/nvptx/v2di.c: New test.

	* testsuite/libgomp.oacc-c/vec.c: New test.

From-SVN: r250341
2017-07-19 13:05:35 +00:00
Tom de Vries 9607b014b2 Fix secure_getenv.h include in plugin-hsa.c
2017-07-03  Tom de Vries  <tom@codesourcery.com>

	* plugin/plugin-hsa.c: Fix secure_getenv.h include.

From-SVN: r249918
2017-07-03 13:40:19 +00:00
Tom de Vries dfb15f6bbb Show value of GOMP_OPENACC_DIM in libgomp nvptx plugin
2017-06-27  Tom de Vries  <tom@codesourcery.com>

	* plugin/plugin-nvptx.c (notify_var): New function.
	(nvptx_exec): Use notify_var for GOMP_OPENACC_DIM.

From-SVN: r249695
2017-06-27 15:51:48 +00:00
Tom de Vries 22f1a03704 Use secure_getenv for GOMP_DEBUG
2017-06-27  Tom de Vries  <tom@codesourcery.com>

	* env.c (parse_unsigned_long_1): Factor out of ...
	(parse_unsigned_long): ... here.
	(parse_int_1): Factor out of ...
	(parse_int): ... here.
	(parse_int_secure): New function.
	(initialize_env): Use parse_int_secure for GOMP_DEBUG.
	* secure_getenv.h: Factor out of ...
	* plugin/plugin-hsa.c: ... here.
	* testsuite/libgomp.oacc-c-c++-common/gomp-debug-env.c: New test.

From-SVN: r249694
2017-06-27 15:51:37 +00:00
Jakub Jelinek d54d1fc3bc re PR c++/81130 (ICE OpenMP shared clause in gimplify_var_or_parm_decl, at gimplify.c:2584)
PR c++/81130
	* gimplify.c (omp_add_variable): Don't force GOVD_SEEN for types
	with ctors/dtors if GOVD_SHARED is set.

	* testsuite/libgomp.c++/pr81130.C: New test.

From-SVN: r249445
2017-06-21 12:58:00 +02:00
Rainer Orth 4f4b0ab85f Get rid of dg-skip-if etc. default args
libstdc++-v3:
	* testsuite: Remove dg-skip-if, dg-xfail-if, dg-xfail-run-if
	default args.

	libgomp:
	* testsuite/libgomp.fortran/strassen.f90: Remove dg-skip-if
	default args.
	* testsuite/libgomp.oacc-c-c++-common/vprop.c: Remove
	dg-xfail-run-if default args.

	gcc/testsuite:
	Remove dg-skip-if, dg-xfail-if, dg-xfail-run-if default args.

From-SVN: r249339
2017-06-17 15:32:28 +00:00
Bernd Edlinger 40ffd95f56 invoke.texi: Document the -Wsizeof-pointer-div warning.
gcc:
2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * doc/invoke.texi: Document the -Wsizeof-pointer-div warning.

gcc/c-family:
2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c.opt (Wsizeof-pointer-div): New warning option.

gcc/c:
2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-parser.c (c_parser_binary_expression): Implement the
        -Wsizeof_pointer_div warning.
        (c_parser_postfix_expression): Allow SIZEOF_EXPR as expr.original_code
        from a parenthesized expression.
        (c_parser_expr_list): Use c_last_sizeof_loc.
        * c-tree.h (c_last_sizeof_loc): New external.
        * c-typeck.c (c_last_sizeof_loc): New variable.
        (c_expr_sizeof_expr, c_expr_sizeof_type): Assign c_last_sizeof_loc.

gcc/cp:
2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
        warning.

gcc/testsuite:
2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-c++-common/Wsizeof-pointer-div.c: New test. 
        * gcc.dg/Wsizeof-pointer-memaccess1.c: Add test cases with parens.
        * gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Likewise.
        * gcc.target/i386/sse-init-v4hi-1.c: Fix test case.
        * gcc.target/i386/sse-init-v4sf-1.c: Likewise.
        * gcc.target/i386/sse-set-ps-1.c: Likewise.
        * gcc.target/i386/sse2-init-v16qi-1.c: Likewise.
        * gcc.target/i386/sse2-init-v2di-1.c: Likewise.
        * gcc.target/i386/sse2-init-v4si-1.c: Likewise.
        * gcc.target/i386/sse2-init-v8hi-1.c: Likewise.
        * gcc.target/i386/sse2-set-epi32-1.c: Likewise.
        * gcc.target/i386/sse2-set-epi64x-1.c: Likewise.
        * gcc.target/i386/sse4_1-init-v16qi-1.c: Likewise.
        * gcc.target/i386/sse4_1-init-v2di-1.c: Likewise.
        * gcc.target/i386/sse4_1-init-v4sf-1.c: Likewise.
        * gcc.target/i386/sse4_1-init-v4si-1.c: Likewise.
        * gcc.target/i386/sse4_1-set-epi32-1.c: Likewise.
        * gcc.target/i386/sse4_1-set-epi64x-1.c: Likewise.
        * gcc.target/i386/sse4_1-set-ps-1.c: Likewise.
        * libgomp.c/pr39591-2.c: Likewise.
        * libgomp.c/pr39591-3.c: Likewise.

From-SVN: r248811
2017-06-02 04:06:59 +00:00
Jakub Jelinek 01275e1e5a re PR libgomp/80822 (libgomp incorrect affinity when OMP_PLACES=threads)
PR libgomp/80822
	* config/linux/affinity.c (gomp_affinity_init_level_1): New function.
	(gomp_affinity_init_level): Use it.  Always analyze the core and thread
	sibling lists, depending on level just pick up what CPUs to put
	together into a place vs. whether add multiple ordered places.

From-SVN: r248683
2017-05-30 14:05:30 +02:00
Thomas Schwinge 7ce6440371 OpenACC 1.0 compatibility: acc_async_wait, acc_async_wait_all
libgomp/
	* openacc.h (acc_async_wait, acc_async_wait_all): New prototypes.
	* libgomp.map (OACC_2.0.1): Add these.
	* oacc-async.c (acc_async_wait, acc_async_wait_all): New aliases
	for "acc_wait", and "acc_wait_all", respectively.
	* openacc.f90 (acc_async_wait, acc_async_wait_all): New interfaces
	for "acc_wait", and "acc_wait_all", respectively.
	* openacc_lib.h (acc_async_wait, acc_async_wait_all): Likewise.
	* libgomp.texi (acc_wait, acc_wait_all): Update.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Update.
	* testsuite/libgomp.oacc-fortran/par-reduction-2-1.f: New file.
	* testsuite/libgomp.oacc-fortran/par-reduction-2-2.f: Likewise.

From-SVN: r248413
2017-05-24 15:25:01 +02:00
Thomas Schwinge 318686c21a Fortran OpenACC "openacc_lib.h": acc_pcopyin, acc_pcreate
libgomp/
	* openacc_lib.h (acc_pcopyin, acc_pcreate): Route to
	acc_present_or_copyin and acc_present_or_create procedures,
	respectively.
	* testsuite/libgomp.oacc-fortran/lib-32-1.f: Exercise these, and
	generally different variants of OpenACC Runtime Library functions.
	* testsuite/libgomp.oacc-fortran/lib-32-2.f: Likewise.

From-SVN: r248412
2017-05-24 15:23:55 +02:00
Thomas Schwinge a674553480 Translate libgomp.oacc-c-c++-common/lib-32.c into Fortran
libgomp/
	* testsuite/libgomp.oacc-fortran/lib-32-1.f: New file.
	* testsuite/libgomp.oacc-fortran/lib-32-2.f: Likewise.

From-SVN: r248411
2017-05-24 15:23:45 +02:00
Thomas Schwinge 9b94fbc7e4 C/C++ OpenACC: acc_pcopyin, acc_pcreate
libgomp/
	* openacc.h (acc_pcopyin, acc_pcreate): Provide prototypes instead
	of preprocessor definitions.
	* libgomp.h (strong_alias): Guard by "#ifdef
	HAVE_ATTRIBUTE_ALIAS".
	* oacc-mem.c: Provide "acc_pcreate" as alias for
	"acc_present_or_create", and "acc_pcopyin" as alias for
	"acc_present_or_copyin".
	* libgomp.map: New version "OACC_2.0.1".
	(OACC_2.0.1): Add "acc_pcopyin", and "acc_pcreate".
	* testsuite/libgomp.oacc-c-c++-common/lib-38.c: Remove, merging
	its content into...
	* testsuite/libgomp.oacc-c-c++-common/lib-32.c: ... this file.
	Extend testing.

From-SVN: r248410
2017-05-24 15:23:34 +02:00
Thomas Schwinge 78672bd8fd libgomp nvptx plugin: Debugging output when disabling nvptx offloading
libgomp/
	* plugin/plugin-nvptx.c (nvptx_get_num_devices): Debugging output
	when disabling nvptx offloading.

From-SVN: r248400
2017-05-24 08:59:05 +02:00
Thomas Schwinge fd71a9a24d OpenACC 2.5 kernels construct: num_gangs, num_workers, vector_length clauses
gcc/c/
	* c-parser.c (OACC_KERNELS_CLAUSE_MASK): Add
	"PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
	"VECTOR_LENGTH".
	gcc/cp/
	* parser.c (OACC_KERNELS_CLAUSE_MASK): Add
	"PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
	"VECTOR_LENGTH".
	gcc/fortran/
	* openmp.c (OACC_KERNELS_CLAUSES): Add "OMP_CLAUSE_NUM_GANGS",
	"OMP_CLAUSE_NUM_WORKERS", "OMP_CLAUSE_VECTOR_LENGTH".
	gcc/
	* omp-offload.c (execute_oacc_device_lower): Remove the
	parallelism dimensions function attributes for unparallelized
	OpenACC kernels constructs.
	gcc/testsuite/
	* c-c++-common/goacc/parallel-dims-1.c: Update.
	* c-c++-common/goacc/parallel-dims-2.c: Likewise.
	* c-c++-common/goacc/routine-1.c: Likewise.
	* c-c++-common/goacc/uninit-dim-clause.c: Likewise.
	* g++.dg/goacc/template.C: Likewise.
	* gfortran.dg/goacc/kernels-tree.f95: Likewise.
	* gfortran.dg/goacc/routine-3.f90: Likewise.
	* gfortran.dg/goacc/sie.f95: Likewise.
	* gfortran.dg/goacc/uninit-dim-clause.f95: Likewise.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-2.c: Update.
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-2.f95: Likewise.

From-SVN: r248370
2017-05-23 17:47:32 +02:00
Thomas Schwinge 0c36d0d571 Runtime checking of OpenACC parallelism dimensions clauses
libgomp/
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Rewrite.
	* testsuite/lib/libgomp.exp
	(check_effective_target_openacc_nvidia_accel_configured): New
	proc.
	* testsuite/libgomp.oacc-c++/c++.exp (check_effective_target_c)
	(check_effective_target_c++): New procs.
	* testsuite/libgomp.oacc-c/c.exp (check_effective_target_c)
	(check_effective_target_c++): Likewise.

From-SVN: r248358
2017-05-23 11:16:05 +02:00
Jakub Jelinek 655e52652b re PR middle-end/80809 (Multi-free error for variable size array used within OpenMP task)
PR middle-end/80809
	* omp-low.c (finish_taskreg_remap): New function.
	(finish_taskreg_scan): If unit size of ctx->record_type
	is non-constant, unshare the size expression and replace
	decls in it with possible outer var refs.

	* testsuite/libgomp.c/pr80809-2.c: New test.
	* testsuite/libgomp.c/pr80809-3.c: New test.

From-SVN: r248346
2017-05-22 20:54:54 +02:00
Jakub Jelinek e9e2ef9f2f re PR middle-end/80809 (Multi-free error for variable size array used within OpenMP task)
PR middle-end/80809
	* gimplify.c (omp_add_variable): For GOVD_DEBUG_PRIVATE use
	GOVD_SHARED rather than GOVD_PRIVATE with it.
	(gimplify_adjust_omp_clauses_1, gimplify_adjust_omp_clauses): Expect
	GOVD_SHARED rather than GOVD_PRIVATE with GOVD_DEBUG_PRIVATE.

	* testsuite/libgomp.c/pr80809-1.c: New test.

From-SVN: r248345
2017-05-22 20:54:05 +02:00
Jakub Jelinek c24783c499 re PR middle-end/80853 (OpenMP ICE in build_outer_var_ref with array reduction)
PR middle-end/80853
	* omp-low.c (lower_reduction_clauses): Pass OMP_CLAUSE_PRIVATE
	as last argument to build_outer_var_ref for pointer bases of array
	section reductions.

	* testsuite/libgomp.c/pr80853.c: New test.

From-SVN: r248344
2017-05-22 20:51:54 +02:00
Thomas Schwinge 7fd549d24f OpenACC 2.5 default (present) clause
gcc/c/
	* c-parser.c (c_parser_omp_clause_default): Handle
	"OMP_CLAUSE_DEFAULT_PRESENT".
	gcc/cp/
	* parser.c (cp_parser_omp_clause_default): Handle
	"OMP_CLAUSE_DEFAULT_PRESENT".
	gcc/fortran/
	* gfortran.h (enum gfc_omp_default_sharing): Add
	"OMP_DEFAULT_PRESENT".
	* dump-parse-tree.c (show_omp_clauses): Handle it.
	* openmp.c (gfc_match_omp_clauses): Likewise.
	* trans-openmp.c (gfc_trans_omp_clauses): Likewise.
	gcc/
	* tree-core.h (enum omp_clause_default_kind): Add
	"OMP_CLAUSE_DEFAULT_PRESENT".
	* tree-pretty-print.c (dump_omp_clause): Handle it.
	* gimplify.c (enum gimplify_omp_var_data): Add
	"GOVD_MAP_FORCE_PRESENT".
	(gimplify_adjust_omp_clauses_1): Map it to
	"GOMP_MAP_FORCE_PRESENT".
	(oacc_default_clause): Handle "OMP_CLAUSE_DEFAULT_PRESENT".
	gcc/testsuite/
	* c-c++-common/goacc/default-1.c: Update.
	* c-c++-common/goacc/default-2.c: Likewise.
	* c-c++-common/goacc/default-4.c: Likewise.
	* gfortran.dg/goacc/default-1.f95: Likewise.
	* gfortran.dg/goacc/default-4.f: Likewise.
	* c-c++-common/goacc/default-5.c: New file.
	* gfortran.dg/goacc/default-5.f: Likewise.
	libgomp/
	* testsuite/libgomp.oacc-c++/template-reduction.C: Update.
	* testsuite/libgomp.oacc-c-c++-common/nested-2.c: Update.
	* testsuite/libgomp.oacc-fortran/data-4-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/default-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/non-scalar-data.f90: Likewise.

From-SVN: r248280
2017-05-19 15:32:48 +02:00
Thomas Schwinge 0da2f96af0 libgomp hsa plugin: debug output for HSA runtime library loading failure
libgomp/
	* plugin/plugin-hsa.c (DLSYM_FN, init_hsa_runtime_functions):
	Debug output for failure.

From-SVN: r248277
2017-05-19 15:32:04 +02:00
Rainer Orth 62ffe9207c Load new scanlang.exp
libitm:
	* testsuite/lib/libitm.exp: Load scanlang.exp.

	libgomp:
	* testsuite/lib/libgomp.exp: Load scanlang.exp.

	libatomic:
	* testsuite/lib/libatomic.exp: Load scanlang.exp.

From-SVN: r247959
2017-05-12 09:20:37 +00:00
Jakub Jelinek f49215b10c re PR bootstrap/80531 (RC1 bootstrap comparison failure)
PR bootstrap/80531
	* configure.tgt (*-*-aix*): Add -frandom-seed=$@ to XCFLAGS to avoid
	bootstrap compare failures.

From-SVN: r247350
2017-04-27 22:03:01 +02:00
Alexander Monakov 2260d19d4b omp-low: fix lastprivate/linear lowering for SIMT
gcc/
	* omp-low.c (lower_lastprivate_clauses): Correct handling of linear and
	lastprivate clauses in SIMT case.

libgomp/
	* testsuite/libgomp.c/target-36.c: New testcase.

From-SVN: r247029
2017-04-20 20:21:50 +03:00
Jakub Jelinek 19929ba9c9 plugin-nvptx.c (cuda_lib_inited): Use signed char type instead of char.
* plugin/plugin-nvptx.c (cuda_lib_inited): Use signed char type
	instead of char.

From-SVN: r246918
2017-04-13 21:59:04 +02:00
Jakub Jelinek fbc698e0f4 re PR libgomp/80394 (Empty OpenMP task is wrongly removed when optimizing)
PR libgomp/80394
	* omp-low.c (scan_omp_task): Don't optimize away empty tasks
	if they have any depend clauses.

	* testsuite/libgomp.c/pr80394.c: New test.

From-SVN: r246849
2017-04-11 19:15:47 +02:00
Jakub Jelinek c4060df4b1 re PR libgomp/79876 (FAIL: libgomp.fortran/strassen.f90 -O execution test on x86_64-apple-darwin16)
PR libgomp/79876
	* config/posix/thread-stacksize.h: New file.
	* config/darwin/thread-stacksize.h: New file.
	* config/nvptx/thread-stacksize.h: New file.
	* env.c: Include thread-stacksize.h.
	(initialize_env): Initialize stacksize to GOMP_DEFAULT_STACKSIZE
	instead of 0.  Call pthread_attr_setstacksize even if
	GOMP_DEFAULT_STACKSIZE is non-zero.

From-SVN: r246675
2017-04-04 12:41:33 +02:00
Jakub Jelinek e02d868ada * env.c (initialize_env): Initialize stacksize to 0.
From-SVN: r246598
2017-03-30 22:29:20 +02:00
Cesar Philippidis 7ba8651ed2 re PR c++/80029 (valgrind error in new_omp_context(omp_region_type) (gimplify.c:400))
PR c++/80029

	gcc/
	* gimplify.c (is_oacc_declared): New function.
	(oacc_default_clause): Use it to set default flags for acc declared
	variables inside parallel regions.
	(gimplify_scan_omp_clauses): Strip firstprivate pointers for acc
	declared variables.
	(gimplify_oacc_declare): Gimplify the declare clauses.  Add the
	declare attribute to any decl as necessary.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/declare-vla.c: New test.

From-SVN: r246381
2017-03-22 06:52:10 -07:00
Jakub Jelinek eebc5e2dde re PR c/79940 (OpenMP pragma - internal compiler error with taskloop)
PR c/79940
	* gimplify.c (gimplify_omp_for): Replace index var in outer
	taskloop statement with an artificial variable and add
	OMP_CLAUSE_PRIVATE clause for it.

	* testsuite/libgomp.c/pr79940.c: New test.

From-SVN: r245980
2017-03-08 18:21:06 +01:00
Rainer Orth 1eb08f5270 Enable libgomp.c/pr48591.c on __float128 targets
* testsuite/libgomp.c/pr48591.c: Enable on all __float128
	targets.
	Add __float128 options.

From-SVN: r245486
2017-02-15 16:35:54 +00:00
John David Anglin b0f78ff3e6 loop-dim-default.c: Remove hppa*-*-* dg-skip-if directive.
* testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c: Remove
	hppa*-*-* dg-skip-if directive.

From-SVN: r245365
2017-02-11 21:23:50 +00:00
Jakub Jelinek 1bbe0d8f47 loop-dim-default.c: Move dg-skip-if directive into a comment.
* testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c: Move
	dg-skip-if directive into a comment.

From-SVN: r245301
2017-02-09 14:50:28 +01:00
Chung-Lin Tang 02889d23ee gimplify.c (gimplify_scan_omp_clauses): No special handling for OMP_CLAUSE_TILE.
2017-02-09  Nathan Sidwell  <nathan@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>
	    Joseph Myers  <joseph@codesourcery.com>
	    Chung-Lin Tang  <cltang@codesourcery.com>

	gcc/
	* gimplify.c (gimplify_scan_omp_clauses): No special handling for
	OMP_CLAUSE_TILE.
	(gimplify_adjust_omp_clauses): Don't delete TILE.
	(gimplify_omp_for): Deal with TILE.
	* internal-fn.c (expand_GOACC_TILE): New function.
	* internal-fn.def (GOACC_DIM_POS): Comment may be overly conservative.
	(GOACC_TILE): New.
	* omp-expand.c (struct oacc_collapse): Add tile and outer fields.
	(expand_oacc_collapse_init): Add LOC paramter.  Initialize tile
	element fields.
	(expand_oacc_collapse_vars): Add INNER parm, adjust for tiling,
	avoid DIV for outermost collapse var.
	(expand_oacc_for): Insert tile element loop as needed.  Adjust.
	Remove out of date comments, fix whitespace.
	* omp-general.c (omp_extract_for_data): Deal with tiling.
	* omp-general.h (enum oacc_loop_flags): Add OLF_TILE flag,
	adjust OLF_DIM_BASE value.
	(struct omp_for_data): Add tiling field.
	* omp-low.c (scan_sharing_clauses): Allow OMP_CLAUSE_TILE.
	(lower_oacc_head_mark): Add OLF_TILE as appropriate.  Ensure 2 levels
	for auto loops.  Remove default auto determining, moved to
	oacc_loop_fixed_partitions.
	* omp-offload.c (struct oacc_loop): Change 'ifns' to vector of call
	stmts, add e_mask field.
	(oacc_dim_call): New function, abstracted out from oacc_thread_numbers.
	(oacc_thread_numbers): Use oacc_dim_call.
	(oacc_xform_tile): New.
	(new_oacc_loop_raw): Initialize e_mask, adjust for ifns vector.
	(finish_oacc_loop): Adjust for ifns vector.
	(oacc_loop_discover_walk): Append loop abstraction sites to list,
	add case for GOACC_TILE fns.
	(oacc_loop_xform_loop): Delete.
	(oacc_loop_process): Iterate over call list directly, and add
	handling for GOACC_TILE fns.
	(oacc_loop_fixed_partitions): Determine default auto, deal with TILE,
	dump partitioning.
	(oacc_loop_auto_partitions): Add outer_assign parm. Assign all but
	vector partitioning to outer loops.  Assign 2 partitions to loops
	when available. Add TILE handling.
	(oacc_loop_partition): Adjust oacc_loop_auto_partitions call.
	(execite_oacc_device_lower): Process GOACC_TILE fns, ignore unknown specs.
	* tree-nested.c (convert_nonlocal_omp_clauses): Allow OMP_CLAUSE_TILE.
	* tree.c (omp_clause_num_ops): Adjust TILE ops.
	* tree.h (OMP_CLAUSE_TILE_ITERVAR, OMP_CLAUSE_TILE_COUNT): New.

	gcc/c/
	* c-parser.c (c_parser_omp_clause_collapse): Disallow tile.
	(c_parser_oacc_clause_tile): Disallow collapse. Fix parsing and
	semantic checking.
	* c-parser.c (c_parser_omp_for_loop): Accept tiling constructs.

	gcc/cp/
	* parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
	parsing.  Parse constant expression. Remove semantic checking.
	(cp_parser_omp_clause_collapse): Disallow tile.
	(cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
	error about missing for after already emitting one.  Use more
	conventional for idiom for unbounded loop.
	* pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
	* semantics.c (finish_omp_clauses): Correct TILE semantic check.
	(finish_omp_for): Deal with tile clause.

	gcc/fortran/
	* openmp.c (resolve_omp_clauses): Error on directives
	containing both tile and collapse clauses.
	(resolve_oacc_loop_blocks): Represent '*' tile arguments as zero.
	* trans-openmp.c (gfc_trans_omp_do): Lower tiled loops like
	collapsed loops.

	gcc/testsuite/
	* c-c++-common/goacc/combined-directives.c: Remove xfail.
	* c-c++-common/goacc/loop-auto-1.c: Adjust and add additional case.
	* c-c++-common/goacc/loop-auto-2.c: New.
	* c-c++-common/goacc/tile.c: Include stdbool, fix expected errors.
	* c-c++-common/goacc/tile-2.c: New.
	* g++.dg/goacc/template.C: Test tile subst.  Adjust erroneous uses.
	* g++.dg/goacc/tile-1.C: New, check tile subst.
	* gcc.dg/goacc/loop-processing-1.c: Adjust dg-final pattern.
	* gfortran.dg/goacc/combined-directives.f90: Remove xfail.
	* gfortran.dg/goacc/tile-1.f90: New test.
	* gfortran.dg/goacc/tile-2.f90: New test.
	* gfortran.dg/goacc/tile-lowering.f95: New test.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/tile-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Adjust and
	add additional case.
	* testsuite/libgomp.oacc-c-c++-common/vprop.c: XFAIL under
	"openacc_nvidia_accel_selected".
	* libgomp.oacc-fortran/nested-function-1.f90 (test2):
	Add num_workers(8) clause.

From-SVN: r245300
2017-02-09 13:46:20 +00:00
John David Anglin 5896a41da8 loop-dim-default.c: Skip on hppa*-*-*.
* testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c: Skip on
	hppa*-*-*.
	* testsuite/libgomp.oacc-c-c++-common/reduction-cplx-dbl.c: Don't
	include complex.h on hppa*-*-hpux*.
	* testsuite/libgomp.oacc-c-c++-common/reduction-cplx-flt.c: Likewise.

From-SVN: r245292
2017-02-09 00:22:32 +00:00
Thomas Schwinge e70ab10d5c libgomp, nvptx plugin: Make "nvptx_exec" static
libgomp/
	* plugin/plugin-nvptx.c (nvptx_exec): Make it static.

From-SVN: r245127
2017-02-02 15:35:30 +01:00
Thomas Schwinge 345a8c1712 libgomp: Normalize the names of a few functions of the libgomp plugin API
libgomp/
	* libgomp-plugin.h (GOMP_OFFLOAD_openacc_parallel): Rename to
	GOMP_OFFLOAD_openacc_exec.  Adjust all users.
	(GOMP_OFFLOAD_openacc_get_current_cuda_device): Rename to
	GOMP_OFFLOAD_openacc_cuda_get_current_device.  Adjust all users.
	(GOMP_OFFLOAD_openacc_get_current_cuda_context): Rename to
	GOMP_OFFLOAD_openacc_cuda_get_current_context.  Adjust all users.
	(GOMP_OFFLOAD_openacc_get_cuda_stream): Rename to
	GOMP_OFFLOAD_openacc_cuda_get_stream.  Adjust all users.
	(GOMP_OFFLOAD_openacc_set_cuda_stream): Rename to
	GOMP_OFFLOAD_openacc_cuda_set_stream.  Adjust all users.

From-SVN: r245125
2017-02-02 15:13:57 +01:00
Thomas Schwinge dced339c8a libgomp: Provide prototypes for functions implemented by libgomp plugins
libgomp/
	* libgomp-plugin.h: #include <stdbool.h>.
	(GOMP_OFFLOAD_get_name, GOMP_OFFLOAD_get_caps)
	(GOMP_OFFLOAD_get_type, GOMP_OFFLOAD_get_num_devices)
	(GOMP_OFFLOAD_init_device, GOMP_OFFLOAD_fini_device)
	(GOMP_OFFLOAD_version, GOMP_OFFLOAD_load_image)
	(GOMP_OFFLOAD_unload_image, GOMP_OFFLOAD_alloc, GOMP_OFFLOAD_free)
	(GOMP_OFFLOAD_dev2host, GOMP_OFFLOAD_host2dev)
	(GOMP_OFFLOAD_dev2dev, GOMP_OFFLOAD_can_run, GOMP_OFFLOAD_run)
	(GOMP_OFFLOAD_async_run, GOMP_OFFLOAD_openacc_parallel)
	(GOMP_OFFLOAD_openacc_register_async_cleanup)
	(GOMP_OFFLOAD_openacc_async_test)
	(GOMP_OFFLOAD_openacc_async_test_all)
	(GOMP_OFFLOAD_openacc_async_wait)
	(GOMP_OFFLOAD_openacc_async_wait_async)
	(GOMP_OFFLOAD_openacc_async_wait_all)
	(GOMP_OFFLOAD_openacc_async_wait_all_async)
	(GOMP_OFFLOAD_openacc_async_set_async)
	(GOMP_OFFLOAD_openacc_create_thread_data)
	(GOMP_OFFLOAD_openacc_destroy_thread_data)
	(GOMP_OFFLOAD_openacc_get_current_cuda_device)
	(GOMP_OFFLOAD_openacc_get_current_cuda_context)
	(GOMP_OFFLOAD_openacc_get_cuda_stream)
	(GOMP_OFFLOAD_openacc_set_cuda_stream): New prototypes.
	* libgomp.h (struct acc_dispatch_t, struct gomp_device_descr): Use
	these.
	* plugin/plugin-hsa.c (GOMP_OFFLOAD_load_image)
	(GOMP_OFFLOAD_unload_image): Fix argument types.
	liboffloadmic/
	* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_get_type): Fix
	return type.
	(GOMP_OFFLOAD_load_image): Fix argument types.

From-SVN: r245062
2017-01-31 15:32:58 +01:00
Jakub Jelinek c1cadde1cb * testsuite/lib/libgomp.exp
(check_effective_target_hsa_offloading_selected_nocache): Fix up
	check_compile invocation.  Fix up removal of executable.  Drop
	bogus "2>&1" argument.

From-SVN: r244948
2017-01-26 20:37:08 +01:00
Jakub Jelinek 237499040f declare-simd-4.f90: Add cleanup-modules directive.
* testsuite/libgomp.fortran/declare-simd-4.f90: Add cleanup-modules
	directive.

From-SVN: r244927
2017-01-26 12:20:51 +01:00
Pekka Jääskeläinen 5fd1486ce5 Brig front-end
2017-01-24  Pekka Jääskeläinen <pekka@parmance.com>
	    Martin Jambor  <mjambor@suse.cz>

	* Makefile.def (target_modules): Added libhsail-rt.
	(languages): Added language brig.
	* Makefile.in: Regenerated.
	* configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Added
	tgarget-libhsail-rt.  Make brig unsupported on untested architectures.
	* configure: Regenerated.

gcc/
	* brig-builtins.def: New file.
	* builtins.def (DEF_HSAIL_BUILTIN): New macro.
	(DEF_HSAIL_ATOMIC_BUILTIN): Likewise.
	(DEF_HSAIL_SAT_BUILTIN): Likewise.
	(DEF_HSAIL_INTR_BUILTIN): Likewise.
	(DEF_HSAIL_CVT_ZEROI_SAT_BUILTIN): Likewise.
	* builtin-types.def (BT_INT8): New.
	(BT_INT16): Likewise.
	(BT_UINT8): Likewise.
	(BT_UINT16): Likewise.
	(BT_FN_ULONG): Likewise.
	(BT_FN_UINT_INT): Likewise.
	(BT_FN_UINT_ULONG): Likewise.
	(BT_FN_UINT_LONG): Likewise.
	(BT_FN_UINT_PTR): Likewise.
	(BT_FN_ULONG_PTR): Likewise.
	(BT_FN_INT8_FLOAT): Likewise.
	(BT_FN_INT16_FLOAT): Likewise.
	(BT_FN_UINT32_FLOAT): Likewise.
	(BT_FN_UINT16_FLOAT): Likewise.
	(BT_FN_UINT8_FLOAT): Likewise.
	(BT_FN_UINT64_FLOAT): Likewise.
	(BT_FN_UINT16_UINT32): Likewise.
	(BT_FN_UINT32_UINT16): Likewise.
	(BT_FN_UINT16_UINT16_UINT16): Likewise.
	(BT_FN_INT_PTR_INT): Likewise.
	(BT_FN_UINT_PTR_UINT): Likewise.
	(BT_FN_LONG_PTR_LONG): Likewise.
	(BT_FN_ULONG_PTR_ULONG): Likewise.
	(BT_FN_VOID_UINT64_UINT64): Likewise.
	(BT_FN_UINT8_UINT8_UINT8): Likewise.
	(BT_FN_INT8_INT8_INT8): Likewise.
	(BT_FN_INT16_INT16_INT16): Likewise.
	(BT_FN_INT_INT_INT): Likewise.
	(BT_FN_UINT_FLOAT_UINT): Likewise.
	(BT_FN_FLOAT_UINT_UINT): Likewise.
	(BT_FN_ULONG_UINT_UINT): Likewise.
	(BT_FN_ULONG_UINT_PTR): Likewise.
	(BT_FN_ULONG_ULONG_ULONG): Likewise.
	(BT_FN_UINT_UINT_UINT): Likewise.
	(BT_FN_VOID_UINT_PTR): Likewise.
	(BT_FN_UINT_UINT_PTR: Likewise.
	(BT_FN_UINT32_UINT64_PTR): Likewise.
	(BT_FN_INT_INT_UINT_UINT): Likewise.
	(BT_FN_UINT_UINT_UINT_UINT): Likewise.
	(BT_FN_UINT_UINT_UINT_PTR): Likewise.
	(BT_FN_UINT_ULONG_ULONG_UINT): Likewise.
	(BT_FN_ULONG_ULONG_ULONG_ULONG): Likewise.
	(BT_FN_LONG_LONG_UINT_UINT): Likewise.
	(BT_FN_ULONG_ULONG_UINT_UINT): Likewise.
	(BT_FN_VOID_UINT32_UINT64_PTR): Likewise.
	(BT_FN_VOID_UINT32_UINT32_PTR): Likewise.
	(BT_FN_UINT_UINT_UINT_UINT_UINT): Likewise.
	(BT_FN_UINT_FLOAT_FLOAT_FLOAT_FLOAT): Likewise.
	(BT_FN_ULONG_ULONG_ULONG_UINT_UINT): Likewise.
	* doc/frontends.texi: List BRIG FE.
	* doc/install.texi (Testing): Add BRIG tesring requirements.
	* doc/invoke.texi (Overall Options): Mention BRIG.
	* doc/standards.texi (Standards): Doucment BRIG HSA version.

gcc/brig/

	* Make-lang.in: New file.
	* brig-builtins.h: Likewise.
	* brig-c.h: Likewise.
	* brig-lang.c: Likewise.
	* brigspec.c: Likewise.
	* config-lang.in: Likewise.
	* lang-specs.h: Likewise.
	* lang.opt: Likewise.
	* brigfrontend/brig-arg-block-handler.cc: Likewise.
	* brigfrontend/brig-atomic-inst-handler.cc: Likewise.
	* brigfrontend/brig-basic-inst-handler.cc: Likewise.
	* brigfrontend/brig-branch-inst-handler.cc: Likewise.
	* brigfrontend/brig-cmp-inst-handler.cc: Likewise.
	* brigfrontend/brig-code-entry-handler.cc: Likewise.
	* brigfrontend/brig-code-entry-handler.h: Likewise.
	* brigfrontend/brig-comment-handler.cc: Likewise.
	* brigfrontend/brig-control-handler.cc: Likewise.
	* brigfrontend/brig-copy-move-inst-handler.cc: Likewise.
	* brigfrontend/brig-cvt-inst-handler.cc: Likewise.
	* brigfrontend/brig-fbarrier-handler.cc: Likewise.
	* brigfrontend/brig-function-handler.cc: Likewise.
	* brigfrontend/brig-function.cc: Likewise.
	* brigfrontend/brig-function.h: Likewise.
	* brigfrontend/brig-inst-mod-handler.cc: Likewise.
	* brigfrontend/brig-label-handler.cc: Likewise.
	* brigfrontend/brig-lane-inst-handler.cc: Likewise.
	* brigfrontend/brig-machine.c: Likewise.
	* brigfrontend/brig-machine.h: Likewise.
	* brigfrontend/brig-mem-inst-handler.cc: Likewise.
	* brigfrontend/brig-module-handler.cc: Likewise.
	* brigfrontend/brig-queue-inst-handler.cc: Likewise.
	* brigfrontend/brig-seg-inst-handler.cc: Likewise.
	* brigfrontend/brig-signal-inst-handler.cc: Likewise.
	* brigfrontend/brig-to-generic.cc: Likewise.
	* brigfrontend/brig-to-generic.h: Likewise.
	* brigfrontend/brig-util.cc: Likewise.
	* brigfrontend/brig-util.h: Likewise.
	* brigfrontend/brig-variable-handler.cc: Likewise.
	* brigfrontend/phsa.h: Likewise.


gcc/testsuite/

	* lib/brig-dg.exp: New file.
	* lib/brig.exp: Likewise.
	* brig.dg/README: Likewise.
	* brig.dg/dg.exp: Likewise.
	* brig.dg/test/gimple/alloca.hsail: Likewise.
	* brig.dg/test/gimple/atomics.hsail: Likewise.
	* brig.dg/test/gimple/branches.hsail: Likewise.
	* brig.dg/test/gimple/fbarrier.hsail: Likewise.
	* brig.dg/test/gimple/function_calls.hsail: Likewise.
	* brig.dg/test/gimple/kernarg.hsail: Likewise.
	* brig.dg/test/gimple/mem.hsail: Likewise.
	* brig.dg/test/gimple/mulhi.hsail: Likewise.
	* brig.dg/test/gimple/packed.hsail: Likewise.
	* brig.dg/test/gimple/smoke_test.hsail: Likewise.
	* brig.dg/test/gimple/variables.hsail: Likewise.
	* brig.dg/test/gimple/vector.hsail: Likewise.

include/

	* hsa.h: Moved here from libgomp/plugin/hsa.h.

libgomp/

	* plugin/hsa.h: Moved to top level include.
	* plugin/plugin-hsa.c: Chanfgd include of hsa.h accordingly.

libhsail-rt/

	* Makefile.am: New file.
	* target-config.h.in: Likewise.
	* configure.ac: Likewise.
	* configure: Likewise.
	* config.h.in: Likewise.
	* aclocal.m4: Likewise.
	* README: Likewise.
	* Makefile.in: Likewise.
	* include/internal/fibers.h: Likewise.
	* include/internal/phsa-queue-interface.h: Likewise.
	* include/internal/phsa-rt.h: Likewise.
	* include/internal/workitems.h: Likewise.
	* rt/arithmetic.c: Likewise.
	* rt/atomics.c: Likewise.
	* rt/bitstring.c: Likewise.
	* rt/fbarrier.c: Likewise.
	* rt/fibers.c: Likewise.
	* rt/fp16.c: Likewise.
	* rt/misc.c: Likewise.
	* rt/multimedia.c: Likewise.
	* rt/queue.c: Likewise.
	* rt/sat_arithmetic.c: Likewise.
	* rt/segment.c: Likewise.
	* rt/workitems.c: Likewise.


Co-Authored-By: Martin Jambor <mjambor@suse.cz>

From-SVN: r244867
2017-01-24 13:45:56 +01:00
Jakub Jelinek 73aa401ecf re PR other/79046 (g++ -print-file-name=plugin uses full version number in path)
PR other/79046
libatomic/
	* testsuite/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead
	of cat to get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
libffi/
	* configure.ac: Add GCC_BASE_VER.
	* include/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead
	of cat to get version from BASE-VER file.
	* configure: Regenerated.
	* testsuite/Makefile.in: Regenerated.
	* include/Makefile.in: Regenerated.
	* Makefile.in: Regenerated.
	* man/Makefile.in: Regenerated.
libgomp/
	* testsuite/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead
	of cat to get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
libitm/
	* testsuite/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead
	of cat to get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
libmpx/
	* mpxrt/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead
	of cat to get version from BASE-VER file.
	* mpxwrap/Makefile.am (gcc_version): Likewise.
	* mpxrt/Makefile.in: Regenerated.
	* mpxwrap/Makefile.in: Regenerated.
liboffloadmic/
	* plugin/configure.ac: Add GCC_BASE_VER.
	* plugin/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead
	of cat to get version from BASE-VER file.
	* plugin/configure: Regenerated.
	* plugin/aclocal.m4: Regenerated.
	* plugin/Makefile.in: Regenerated.
libsanitizer/
	* interception/Makefile.am (gcc_version): Use @get_gcc_base_ver@
	instead of cat to get version from BASE-VER file.
	* asan/Makefile.am (gcc_version): Likewise.
	* ubsan/Makefile.am (gcc_version): Likewise.
	* sanitizer_common/Makefile.am (gcc_version): Likewise.
	* lsan/Makefile.am (gcc_version): Likewise.
	* tsan/Makefile.am (gcc_version): Likewise.
	* interception/Makefile.in: Regenerated.
	* asan/Makefile.in: Regenerated.
	* ubsan/Makefile.in: Regenerated.
	* sanitizer_common/Makefile.in: Regenerated.
	* lsan/Makefile.in: Regenerated.
	* tsan/Makefile.in: Regenerated.
libvtv/
	* testsuite/Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead
	of cat to get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.

From-SVN: r244742
2017-01-21 09:47:11 +01:00
Jakub Jelinek b32e85fa42 cuda.h (CUdeviceptr): Typedef to unsigned long long even for _WIN64.
* plugin/cuda/cuda.h (CUdeviceptr): Typedef to unsigned long long even
	for _WIN64.

From-SVN: r244638
2017-01-19 16:53:51 +01:00
Jakub Jelinek d190d5c093 hsa.h: Add GCC runtime library exception.
* plugin/hsa.h: Add GCC runtime library exception.
	* plugin/hsa_ext_finalize.h: Likewise.

From-SVN: r244523
2017-01-17 10:45:23 +01:00
Jakub Jelinek 2393d337e7 configfrag.ac: For --without-cuda-driver don't initialize CUDA_DRIVER_INCLUDE nor CUDA_DRIVER_LIB.
* plugin/configfrag.ac: For --without-cuda-driver don't initialize
	CUDA_DRIVER_INCLUDE nor CUDA_DRIVER_LIB.  If both
	CUDA_DRIVER_INCLUDE and CUDA_DRIVER_LIB are empty and linking small
	cuda program fails, define PLUGIN_NVPTX_DYNAMIC to 1 and use
	plugin/include/cuda as include dir and -ldl instead of -lcuda as
	library to link ptx plugin against.
	* plugin/plugin-nvptx.c: Include dlfcn.h if PLUGIN_NVPTX_DYNAMIC.
	(CUDA_CALLS): Define.
	(cuda_lib, cuda_lib_inited): New variables.
	(init_cuda_lib): New function.
	(CUDA_CALL_PREFIX): Define.
	(CUDA_CALL_ERET, CUDA_CALL_ASSERT): Use CUDA_CALL_PREFIX.
	(CUDA_CALL): Use FN instead of (FN).
	(CUDA_CALL_NOCHECK): Define.
	(cuda_error, fini_streams_for_device, select_stream_for_async,
	nvptx_attach_host_thread_to_device, nvptx_open_device, link_ptx,
	event_gc, nvptx_exec, nvptx_async_test, nvptx_async_test_all,
	nvptx_wait_all, nvptx_set_clocktick, GOMP_OFFLOAD_unload_image,
	nvptx_stacks_alloc, nvptx_stacks_free, GOMP_OFFLOAD_run): Use
	CUDA_CALL_NOCHECK.
	(nvptx_init): Call init_cuda_lib, if it fails, return false.  Use
	CUDA_CALL_NOCHECK.
	(nvptx_get_num_devices): Call init_cuda_lib, if it fails, return 0.
	Use CUDA_CALL_NOCHECK.
	* plugin/cuda/cuda.h: New file.
	* config.h.in: Regenerated.
	* configure: Regenerated.

From-SVN: r244522
2017-01-17 10:44:17 +01:00
Jakub Jelinek 3c36aa6ba2 re PR other/79046 (g++ -print-file-name=plugin uses full version number in path)
PR other/79046
	* configure: Regenerated.
config/
	* acx.m4 (GCC_BASE_VER): New m4 function.
	(ACX_TOOL_DIRS): Require GCC_BASE_VER, for
	--with-gcc-major-version-only use just major number from BASE-VER.
gcc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	(CFLAGS-gcc.o): Add -DBASEVER=$(BASEVER_s).
	(gcc.o): Depend on $(BASEVER).
	* common.opt (dumpfullversion): New option.
	* gcc.c (driver_handle_option): Handle OPT_dumpfullversion.
	* doc/invoke.texi: Document -dumpfullversion.
	* doc/install.texi: Document --with-gcc-major-version-only.
	* configure: Regenerated.
libatomic/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libgomp/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libgcc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	* configure: Regenerated.
libssp/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
liboffloadmic/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* aclocal.m4: Include ../config/acx.m4.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libquadmath/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libmpx/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libada/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get
	version from BASE-VER file.
	* configure: Regenerated.
lto-plugin/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libitm/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
fixincludes/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
libcilkrts/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* aclocal.m4: Include ../config/acx.m4.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libcc1/
	* configure.ac: Add GCC_BASE_VER.  For --with-gcc-major-version-only
	use just major number from BASE-VER.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libobjc/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
libstdc++-v3/
	* configure.ac: Add GCC_BASE_VER.
	* fragment.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* po/Makefile.in: Regenerated.
	* libsupc++/Makefile.in: Regenerated.
	* testsuite/Makefile.in: Regenerated.
	* src/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
	* include/Makefile.in: Regenerated.
	* doc/Makefile.in: Regenerated.
	* python/Makefile.in: Regenerated.
	* src/c++11/Makefile.in: Regenerated.
	* src/c++98/Makefile.in: Regenerated.
	* src/filesystem/Makefile.in: Regenerated.
libvtv/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* testsuite/Makefile.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
libsanitizer/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* libbacktrace/Makefile.in: Regenerated.
	* interception/Makefile.in: Regenerated.
	* asan/Makefile.in: Regenerated.
	* ubsan/Makefile.in: Regenerated.
	* configure: Regenerated.
	* sanitizer_common/Makefile.in: Regenerated.
	* lsan/Makefile.in: Regenerated.
	* Makefile.in: Regenerated.
	* tsan/Makefile.in: Regenerated.
libgfortran/
	* configure.ac: Add GCC_BASE_VER.
	* Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to
	get version from BASE-VER file.
	* configure: Regenerated.
	* Makefile.in: Regenerated.

From-SVN: r244521
2017-01-17 10:38:48 +01:00
Francois-Xavier Coudert c508bc2d52 re PR libgomp/60670 (omp.h may differ between multilibs)
PR libgomp/60670
	* Makefile.am: Make fincludedir multilib-aware.
	* Makefile.in: Regenerate.

From-SVN: r244239
2017-01-09 20:29:06 +00:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Jakub Jelinek c1a9c36961 gcc.c (process_command): Update copyright notice dates.
gcc/
	* gcc.c (process_command): Update copyright notice dates.
	* gcov-dump.c (print_version): Ditto.
	* gcov.c (print_version): Ditto.
	* gcov-tool.c (print_version): Ditto.
	* gengtype.c (create_file): Ditto.
	* doc/cpp.texi: Bump @copying's copyright year.
	* doc/cppinternals.texi: Ditto.
	* doc/gcc.texi: Ditto.
	* doc/gccint.texi: Ditto.
	* doc/gcov.texi: Ditto.
	* doc/install.texi: Ditto.
	* doc/invoke.texi: Ditto.
gcc/fortran/
	* gfortranspec.c (lang_specific_driver): Update copyright notice
	dates.
	* gfc-internals.texi: Bump @copying's copyright year.
	* gfortran.texi: Ditto.
	* intrinsic.texi: Ditto.
	* invoke.texi: Ditto.
gcc/ada/
	* gnat_ugn.texi: Bump @copying's copyright year.
	* gnat_rm.texi: Likewise.
gcc/go/
	* gccgo.texi: Bump @copyrights-go year.
libitm/
	* libitm.texi: Bump @copying's copyright year.
libgomp/
	* libgomp.texi: Bump @copying's copyright year.
libquadmath/
	* libquadmath.texi: Bump @copying's copyright year.

From-SVN: r243992
2017-01-01 12:31:28 +01:00
Sebastian Huber e7a7f4bea8 [RTEMS] Use spin lock for pool management
libgomp/

	* libgomp/config/rtems/pool.h (gomp_thread_pool_reservoir): Use
	pthread_spinlock_t instead of gomp_mutex_t lock.
	(gomp_get_thread_pool): Likewise.
	(gomp_release_thread_pool): Likewise.
	* libgomp/config/rtems/proc.c (allocate_thread_pool_reservoir):
	Likewise.

From-SVN: r243181
2016-12-02 14:13:12 +00:00
Sebastian Huber d313d52cd5 [RTEMS] Fix libgomp for nthreads == 1
libgomp/

        * config/rtems/pool.h (gomp_get_thread_pool): Return proper
        thread pool in case nthreads == 1.

From-SVN: r243179
2016-12-02 14:10:33 +00:00
Alexander Monakov 630e3c3ad6 libgomp: move data definitions from icv.c back to env.c
* config/nvptx/env.c: Delete.
	* icv.c: Move definitions of ICV variables back ...
	* env.c: ...here.  Do not compile environment-related functionality if
	LIBGOMP_OFFLOADED_ONLY is set.

From-SVN: r243041
2016-11-30 21:23:00 +03:00
Alexander Monakov 9e38af5c55 libgomp: introduce LIBGOMP_OFFLOADED_ONLY macro
* configure.ac [nvptx*-*-*] (libgomp_offloaded_only): Set and use it...
	(LIBGOMP_OFFLOADED_ONLY): ...here; new define.
	* configure: Regenerate.
	* config.h.in: Likewise.

From-SVN: r243040
2016-11-30 21:08:30 +03:00
Alexander Monakov f96b7f1f47 libgomp: regenerate with automake-1.11.6
* Makefile.in: Regenerate with automake-1.11.6.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* testsuite/Makefile.in: Likewise.

From-SVN: r243039
2016-11-30 21:05:33 +03:00
Alexander Monakov 6a6951b1bf libgomp: remove config/nvptx/critical.c
* config/nvptx/critical.c: Delete to use generic implementation.

From-SVN: r242919
2016-11-28 16:50:23 +03:00
Jonas Hahnfeld c7ac071fd0 libgomp: fix OpenMP offloading to NVPTX and correct location of generic affinity.c
2016-11-28  Jonas Hahnfeld  <Hahnfeld@itc.rwth-aachen.de>

	* config/linux/affinity.c [!HAVE_PTHREAD_AFFINITY_NP]: Include
	../../affinity.c as fallback.
	* config/nvptx/affinity.c: Delete to use fallback implementation.

From-SVN: r242918
2016-11-28 16:42:50 +03:00
Alexander Monakov 6103184e81 OpenMP offloading to NVPTX: libgomp changes
* Makefile.am (libgomp_la_SOURCES): Add atomic.c, icv.c, icv-device.c.
	* Makefile.in. Regenerate.
	* configure.ac [nvptx*-*-*] (libgomp_use_pthreads): Set and use it...
	(LIBGOMP_USE_PTHREADS): ...here; new define.
	* configure: Regenerate.
	* config.h.in: Likewise.
	* config/posix/affinity.c: Move to...
	* affinity.c: ...here (new file).  Guard use of Pthreads-specific
	interface by LIBGOMP_USE_PTHREADS. 
	* critical.c: Split out GOMP_atomic_{start,end} into...
	* atomic.c: ...here (new file).
	* env.c: Split out ICV definitions into...
	* icv.c: ...here (new file) and...
	* icv-device.c: ...here. New file.
	* config/linux/lock.c (gomp_init_lock_30): Move to generic lock.c.
	(gomp_destroy_lock_30): Ditto.
	(gomp_set_lock_30): Ditto.
	(gomp_unset_lock_30): Ditto.
	(gomp_test_lock_30): Ditto.
	(gomp_init_nest_lock_30): Ditto.
	(gomp_destroy_nest_lock_30): Ditto.
	(gomp_set_nest_lock_30): Ditto.
	(gomp_unset_nest_lock_30): Ditto.
	(gomp_test_nest_lock_30): Ditto.
	* lock.c: New.
	* config/nvptx/lock.c: New.
	* config/nvptx/bar.c: New.
	* config/nvptx/bar.h: New.
	* config/nvptx/doacross.h: New.
	* config/nvptx/error.c: New.
	* config/nvptx/icv-device.c: New.
	* config/nvptx/mutex.h: New.
	* config/nvptx/pool.h: New.
	* config/nvptx/proc.c: New.
	* config/nvptx/ptrlock.h: New.
	* config/nvptx/sem.h: New.
	* config/nvptx/simple-bar.h: New.
	* config/nvptx/target.c: New.
	* config/nvptx/task.c: New.
	* config/nvptx/team.c: New.
	* config/nvptx/time.c: New.
	* config/posix/simple-bar.h: New.
	* libgomp.h: Guard pthread.h inclusion.  Include simple-bar.h.
	(gomp_num_teams_var): Declare.
	(struct gomp_thread_pool): Change threads_dock member to
	gomp_simple_barrier_t.
	[__nvptx__] (gomp_thread): New implementation.
	(gomp_thread_attr): Guard by LIBGOMP_USE_PTHREADS.
	(gomp_thread_destructor): Ditto.
	(gomp_init_thread_affinity): Ditto.
	* team.c: Guard uses of Pthreads-specific interfaces by
	LIBGOMP_USE_PTHREADS.  Adjust all uses of threads_dock.
	(gomp_free_thread) [__nvptx__]: Do not call 'free'.

	* config/nvptx/alloc.c: Delete.
	* config/nvptx/barrier.c: Ditto.
	* config/nvptx/fortran.c: Ditto.
	* config/nvptx/iter.c: Ditto.
	* config/nvptx/iter_ull.c: Ditto.
	* config/nvptx/loop.c: Ditto.
	* config/nvptx/loop_ull.c: Ditto.
	* config/nvptx/ordered.c: Ditto.
	* config/nvptx/parallel.c: Ditto.
	* config/nvptx/priority_queue.c: Ditto.
	* config/nvptx/sections.c: Ditto.
	* config/nvptx/single.c: Ditto.
	* config/nvptx/splay-tree.c: Ditto.
	* config/nvptx/work.c: Ditto.

	* testsuite/libgomp.fortran/fortran.exp (lang_link_flags): Pass
	-foffload=-lgfortran in addition to -lgfortran.
	* testsuite/libgomp.oacc-fortran/fortran.exp (lang_link_flags): Ditto.

	* plugin/plugin-nvptx.c: Include <limits.h>.
	(struct targ_fn_descriptor): Add new fields.
	(struct ptx_device): Ditto.  Set them...
	(nvptx_open_device): ...here.
	(nvptx_adjust_launch_bounds): New.
	(nvptx_host2dev): Allow NULL 'nvthd'.
	(nvptx_dev2host): Ditto.
	(GOMP_OFFLOAD_get_caps): Add GOMP_OFFLOAD_CAP_OPENMP_400.
	(link_ptx): Adjust log sizes.
	(nvptx_host2dev): Allow NULL 'nvthd'.
	(nvptx_dev2host): Ditto.
	(nvptx_set_clocktick): New.  Use it...
	(GOMP_OFFLOAD_load_image): ...here.  Set new targ_fn_descriptor
	fields.
	(GOMP_OFFLOAD_dev2dev): New.
	(nvptx_adjust_launch_bounds): New.
	(nvptx_stacks_size): New.
	(nvptx_stacks_alloc): New.
	(nvptx_stacks_free): New.
	(GOMP_OFFLOAD_run): New.
	(GOMP_OFFLOAD_async_run): New (stub).

Co-Authored-By: Dmitry Melnik <dm@ispras.ru>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r242789
2016-11-23 21:36:41 +03:00
Martin Jambor 56b1c60e41 backport: hsa-builtins.def: New file.
Merge from HSA branch to trunk

2016-11-23  Martin Jambor  <mjambor@suse.cz>
	    Martin Liska  <mliska@suse.cz>

gcc/
	* hsa-builtins.def: New file.
	* Makefile.in (BUILTINS_DEF): Add hsa-builtins.def dependency.
	* builtins.def: Include hsa-builtins.def.
	(DEF_HSA_BUILTIN): New macro.
	* dumpfile.h (OPTGROUP_OPENMP): Define.
	* dumpfile.c (optgroup_options): Added OPTGROUP_OPENMP.
	* gimple.h (gf_mask): Added elements GF_OMP_FOR_GRID_INTRA_GROUP and
	GF_OMP_FOR_GRID_GROUP_ITER.
	(gimple_omp_for_grid_phony): Added checking assert.
	(gimple_omp_for_set_grid_phony): Likewise.
	(gimple_omp_for_grid_intra_group): New function.
	(gimple_omp_for_set_grid_intra_group): Likewise.
	(gimple_omp_for_grid_group_iter): Likewise.
	(gimple_omp_for_set_grid_group_iter): Likewise.
	* omp-low.c (check_omp_nesting_restrictions): Allow GRID loop where
	previosuly only distribute loop was permitted.
	(lower_lastprivate_clauses): Allow non tcc_comparison predicates.
	(grid_get_kernel_launch_attributes): Support multiple HSA grid
	dimensions.
	(grid_expand_omp_for_loop): Likewise and also support standalone
	distribute constructs.  New parameter INTRA_GROUP, updated both users.
	(grid_expand_target_grid_body): Support standalone distribute
	constructs.
	(pass_data_expand_omp): Changed optinfo_flags to OPTGROUP_OPENMP.
	(pass_data_expand_omp_ssa): Likewise.
	(pass_data_omp_device_lower): Likewsie.
	(pass_data_lower_omp): Likewise.
	(pass_data_diagnose_omp_blocks): Likewise.
	(pass_data_oacc_device_lower): Likewise.
	(pass_data_omp_target_link): Likewise.
	(grid_lastprivate_predicate): New function.
	(lower_omp_for_lastprivate): Call grid_lastprivate_predicate for
	gridified loops.
	(lower_omp_for): Support standalone distribute constructs.
	(grid_prop): New type.
	(grid_safe_assignment_p): Check for assignments to group_sizes, new
	parameter GRID.
	(grid_seq_only_contains_local_assignments): New parameter GRID, pass
	it to callee.
	(grid_find_single_omp_among_assignments_1): Likewise, improve missed
	optimization info messages.
	(grid_find_single_omp_among_assignments): Likewise.
	(grid_find_ungridifiable_statement): Do not bail out for SIMDs.
	(grid_parallel_clauses_gridifiable): New function.
	(grid_inner_loop_gridifiable_p): Likewise.
	(grid_dist_follows_simple_pattern): Likewise.
	(grid_gfor_follows_tiling_pattern): Likewise.
	(grid_call_permissible_in_distribute_p): Likewise.
	(grid_handle_call_in_distribute): Likewise.
	(grid_dist_follows_tiling_pattern): Likewise.
	(grid_target_follows_gridifiable_pattern): Support standalone distribute
	constructs.
	(grid_var_segment): New enum.
	(grid_mark_variable_segment): New function.
	(grid_copy_leading_local_assignments): Call grid_mark_variable_segment
	if a new argument says so.
	(grid_process_grid_body): New function.
	(grid_eliminate_combined_simd_part): Likewise.
	(grid_mark_tiling_loops): Likewise.
	(grid_mark_tiling_parallels_and_loops): Likewise.
	(grid_process_kernel_body_copy): Support standalone distribute
	constructs.
	(grid_attempt_target_gridification): New grid variable holding overall
	gridification state.  Support standalone distribute constructs and
	collapse clauses.
	* doc/optinfo.texi (Optimization groups): Document OPTGROUP_OPENMP.
	* hsa.h (hsa_bb): Add method method append_phi.
	(hsa_insn_br): Renamed to hsa_insn_cbr, renamed all
	occurences in all files too.
	(hsa_insn_br): New class, now the ancestor of hsa_incn_cbr.
	(is_a_helper <hsa_insn_br *>::test): New function.
	(is_a_helper <hsa_insn_cbr *>::test): Adjust to only cover conditional
	branch instructions.
	(hsa_insn_signal): Make a direct descendant of
	hsa_insn_basic.  Add memorder constructor parameter and
	m_memory_order and m_signalop member variables.
	(hsa_insn_queue): Changed constructor parameters to common form.
	Added m_segment and m_memory_order member variables.
	(hsa_summary_t): Add private member function
	process_gpu_implementation_attributes.
	(hsa_function_summary): Rename m_binded_function to
	m_bound_function.
	(hsa_insn_basic_p): Remove typedef.
	(hsa_op_with_type): Change hsa_insn_basic_p into plain pointers.
	(hsa_op_reg_p): Remove typedef.
	(hsa_function_representation): Change hsa_op_reg_p into plain
	pointers.
	(hsa_insn_phi): Removed new and delete operators.
	(hsa_insn_br): Likewise.
	(hsa_insn_cbr): Likewise.
	(hsa_insn_sbr): Likewise.
	(hsa_insn_cmp): Likewise.
	(hsa_insn_mem): Likewise.
	(hsa_insn_atomic): Likewise.
	(hsa_insn_signal): Likewise.
	(hsa_insn_seg): Likewise.
	(hsa_insn_call): Likewise.
	(hsa_insn_arg_block): Likewise.
	(hsa_insn_comment): Likewise.
	(hsa_insn_srctype): Likewise.
	(hsa_insn_packed): Likewise.
	(hsa_insn_cvt): Likewise.
	(hsa_insn_alloca): Likewise.
	* hsa.c (hsa_destroy_insn): Also handle instances of hsa_insn_br.
	(process_gpu_implementation_attributes): New function.
	(link_functions): Move some functionality into it.  Adjust after
	renaming m_binded_functions to m_bound_functions.
	(hsa_insn_basic::op_output_p): Add BRIG_OPCODE_DEBUGTRAP
	to the list of instructions with no output registers.
	(get_in_type): Return this if it is a register of
	matching size.
	(hsa_get_declaration_name): Moved to...
        * hsa-gen.c (hsa_get_declaration_name): ...here.  Allocate
	temporary string on an obstack instead from ggc.
	(query_hsa_grid): Renamed to query_hsa_grid_dim, reimplemented, cut
	down to two overloads.
	(hsa_allocp_operand_address): Removed.
	(hsa_allocp_operand_immed): Likewise.
	(hsa_allocp_operand_reg): Likewise.
	(hsa_allocp_operand_code_list): Likewise.
	(hsa_allocp_operand_operand_list): Likewise.
	(hsa_allocp_inst_basic): Likewise.
	(hsa_allocp_inst_phi): Likewise.
	(hsa_allocp_inst_mem): Likewise.
	(hsa_allocp_inst_atomic): Likewise.
	(hsa_allocp_inst_signal): Likewise.
	(hsa_allocp_inst_seg): Likewise.
	(hsa_allocp_inst_cmp): Likewise.
	(hsa_allocp_inst_br): Likewise.
	(hsa_allocp_inst_sbr): Likewise.
	(hsa_allocp_inst_call): Likewise.
	(hsa_allocp_inst_arg_block): Likewise.
	(hsa_allocp_inst_comment): Likewise.
	(hsa_allocp_inst_queue): Likewise.
	(hsa_allocp_inst_srctype): Likewise.
	(hsa_allocp_inst_packed): Likewise.
	(hsa_allocp_inst_cvt): Likewise.
	(hsa_allocp_inst_alloca): Likewise.
	(hsa_allocp_bb): Likewise.
	(hsa_obstack): New.
	(hsa_init_data_for_cfun): Initialize obstack.
	(hsa_deinit_data_for_cfun): Release memory of the obstack.
	(hsa_op_immed::operator new): Use obstack instead of object_allocator.
	(hsa_op_reg::operator new): Likewise.
	(hsa_op_address::operator new): Likewise.
	(hsa_op_code_list::operator new): Likewise.
	(hsa_op_operand_list::operator new): Likewise.
	(hsa_insn_basic::operator new): Likewise.
	(hsa_insn_phi::operator new): Likewise.
	(hsa_insn_br::operator new): Likewise.
	(hsa_insn_sbr::operator new): Likewise.
	(hsa_insn_cmp::operator new): Likewise.
	(hsa_insn_mem::operator new): Likewise.
	(hsa_insn_atomic::operator new): Likewise.
	(hsa_insn_signal::operator new): Likewise.
	(hsa_insn_seg::operator new): Likewise.
	(hsa_insn_call::operator new): Likewise.
	(hsa_insn_arg_block::operator new): Likewise.
	(hsa_insn_comment::operator new): Likewise.
	(hsa_insn_srctype::operator new): Likewise.
	(hsa_insn_packed::operator new): Likewise.
	(hsa_insn_cvt::operator new): Likewise.
	(hsa_insn_alloca::operator new): Likewise.
	(hsa_init_new_bb): Likewise.
	(hsa_bb::append_phi): New function.
	(gen_hsa_phi_from_gimple_phi): Use it.
	(get_symbol_for_decl): Fix dinstinguishing between
	global and local functions.  Put local variables into a segment
	according to their attribute or static flag, if there is one.
	(hsa_insn_br::hsa_insn_br): New.
	(hsa_insn_br::operator new): Likewise.
	(hsa_insn_cbr::hsa_insn_cbr): Set width via ancestor constructor.
	(query_hsa_grid_nodim): New function.
	(multiply_grid_dim_characteristics): Likewise.
	(gen_get_num_threads): Likewise.
	(gen_get_num_teams): Reimplemented.
	(gen_get_team_num): Likewise.
	(gen_hsa_insns_for_known_library_call): Updated calls to the above
	helper functions.
	(get_memory_order_name): Removed.
	(get_memory_order): Likewise.
	(hsa_memorder_from_tree): New function.
	(gen_hsa_ternary_atomic_for_builtin): Renamed to
	gen_hsa_atomic_for_builtin, can also create signals.
	(gen_hsa_insns_for_call): Handle many new builtins.  Adjust to use
	hsa_memory_order_from_tree and gen_hsa_atomic_for_builtin.
	(hsa_insn_atomic): Fix function comment.
	(hsa_insn_signal::hsa_insn_signal): Fix comment.  Update call to
	ancestor constructor and initialization of new member variables.
	(hsa_insn_queue::hsa_insn_queue): Added initialization of new
	member variables.
	(hsa_get_host_function): Handle functions with no bound CPU
	implementation.  Fix binded to bound.
	(get_brig_function_name): Likewise.
	(HSA_SORRY_ATV): Remove semicolon after macro.
	(HSA_SORRY_AT): Likewise.
	(omp_simple_builtin::generate): Add missing semicolons.
	(hsa_insn_phi::operator new): Removed.
	(hsa_insn_br::operator new): Likewise.
	(hsa_insn_cbr::operator new): Likewise.
	(hsa_insn_sbr::operator new): Likewise.
	(hsa_insn_cmp::operator new): Likewise.
	(hsa_insn_mem::operator new): Likewise.
	(hsa_insn_atomic::operator new): Likewise.
	(hsa_insn_signal::operator new): Likewise.
	(hsa_insn_seg::operator new): Likewise.
	(hsa_insn_call::operator new): Likewise.
	(hsa_insn_arg_block::operator new): Likewise.
	(hsa_insn_comment::operator new): Likewise.
	(hsa_insn_srctype::operator new): Likewise.
	(hsa_insn_packed::operator new): Likewise.
	(hsa_insn_cvt::operator new): Likewise.
	(hsa_insn_alloca::operator new): Likewise.
	(get_symbol_for_decl): Accept CONST_DECLs, put them to
	readonly segment.
	(gen_hsa_addr): Also process CONST_DECLs.
	(gen_hsa_addr_insns): Process CONST_DECLs by creating private
	copies.
	(gen_hsa_unary_operation): Make sure the function does
	not use bittype source type for firstbit and lastbit operations.
	(gen_hsa_popcount_to_dest): Make sure the function uses a bittype
	source type.
	* hsa-brig.c (emit_insn_operands): Cope with zero operands in an
	instruction.
	(emit_branch_insn): Renamed to emit_cond_branch_insn.
	Emit the width stored in the class.
	(emit_generic_branch_insn): New function.
	(emit_insn): Call emit_generic_branch_insn.
	(emit_signal_insn): Remove obsolete comment.  Update
	member variable name, pick a type according to profile.
	(emit_alloca_insn): Remove obsolete comment.
	(emit_atomic_insn): Likewise.
	(emit_queue_insn): Get segment and memory order from the IR object.
	(hsa_brig_section): Make allocate_new_chunk, chunks
	and cur_chunk provate, add a default NULL parameter to add method.
	(hsa_brig_section::add): Added a new parameter, store pointer to
	output data there if it is non-NULL.
	(emit_function_directives): Use this new parameter instead of
	calculating the pointer itself, fix function comment.
	(hsa_brig_emit_function): Add forgotten endian conversion.
	(hsa_output_kernels): Remove unnecessary building of
	kernel_dependencies_vector_type.
	(emit_immediate_operand): Declare.
	(emit_directive_variable): Also emit initializers of CONST_DECLs.
	(gen_hsa_insn_for_internal_fn_call): Also handle IFN_RSQRT.
	(verify_function_arguments): Properly detect variadic
	arguments.
	* hsa-dump.c (hsa_width_specifier_name): New function.
	(dump_hsa_insn_1): Dump generic branch instructions, update signal
	member variable name.  Special dumping for queue objects.
	* ipa-hsa.c (process_hsa_functions): Adjust after renaming
	m_binded_functions to m_bound_functions.  Copy externally visible flag
	to the node.
	(ipa_hsa_write_summary): Likewise.
	(ipa_hsa_read_section): Likewise.


	gcc/fortran/
        * f95-lang.c (DEF_HSA_BUILTIN): New macro.

gcc/testsuite/
	* c-c++-common/gomp/gridify-1.c: Update scan string.
	* gfortran.dg/gomp/gridify-1.f90: Likewise.
	* c-c++-common/gomp/gridify-2.c: New test.
	* c-c++-common/gomp/gridify-3.c: Likewise.

libgomp/
	* testsuite/libgomp.hsa.c/bits-insns.c: New test.
	* testsuite/libgomp.hsa.c/tiling-1.c: Likewise.
	* testsuite/libgomp.hsa.c/tiling-2.c: Likewise.


Co-Authored-By: Martin Liska <mliska@suse.cz>

From-SVN: r242761
2016-11-23 15:51:02 +01:00
Martin Liska b8d89b03db Remove build dependence on HSA run-time
2016-11-23  Martin Liska  <mliska@suse.cz>
            Martin Jambor  <mjambor@suse.cz>

gcc/
	* doc/install.texi: Remove entry about --with-hsa-kmt-lib.

libgomp/
	* plugin/hsa.h: New file.
	* plugin/hsa_ext_finalize.h: New file.
	* plugin/configfrag.ac: Remove hsa-kmt-lib test.  Added checks for
	header file unistd.h, and functions secure_getenv, __secure_getenv,
	getuid, geteuid, getgid and getegid.
	* plugin/Makefrag.am (libgomp_plugin_hsa_la_CPPFLAGS): Added
	-D_GNU_SOURCE.
	* plugin/plugin-hsa.c: Include config.h, inttypes.h and stdbool.h.
	Handle various cases of secure_getenv presence, add an implementation
	when we can test effective UID and GID.
	(struct hsa_runtime_fn_info): New structure.
	(hsa_runtime_fn_info hsa_fns): New variable.
	(hsa_runtime_lib): Likewise.
	(support_cpu_devices): Likewise.
	(init_enviroment_variables): Load newly introduced ENV
	variables.
	(hsa_warn): Call hsa run-time functions via hsa_fns structure.
	(hsa_fatal): Likewise.
	(DLSYM_FN): New macro.
	(init_hsa_runtime_functions): New function.
	(suitable_hsa_agent_p): Call hsa run-time functions via hsa_fns
	structure.  Depending on environment, also allow CPU devices.
	(init_hsa_context): Call hsa run-time functions via hsa_fns structure.
	(get_kernarg_memory_region): Likewise.
	(GOMP_OFFLOAD_init_device): Likewise.
	(destroy_hsa_program): Likewise.
	(init_basic_kernel_info): New function.
	(GOMP_OFFLOAD_load_image): Use it.
	(create_and_finalize_hsa_program): Call hsa run-time functions via
	hsa_fns structure.
	(create_single_kernel_dispatch): Likewise.
	(release_kernel_dispatch): Likewise.
	(init_single_kernel): Likewise.
	(parse_target_attributes): Allow up multiple HSA grid dimensions.
	(get_group_size): New function.
	(run_kernel): Likewise.
	(GOMP_OFFLOAD_run): Outline most functionality to run_kernel.
	(GOMP_OFFLOAD_fini_device): Call hsa run-time functions via hsa_fns
	structure.
	* testsuite/lib/libgomp.exp: Remove hsa_kmt_lib support.
	* testsuite/libgomp-test-support.exp.in: Likewise.
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* config.h.in: Likewise.
	* configure: Likewise.
	* testsuite/Makefile.in: Likewise.



Co-Authored-By: Martin Jambor <mjambor@suse.cz>

From-SVN: r242749
2016-11-23 13:27:13 +01:00
Martin Jambor 18d2ada84b libgomp testsuite: add missing map clauses
* testsuite/libgomp.fortran/examples-4/device-1.f90 (e_57_1): Add
	mapping clauses to target constructs.
	* testsuite/libgomp.fortran/examples-4/device-3.f90 (e_57_3): Ditto.


Co-Authored-By: Alexander Monakov <amonakov@ispras.ru>

From-SVN: r242436
2016-11-15 20:14:32 +03:00
Matthias Klose 84c1b9d3d4 config-ml.in: Remove references to GCJ.
<toplevel>

2016-11-15  Matthias Klose  <doko@ubuntu.com>

	* config-ml.in: Remove references to GCJ.
	* configure.ac: Likewise.
	* configure: Regenerate.

config/

2016-11-15  Matthias Klose  <doko@ubuntu.com>

	multi.m4: Don't set GCJ.

gcc/

2016-11-15  Matthias Klose  <doko@ubuntu.com>

	* doc/install.texi: Remove references to gcj/libjava.
	* doc/invoke.texi: Likewise.

*/ (where necessary)

2016-11-15  Matthias Klose  <doko@ubuntu.com>

	* configure: Regenerate.

From-SVN: r242433
2016-11-15 16:34:02 +00:00
Jakub Jelinek 8ebd1b3182 cpp.c (cpp_define_builtins): Define _OPENMP to 201511 instead of 201307.
gcc/fortran/
	* cpp.c (cpp_define_builtins): Define _OPENMP to 201511 instead
	of 201307.
	* gfortran.texi: Mention partial OpenMP 4.5 support.
	* intrinsic.texi: Update for OpenMP 4.5.
gcc/testsuite/
	* gfortran.dg/openmp-define-3.f90: Expect 201511 instead of
	201307.
libgomp/
	* omp_lib.f90.in (openmp_version): Change to 201511 from 201307.
	* omp_lib.h.in (openmp_version): Likewise.
	* testsuite/libgomp.fortran/openmp_version-1.f: Expect 201511 instead
	of 201307.
	* testsuite/libgomp.fortran/openmp_version-2.f90: Likewise.

From-SVN: r242044
2016-11-10 18:05:18 +01:00
Jakub Jelinek b4c3a85be9 omp-low.c (lower_omp_target): Fix up argument to is_reference.
gcc/
	* omp-low.c (lower_omp_target): Fix up argument to is_reference.
	(expand_omp_ordered_sink): Handle TREE_PURPOSE of deps being
	TRUNC_DIV_EXPR.
	* gimplify.c (gimplify_scan_omp_clauses): Likewise.  Set
	ctx->target_map_scalars_firstprivate on OMP_TARGET even for Fortran.
	Remove omp_no_lastprivate callers.  Propagate lastprivate on combined
	teams distribute parallel for simd even to distribute and teams
	construct.  For OMP_CLAUSE_DEPEND add missing break at the end of
	OMP_CLAUSE_DEPEND_SINK case.
	(omp_notice_variable): Use lang_hooks.decls.omp_scalar_p.
	(omp_no_lastprivate): Removed.
	(gimplify_adjust_omp_clauses): Remove omp_no_lastprivate callers.
	(gimplify_omp_for): Likewise.
	(computable_teams_clause): Fail for automatic vars from current
	function not yet seen in bind expr.
	* langhooks.c (lhd_omp_scalar_p): New function.
	* langhooks.h (struct lang_hooks_for_decls): Add omp_scalar_p.
	* varpool.c (varpool_node::get_create): Set node->offloading
	even for DECL_EXTERNAL decls.
	* langhooks-def.h (lhd_omp_scalar_p): New prototype.
	(LANG_HOOKS_OMP_SCALAR_P): Define.
	(LANG_HOOKS_DECLS): Use it.
gcc/fortran/
	* openmp.c (gfc_free_omp_clauses): Free critical_name, grainsize,
	hint, num_tasks, priority and if_exprs.
	(gfc_match_omp_to_link, gfc_match_omp_depend_sink): New functions.
	(enum omp_mask1, enum omp_mask2): New enums.
	Change all OMP_CLAUSE_* defines into enum values, and change their
	values from ((uint64_t) 1 << bit) to just bit.
	(omp_mask, omp_inv_mask): New classes.  Add ctors and operators.
	(gfc_match_omp_clauses): Change mask argument from uint64_t to
	const omp_mask.  Assert OMP_MASK1_LAST and OMP_MASK2_LAST are
	at most 64.  Move delete clause handling to where it
	alphabetically belongs.  Parse defaultmap, grainsize, hint,
	is_device_ptr, nogroup, nowait, num_tasks, priority, simd, threads
	and use_device_ptr clauses.  Parse if clause modifier.  Parse map
	clause always modifier, and release and delete kinds.  Parse ordered
	clause with argument.  Parse schedule clause modifiers.  Differentiate
	device clause parsing based on openacc flag.  Guard link clause
	parsing with openacc flag.  Add support for parsing
	linear clause modifiers.  Parse depend(source) and depend(sink: ...).
	Use gfc_match_omp_to_link for to and link clauses in declare target
	construct.
	(match_acc): Change mask type from uint64_t to const omp_mask.
	(OMP_SINGLE_CLAUSES, OMP_ORDERED_CLAUSES,
	OMP_DECLARE_TARGET_CLAUSES, OMP_TASKLOOP_CLAUSES,
	OMP_TARGET_ENTER_DATA_CLAUSES, OMP_TARGET_EXIT_DATA_CLAUSES): Define.
	(OACC_PARALLEL_CLAUSES, OACC_KERNELS_CLAUSES, OACC_DATA_CLAUSES,
	OACC_LOOP_CLAUSES, OACC_HOST_DATA_CLAUSES, OACC_DECLARE_CLAUSES,
	OACC_ENTER_DATA_CLAUSES, OACC_EXIT_DATA_CLAUSES, OACC_WAIT_CLAUSES,
	OACC_ROUTINE_CLAUSES, OMP_PARALLEL_CLAUSES, OMP_DECLARE_SIMD_CLAUSES,
	OMP_SECTIONS_CLAUSES, OMP_TEAMS_CLAUSES, OMP_DISTRIBUTE_CLAUSES):
	Replace first or only OMP_CLAUSE_* value in bitset with
	omp_mask (OMP_CLAUSE_*).
	(OMP_DO_CLAUSES): Likewise.  Add OMP_CLAUSE_LINEAR.
	(OMP_SIMD_CLAUSES): Replace first or only OMP_CLAUSE_* value in
	bitset with omp_mask (OMP_CLAUSE_*).  Add OMP_CLAUSE_SIMDLEN.
	(OACC_UPDATE_CLAUSES): Replace first or only OMP_CLAUSE_* value in
	bitset with omp_mask (OMP_CLAUSE_*).  Replace OMP_CLAUSE_OACC_DEVICE
	with OMP_CLAUSE_DEVICE.
	(OMP_TASK_CLAUSES): Replace first or only OMP_CLAUSE_* value in
	bitset with omp_mask (OMP_CLAUSE_*).  Add OMP_CLAUSE_PRIORITY.
	(OMP_TARGET_CLAUSES): Replace first or only OMP_CLAUSE_* value in
	bitset with omp_mask (OMP_CLAUSE_*).  Add OMP_CLAUSE_DEPEND,
	OMP_CLAUSE_NOWAIT, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_FIRSTPRIVATE,
	OMP_CLAUSE_DEFAULTMAP and OMP_CLAUSE_IS_DEVICE_PTR.
	(OMP_TARGET_DATA_CLAUSES): Replace first or only OMP_CLAUSE_* value in
	bitset with omp_mask (OMP_CLAUSE_*).  Add OMP_CLAUSE_USE_DEVICE_PTR.
	(OMP_TARGET_UPDATE_CLAUSES): Replace first or only OMP_CLAUSE_* value
	in bitset with omp_mask (OMP_CLAUSE_*).  Add OMP_CLAUSE_DEPEND and
	OMP_CLAUSE_NOWAIT.
	(match_omp): Change mask argument from unsigned int to
	const omp_mask.
	(gfc_match_omp_critical): Parse optional clauses and use omp_clauses
	union member instead of omp_name.
	(gfc_match_omp_end_critical): New function.
	(gfc_match_omp_distribute_parallel_do): Remove ordered and linear
	clauses from the mask.
	(gfc_match_omp_distribute_parallel_do_simd): Use
	& ~(omp_mask (OMP_CLAUSE_*)) instead of & ~OMP_CLAUSE_*.
	(gfc_match_omp_target_teams_distribute_parallel_do_simd): Likewise.
	(gfc_match_omp_teams_distribute_parallel_do_simd): Likewise.
	(gfc_match_omp_do_simd): Likewise.  Don't remove ordered clause from
	the mask.
	(gfc_match_omp_parallel_do_simd): Likewise.
	(gfc_match_omp_target_teams_distribute_parallel_do): Likewise.
	(gfc_match_omp_teams_distribute_parallel_do): Likewise.
	(gfc_match_omp_declare_simd): If not using the form with
	(proc-name), require space before first clause.  Make (proc-name)
	optional.  If not present, set proc_name to NULL.
	(gfc_match_omp_declare_target): Rewritten for OpenMP 4.5.
	(gfc_match_omp_single): Use OMP_SINGLE_CLAUSES.
	(gfc_match_omp_task, gfc_match_omp_taskwait, gfc_match_omp_taskyield):
	Move around to where they belong alphabetically.
	(gfc_match_omp_target_enter_data, gfc_match_omp_target_exit_data,
	gfc_match_omp_target_parallel, gfc_match_omp_target_parallel_do,
	gfc_match_omp_target_parallel_do_simd, gfc_match_omp_target_simd,
	gfc_match_omp_taskloop, gfc_match_omp_taskloop_simd):
	New functions.
	(gfc_match_omp_ordered): Parse clauses.
	(gfc_match_omp_ordered_depend): New function.
	(gfc_match_omp_cancel, gfc_match_omp_end_single): Use
	omp_mask (OMP_CLAUSE_*) instead of OMP_CLAUSE_*.
	(resolve_oacc_scalar_int_expr): Renamed to ...
	(resolve_scalar_int_expr): ... this.  Fix up formatting.
	(resolve_oacc_positive_int_expr): Renamed to ...
	(resolve_positive_int_expr): ... this.  Fix up formatting.
	(resolve_nonnegative_int_expr): New function.
	(resolve_omp_clauses): Adjust callers, use the above functions
	even for OpenMP clauses, add handling of new OpenMP 4.5 clauses.
	Require orderedc >= collapse if specified. Handle depend(sink:)
	and depend(source) restrictions.  Disallow linear clause when
	orderedc is non-zero.  Diagnose linear clause modifiers when not in
	declare simd.  Only check for integer type if ref modifier
	is not used.  Remove diagnostics for required VALUE attribute.
	Diagnose VALUE attribute with ref or uval modifiers.  Allow
	non-constant linear-step, if it is a dummy argument alone and is
	mentioned in uniform clause.  Diagnose map kinds not allowed
	for various constructs.  Diagnose target {enter ,exit ,}data without
	any map clauses.  Add dummy OMP_LIST_IS_DEVICE_PTR and
	OMP_LIST_USE_DEVICE_PTR cases.
	(gfc_resolve_omp_do_blocks): Set omp_current_do_collapse to orderedc
	if non-zero.
	(gfc_resolve_omp_parallel_blocks): Handle new OpenMP 4.5 constructs,
	replace underscores with spaces in a few construct names.
	(resolve_omp_do): Set collapse to orderedc if non-zero.  Handle new
	OpenMP 4.5 constructs.
	(resolve_oacc_loop_blocks): Call resolve_positive_int_expr instead
	of resolve_oacc_positive_int_expr.
	(gfc_resolve_omp_directive): Handle new OpenMP 4.5 constructs.
	(gfc_resolve_omp_declare_simd): Allow ods->proc_name to be NULL.
	* trans-openmp.c (gfc_omp_scalar_p): New function.
	(doacross_steps): New variable.
	(gfc_trans_omp_clauses): Handle new OpenMP 4.5 clauses and new clause
	modifiers.
	(gfc_trans_omp_critical): Adjust EXEC_OMP_CRITICAL handling.
	(gfc_trans_omp_do): Handle doacross loops.  Clear sched_simd flag.
	Handle EXEC_OMP_TASKLOOP.
	(gfc_trans_omp_ordered): Translate omp clauses, allow NULL
	code->block.
	(GFC_OMP_SPLIT_TASKLOOP, GFC_OMP_MASK_TASKLOOP): New enum constants.
	(gfc_split_omp_clauses): Copy orderedc together with ordered.  Change
	firstprivate and lastprivate handling for OpenMP 4.5.
	Handle EXEC_OMP_TARGET_SIMD, EXEC_OMP_TARGET_PARALLEL{,_DO,_DO_SIMD}
	and EXEC_OMP_TASKLOOP{,_SIMD}.  Add handling for new OpenMP 4.5
	clauses and clause modifiers and handle if clause without/with
	modifiers.
	(gfc_trans_omp_teams): Add omp_clauses argument, add it to other
	teams clauses.  Don't wrap into OMP_TEAMS if -fopenmp-simd.
	(gfc_trans_omp_target): For -fopenmp, translate num_teams and
	thread_limit clauses on combined target teams early and pass to
	gfc_trans_omp_teams.  Set OMP_TARGET_COMBINED if needed.
	Handle EXEC_OMP_TARGET_PARALLEL{,_DO,_DO_SIMD} and
	EXEC_OMP_TARGET_SIMD.
	(gfc_trans_omp_taskloop, gfc_trans_omp_target_enter_data,
	gfc_trans_omp_target_exit_data): New functions.
	(gfc_trans_omp_directive): Handle EXEC_OMP_TARGET_{ENTER,EXIT}_DATA
	EXEC_OMP_TASKLOOP{,_SIMD}, EXEC_OMP_TARGET_PARALLEL{,_DO,_DO_SIMD}
	and EXEC_OMP_TARGET_SIMD.  Adjust gfc_trans_omp_teams caller.
	* symbol.c (check_conflict): Handle omp_declare_target_link.
	(gfc_add_omp_declare_target_link): New function.
	(gfc_copy_attr): Copy omp_declare_target_link.
	* dump-parse-tree.c (show_omp_namelist): Handle OMP_DEPEND_SINK_FIRST
	depend_op.  Print linear clause modifiers.
	(show_omp_clauses): Adjust for OpenMP 4.5 clause changes.
	(show_omp_node): Print clauses for EXEC_OMP_ORDERED.  Allow NULL
	c->block for EXEC_OMP_ORDERED.  Formatting fixes.  Adjust handling of
	EXEC_OMP_CRITICAL, handle new OpenMP 4.5 constructs and some
	forgotten OpenMP 4.0 constructs.
	(show_code_node): Handle new OpenMP 4.5 constructs and some forgotten
	OpenMP 4.0 constructs.
	* gfortran.h (symbol_attribute): Add omp_declare_target_link bitfield.
	(struct gfc_omp_namelist): Add u.common and u.linear_op fields.
	(struct gfc_common_head): Change omp_declare_target into bitfield.
	Add omp_declare_target_link bitfield.
	(gfc_add_omp_declare_target_link): New prototype.
	(enum gfc_statement): Add ST_OMP_TARGET_PARALLEL,
	ST_OMP_END_TARGET_PARALLEL, ST_OMP_TARGET_PARALLEL_DO,
	ST_OMP_END_TARGET_PARALLEL_DO, ST_OMP_TARGET_PARALLEL_DO_SIMD,
	ST_OMP_END_TARGET_PARALLEL_DO_SIMD, ST_OMP_TARGET_ENTER_DATA,
	ST_OMP_TARGET_EXIT_DATA, ST_OMP_TARGET_SIMD, ST_OMP_END_TARGET_SIMD,
	ST_OMP_TASKLOOP, ST_OMP_END_TASKLOOP, ST_OMP_TASKLOOP_SIMD,
	ST_OMP_END_TASKLOOP_SIMD and ST_OMP_ORDERED_DEPEND.
	(enum gfc_omp_depend_op): Add OMP_DEPEND_SINK_FIRST and
	OMP_DEPEND_SINK.
	(enum gfc_omp_linear_op): New.
	(struct gfc_omp_clauses): Add critical_name, depend_source,
	orderedc, defaultmap, nogroup, sched_simd, sched_monotonic,
	sched_nonmonotonic, simd, threads, grainsize, hint, num_tasks,
	priority and if_exprs fields.
	(enum gfc_exec_op): Add EXEC_OMP_END_CRITICAL,
	EXEC_OMP_TARGET_ENTER_DATA, EXEC_OMP_TARGET_EXIT_DATA,
	EXEC_OMP_TARGET_PARALLEL, EXEC_OMP_TARGET_PARALLEL_DO,
	EXEC_OMP_TARGET_PARALLEL_DO_SIMD, EXEC_OMP_TARGET_SIMD,
	EXEC_OMP_TASKLOOP, EXEC_OMP_TASKLOOP_SIMD.
	(enum gfc_omp_map_op): Add OMP_MAP_RELEASE,
	OMP_MAP_ALWAYS_TO, OMP_MAP_ALWAYS_FROM and OMP_MAP_ALWAYS_TOFROM.
	(OMP_LIST_IS_DEVICE_PTR, OMP_LIST_USE_DEVICE_PTR): New.
	(enum gfc_omp_if_kind): New.
	* module.c (enum ab_attribute): Add AB_OMP_DECLARE_TARGET_LINK.
	(attr_bits): Add AB_OMP_DECLARE_TARGET_LINK entry.
	(mio_symbol_attribute): Save and restore omp_declare_target_link bit.
	* trans.h (gfc_omp_scalar_p): New prototype.
	* frontend-passes.c (gfc_code_walker): Handle new OpenMP 4.5
	expressions.
	* trans.c (trans_code): Handle new OpenMP 4.5 constructs.
	* resolve.c (gfc_resolve_blocks): Likewise.
	(gfc_resolve_code): Likewise.
	* f95-lang.c (LANG_HOOKS_OMP_SCALAR_P): Redefine to gfc_omp_scalar_p.
	(gfc_attribute_table): Add "omp declare target link".
	* st.c (gfc_free_statement): Handle EXEC_OMP_END_CRITICAL like
	EXEC_OMP_CRITICAL before, free clauses for EXEC_OMP_CRITICAL
	and new OpenMP 4.5 constructs.  Free omp clauses even for
	EXEC_OMP_ORDERED.
	* match.c (match_exit_cycle): Rename collapse variable to count,
	set it to orderedc if non-zero, instead of collapse.
	* trans-decl.c (add_attributes_to_decl): Add "omp declare target link"
	instead of "omp declare target" for omp_declare_target_link.
	* trans-common.c (build_common_decl): Likewise.
	* match.h (gfc_match_omp_target_enter_data,
	gfc_match_omp_target_exit_data, gfc_match_omp_target_parallel,
	gfc_match_omp_target_parallel_do,
	gfc_match_omp_target_parallel_do_simd, gfc_match_omp_target_simd,
	gfc_match_omp_taskloop, gfc_match_omp_taskloop_simd,
	gfc_match_omp_end_critical, gfc_match_omp_ordered_depend): New
	prototypes.
	* parse.c (decode_omp_directive): Use gfc_match_omp_end_critical
	instead of gfc_match_omp_critical for !$omp end critical.
	Handle new OpenMP 4.5 constructs.  If ordered directive has
	depend clause as the first of the clauses, use
	gfc_match_omp_ordered_depend and ST_OMP_ORDERED_DEPEND instead of
	gfc_match_omp_ordered and ST_OMP_ORDERED.
	(case_executable): Add ST_OMP_TARGET_ENTER_DATA,
	ST_OMP_TARGET_EXIT_DATA and ST_OMP_ORDERED_DEPEND cases.
	(case_exec_markers): Add ST_OMP_TARGET_PARALLEL,
	ST_OMP_TARGET_PARALLEL_DO, ST_OMP_TARGET_PARALLEL_DO_SIMD,
	ST_OMP_TARGET_SIMD, ST_OMP_TASKLOOP and ST_OMP_TASKLOOP_SIMD cases.
	(gfc_ascii_statement): Handle new OpenMP 4.5 constructs.
	(parse_omp_do): Handle ST_OMP_TARGET_PARALLEL_DO,
	ST_OMP_TARGET_PARALLEL_DO_SIMD, ST_OMP_TASKLOOP and
	ST_OMP_TASKLOOP_SIMD.
	(parse_omp_structured_block): Handle EXEC_OMP_END_CRITICAL instead
	of EXEC_OMP_CRITICAL, adjust for EXEC_OMP_CRITICAL having omp clauses
	now.
	(parse_executable): Handle ST_OMP_TARGET_PARALLEL,
	ST_OMP_TARGET_PARALLEL_DO, ST_OMP_TARGET_PARALLEL_DO_SIMD,
	ST_OMP_TASKLOOP and ST_OMP_TASKLOOP_SIMD.
gcc/testsuite/
	* gfortran.dg/gomp/pr77516.f90: Add dg-warning.
	* gfortran.dg/gomp/target1.f90: Remove ordered clause where it is
	no longer allowed and corresponding ordered construct.
	* gfortran.dg/gomp/linear-1.f90: New test.
	* gfortran.dg/gomp/declare-simd-2.f90: New test.
	* gfortran.dg/gomp/declare-target-1.f90: New test.
	* gfortran.dg/gomp/declare-target-2.f90: New test.
libgomp/
	* testsuite/libgomp.fortran/examples-4/declare_target-1.f90
	(fib_wrapper): Add map(from: x) clause.
	* testsuite/libgomp.fortran/examples-4/declare_target-2.f90
	(e_53_2): Likewise.
	* testsuite/libgomp.fortran/examples-4/declare_target-4.f90
	(accum): Add map(tmp) clause.
	* testsuite/libgomp.fortran/examples-4/declare_target-5.f90
	(accum): Add map(tofrom: tmp) clause.
	* testsuite/libgomp.fortran/examples-4/target_data-3.f90
	(gramSchmidt): Likewise.
	* testsuite/libgomp.fortran/examples-4/teams-2.f90 (dotprod): Add
	map(tofrom: sum) clause.
	* testsuite/libgomp.fortran/nestedfn5.f90 (foo): Add twice
	map (alloc: a, l) clause.  Add defaultmap(tofrom: scalar) clause.
	* testsuite/libgomp.fortran/pr66199-2.f90: Adjust for linear clause
	only allowed on the loop iterator.
	* testsuite/libgomp.fortran/target4.f90 (foo): Add map(t) clause.
	* testsuite/libgomp.fortran/taskloop2.f90: New test.
	* testsuite/libgomp.fortran/taskloop4.f90: New test.
	* testsuite/libgomp.fortran/doacross1.f90: New test.
	* testsuite/libgomp.fortran/doacross3.f90: New test.
	* testsuite/libgomp.fortran/taskloop1.f90: New test.
	* testsuite/libgomp.fortran/taskloop3.f90: New test.
	* testsuite/libgomp.fortran/doacross2.f90: New test.
	* testsuite/libgomp.c/doacross-1.c (main): Add missing
	#pragma omp atomic read.
	* testsuite/libgomp.c/doacross-2.c (main): Likewise.
	* testsuite/libgomp.c/doacross-3.c (main): Likewise.

From-SVN: r242037
2016-11-10 12:38:05 +01:00
Cesar Philippidis 6668eb4593 nvptx.c (PTX_GANG_DEFAULT): Set to zero.
gcc/
	* config/nvptx/nvptx.c (PTX_GANG_DEFAULT): Set to zero.

	libgomp/
	* plugin/plugin-nvptx.c (nvptx_exec): Interrogate board attributes
	to determine default geometry.
	* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Set gang
	dimension.


Co-Authored-By: Nathan Sidwell <nathan@acm.org>

From-SVN: r241803
2016-11-02 15:10:02 -07:00
Jakub Jelinek f10e37a1c1 hashtab.h: Use standard GPLv3 with runtime exception boilerplate.
* hashtab.h: Use standard GPLv3 with runtime exception
	boilerplate.

From-SVN: r241746
2016-11-01 17:47:50 +01:00
Aldy Hernandez 015c776064 oacc-init.c (goacc_new_thread): Use sizeof of the appropriate size when allocating new thread.
* oacc-init.c (goacc_new_thread): Use sizeof of the appropriate
	size when allocating new thread.

From-SVN: r241627
2016-10-27 17:36:36 +00:00