Commit Graph

707 Commits

Author SHA1 Message Date
Tom de Vries 76680678a8 Fix GOMP/GOACC_parallel handling in find_func_clobbers
2015-12-09  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/68716
	* tree-ssa-structalias.c (find_func_clobbers): Fix handling of
	BUILT_IN_GOMP_PARALLEL and BUILT_IN_GOACC_PARALLEL.

	* testsuite/libgomp.c/omp-nested-2.c: New test.

From-SVN: r231449
2015-12-09 10:13:35 +00:00
Thomas Schwinge ff7a55bf56 Some OpenACC host_data cleanup
gcc/c/
	* c-parser.c (c_parser_omp_clause_name)
	(c_parser_oacc_all_clauses): Alphabetical sorting.
	gcc/cp/
	* parser.c (cp_parser_omp_clause_name)
	(cp_parser_oacc_all_clauses): Alphabetical sorting.
	* pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_USE_DEVICE.
	gcc/testsuite/
	* c-c++-common/goacc/host_data-5.c: New file.
	* c-c++-common/goacc/host_data-6.c: Likewise.
	* gfortran.dg/goacc/coarray.f95: XFAIL.
	* gfortran.dg/goacc/coarray_2.f90: Adjust dg-excess-errors
	directive.
	* gfortran.dg/goacc/host_data-tree.f95: Remove dg-prune-output
	directive.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/host_data-2.c: Restrict to
	target openacc_nvidia_accel_selected.
	* testsuite/libgomp.oacc-c-c++-common/host_data-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/host_data-5.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/host_data-3.c: Remove file.
	* testsuite/libgomp.oacc-c-c++-common/host_data-6.c: Remove file.

Co-Authored-By: James Norris <James_Norris@mentor.com>
Co-Authored-By: Julian Brown <julian@codesourcery.com>

From-SVN: r231184
2015-12-02 16:53:34 +01:00
Tom de Vries 694e5e4bae Handle BUILT_IN_GOACC_PARALLEL in ipa-pta
2015-12-02  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-structalias.c (find_func_aliases_for_builtin_call)
	(find_func_clobbers, ipa_pta_execute): Handle BUILT_IN_GOACC_PARALLEL.

	* c-c++-common/goacc/kernels-alias-ipa-pta-2.c: New test.
	* c-c++-common/goacc/kernels-alias-ipa-pta-3.c: New test.
	* c-c++-common/goacc/kernels-alias-ipa-pta.c: New test.

From-SVN: r231169
2015-12-02 13:32:51 +00:00
Julian Brown 37d5ad46dd OpenACC host_data support.
gcc/
	* gimple-pretty-print.c (dump_gimple_omp_target): Add host_data
	support.
	* gimple.h (gf_mask): Add GF_OMP_TARGET_KIND_OACC_HOST_DATA.
	(is_gimple_omp_oacc): Add support for above.
	* gimplify.c (omp_region_type): Add ORT_ACC_HOST_DATA.
	(omp_notice_variable): Diagnose undefined implicit uses of
	use_device variables in offloaded regions.
	(gimplify_scan_omp_clauses): Add host_data, use_device
	support. Diagnose undefined mapping of use_device variables in
	OpenACC clauses.
	(gimplify_omp_workshare): Add host_data support.
	(gimplify_expr): Likewise.
	* omp-builtins.def (BUILT_IN_GOACC_HOST_DATA): New.
	* omp-low.c (lookup_decl_in_outer_ctx)
	(maybe_lookup_decl_in_outer_ctx): Add optional argument to skip
	host_data regions.
	(scan_sharing_clauses): Support use_device.
	(check_omp_nesting_restrictions): Support host_data.
	(expand_omp_target): Support host_data.
	(lower_omp_target): Skip over outer host_data regions when looking
	up decls. Support use_device.
	(make_gimple_omp_edges): Support host_data.
	* tree-nested.c (convert_nonlocal_omp_clauses): Add use_device
	clause.

	gcc/c/
	* c-parser.c (c_parser_omp_clause_name): Add use_device support.
	(c_parser_oacc_clause_use_device): New function.
	(c_parser_oacc_all_clauses): Add use_device support.
	(OACC_HOST_DATA_CLAUSE_MASK): New macro.
	(c_parser_oacc_host_data): New function.
	(c_parser_omp_construct): Add host_data support.
	* c-tree.h (c_finish_oacc_host_data): Add prototype.
	* c-typeck.c (c_finish_oacc_host_data): New function.
	(c_finish_omp_clauses): Add use_device support.

	gcc/cp/
	* cp-tree.h (finish_oacc_host_data): Add prototype.
	* parser.c (cp_parser_omp_clause_name): Add use_device support.
	(cp_parser_oacc_all_clauses): Add use_device support.
	(OACC_HOST_DATA_CLAUSE_MASK): New macro.
	(cp_parser_oacc_host_data): New function.
	(cp_parser_omp_construct): Add host_data support.
	(cp_parser_pragma): Add host_data support.
	* semantics.c (finish_omp_clauses): Add use_device support.
	(finish_oacc_host_data): New function.

	gcc/c-family/
	* c-pragma.c (oacc_pragmas): Add PRAGMA_OACC_HOST_DATA.
	* c-pragma.h (pragma_kind): Add PRAGMA_OACC_HOST_DATA.
	(pragma_omp_clause): Add PRAGMA_OACC_CLAUSE_USE_DEVICE.

	libgomp/
	* oacc-parallel.c (GOACC_host_data): New function.
	* libgomp.map (GOACC_host_data): Add to GOACC_2.0.1.
	* testsuite/libgomp.oacc-c-c++-common/host_data-1.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/host_data-2.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/host_data-3.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/host_data-4.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/host_data-5.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/host_data-6.c: New test.


Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
Co-Authored-By: James Norris <James_Norris@mentor.com>

From-SVN: r231118
2015-12-01 15:52:23 +00:00
Cesar Philippidis db941d7ef7 tree-nested.c (convert_nonlocal_omp_clauses): Add support for OMP_CLAUSE_{NUM_GANGS,NUM_VECTORS,VECTOR_LENGTH,SEQ}.
gcc/
	* tree-nested.c (convert_nonlocal_omp_clauses): Add support for
	OMP_CLAUSE_{NUM_GANGS,NUM_VECTORS,VECTOR_LENGTH,SEQ}.
	(convert_local_omp_clauses): Likewise.

	gcc/fortran/
	* f95-lang.c (gfc_attribute_table): Add an "oacc function"
	attribute.
	* gfortran.h (symbol_attribute): Add an oacc_function bit-field.
	(gfc_oacc_routine_name): New struct;
	(gfc_get_oacc_routine_name): New macro.
	(gfc_namespace): Add oacc_routine_clauses, oacc_routine_names and
	oacc_routine fields.
	(gfc_exec_op): Add EXEC_OACC_ROUTINE.
	* openmp.c (OACC_ROUTINE_CLAUSES): New mask.
	(gfc_oacc_routine_dims): New function.
	(gfc_match_oacc_routine): Add support for named routines and the
	gang, worker vector and seq clauses.
	* parse.c (is_oacc): Add EXEC_OACC_ROUTINE.
	* resolve.c (gfc_resolve_blocks): Likewise.
	* st.c (gfc_free_statement): Likewise.
	* trans-decl.c (add_attributes_to_decl): Attach an 'oacc function'
	attribute and shape geometry for acc routine.

	gcc/testsuite/
	* gfortran.dg/goacc/routine-3.f90: New test.
	* gfortran.dg/goacc/routine-4.f90: New test.
	* gfortran.dg/goacc/routine-5.f90: New test.
	* gfortran.dg/goacc/routine-6.f90: New test.
	* gfortran.dg/goacc/subroutines: New test.

	libgomp/
	* libgomp.oacc-fortran/routine-5.f90: New test.
	* libgomp.oacc-fortran/routine-7.f90: New test.
	* libgomp.oacc-fortran/routine-9.f90: New test.

From-SVN: r231081
2015-11-30 11:09:33 -08:00
Tom de Vries e0ca27c531 Handle BUILT_IN_GOMP_PARALLEL in ipa-pta
2015-11-30  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/46032
	* tree-ssa-structalias.c (find_func_aliases_for_call_arg): New function,
	factored out of ...
	(find_func_aliases_for_call): ... here.
	(find_func_aliases_for_builtin_call, find_func_clobbers): Handle
	BUILT_IN_GOMP_PARALLEL.
	(ipa_pta_execute): Same.  Handle node->parallelized_function as a local
	function.

	* gcc.dg/pr46032.c: New test.

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

From-SVN: r231076
2015-11-30 16:34:26 +00:00
Jakub Jelinek 8e4e471966 re PR libgomp/68579 (FAIL: libgomp.c/target-32.c execution test)
PR libgomp/68579
	* task.c (gomp_task_run_post_handle_depend_hash): New forward decl.
	(gomp_create_target_task): Call it before freeing
	GOMP_TARGET_TASK_DATA tasks.

From-SVN: r231023
2015-11-27 20:33:33 +01:00
Jakub Jelinek aec17bfe91 re PR c/63326 (whether a #pragma is a statement depends on the type of pragma)
PR c/63326
	* c-parser.c (c_parser_compound_statement_nostart): If
	last_label is true, use pragma_stmt instead of pragma_compound
	as second c_parser_pragma argument.
	(c_parser_omp_ordered, c_parser_omp_target_update,
	c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Pass
	false as second argument to c_parser_skip_to_pragma_eol after
	diagnosing standalone directives used in pragma_stmt context.

	* parser.c (cp_parser_statement): Clear in_compound after labels.

	* gcc.dg/gomp/barrier-2.c (f2): Expect another error after label.
	* c-c++-common/gomp/pr63326.c: New test.

	* testsuite/libgomp.c/cancel-parallel-2.c (foo): Add semicolon
	in between case label and OpenMP standalone directives.
	* testsuite/libgomp.c++/cancel-parallel-2.C (foo): Likewise.

From-SVN: r230999
2015-11-27 09:59:55 +01:00
David Edelsohn 3e0fb1a3e3 Fix typo
From-SVN: r230954
2015-11-26 08:44:36 -05:00
David Edelsohn 6cfe90e6d7 * configure: Regenerate.
From-SVN: r230950
2015-11-26 08:27:21 -05:00
Jakub Jelinek 0e65fd7d19 * testsuite/libgomp.c/target-35.c: New test.
From-SVN: r230926
2015-11-26 10:44:49 +01:00
James Norris dc7a8b4b7a dump-parse-tree.c (show_namespace): Handle declares.
gcc/fortran/
	* dump-parse-tree.c (show_namespace): Handle declares.
	* gfortran.h (struct symbol_attribute): New fields.
	(enum gfc_omp_map_map): Add OMP_MAP_DEVICE_RESIDENT and OMP_MAP_LINK.
	(OMP_LIST_LINK): New enum.
	(struct gfc_oacc_declare): New structure.
	(gfc_get_oacc_declare): New definition.
	(struct gfc_namespace): Change type.
	(enum gfc_exec_op): Add EXEC_OACC_DECLARE.
	(struct gfc_code): New field.
	* module.c (enum ab_attribute): Add AB_OACC_DECLARE_CREATE,
	AB_OACC_DECLARE_COPYIN, AB_OACC_DECLARE_DEVICEPTR,
	AB_OACC_DECLARE_DEVICE_RESIDENT, AB_OACC_DECLARE_LINK
	(attr_bits): Add new initializers.
	(mio_symbol_attribute): Handle new atributes.
	* openmp.c (gfc_free_oacc_declare_clauses): New function.
	(gfc_match_oacc_clause_link: Likewise.
	(OMP_CLAUSE_LINK): New definition.
	(gfc_match_omp_clauses): Handle OMP_CLAUSE_LINK.
	(OACC_DECLARE_CLAUSES): Add OMP_CLAUSE_LINK
	(gfc_match_oacc_declare): Add checking and module handling.
	(resolve_omp_clauses): Add array initializer.
	(gfc_resolve_oacc_declare): Reimplement.
	* parse.c (case_decl): Add ST_OACC_DECLARE.
	(parse_spec): Remove handling.
	(parse_progunit): Remove handling.
	* parse.h (struct gfc_state_data): Change type.
	* resolve.c (gfc_resolve_blocks): Handle EXEC_OACC_DECLARE.
	* st.c (gfc_free_statement): Handle EXEC_OACC_DECLARE.
	* symbol.c (check_conflict): Add conflict checks.
	(gfc_add_oacc_declare_create, gfc_add_oacc_declare_copyin, 
	gfc_add_oacc_declare_deviceptr, gfc_add_oacc_declare_device_resident):
	New functions.
	(gfc_copy_attr): Handle new symbols.
	* trans-decl.c (add_clause, find_module_oacc_declare_clauses,
	finish_oacc_declare): New functions.
	(gfc_generate_function_code): Replace with call.
	* trans-openmp.c (gfc_trans_oacc_declare): Reimplement.
	(gfc_trans_oacc_directive): Handle EXEC_OACC_DECLARE.
	* trans-stmt.c (gfc_trans_block_construct): Replace with call.
	* trans-stmt.h (gfc_trans_oacc_declare): Remove argument.
	* trans.c (trans_code): Handle EXEC_OACC_DECLARE.

	gcc/testsuite
	* gfortran.dg/goacc/declare-1.f95: Update test.
	* gfortran.dg/goacc/declare-2.f95: New test.

	libgomp/
	* testsuite/libgomp.oacc-fortran/declare-1.f90: New test.
	* 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.

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

From-SVN: r230722
2015-11-22 16:45:38 +00:00
Jakub Jelinek 48a78aee68 re PR middle-end/68221 (libgomp reduction-11/12 failures)
PR middle-end/68221
	* omp-low.c (lower_rec_input_clauses): If C/C++ array reduction
	has non-zero bias, subtract it in integer type instead of
	pointer plus of negated bias.

	* testsuite/libgomp.c/reduction-11.c: Remove xfail.
	* testsuite/libgomp.c/reduction-12.c: Likewise.
	* testsuite/libgomp.c++/reduction-11.C: Likewise.
	* testsuite/libgomp.c++/reduction-12.C: Likewise.

From-SVN: r230672
2015-11-20 20:50:46 +01:00
Nathan Sidwell 2d25681660 reduction-dbl.c: New.
* libgomp.oacc-c-c++-common/reduction-dbl.c: New.
	* libgomp.oacc-c-c++-common/reduction-flt.c: New.
	* libgomp.oacc-c-c++-common/reduction-cplx-dbl.c: Use typedef.
	* libgomp.oacc-c-c++-common/reduction-cplx-flt.c: Use typedef.
	* libgomp.oacc-c-c++-common/reduction-2.c: Uncomment broken tests
	and fix.
	* libgomp.oacc-c-c++-common/reduction-3.c: Likewise.
	* libgomp.oacc-c-c++-common/reduction-4.c: Likewise.

From-SVN: r230621
2015-11-19 18:58:39 +00:00
Nathan Sidwell 33f47f4279 nvptx.c (global_lock_var): New.
gcc/
	* config/nvptx/nvptx.c (global_lock_var): New.
	(nvptx_global_lock_addr): New.
	(nvptx_lockless_update): Recomment and adjust for clarity.
	(nvptx_lockfull_update): New.
	(nvptx_reduction_update): New.
	(nvptx_goacc_reduction_fini): Call it.

	libgcc/
	* config/nvptx/reduction.c: New.
	* config/nvptx/t-nvptx (LIB2ADD): Add it.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/reduction-cplx-flt.c: Add
	worker & gang cases.
	* testsuite/libgomp.oacc-c-c++-common/reduction-cplx-dbl.c: Likewise.

From-SVN: r230545
2015-11-18 13:49:17 +00:00
Cesar Philippidis 3d7bfee0b0 priority_queue.c: New file.
libgomp/
	* config/nvptx/priority_queue.c: New file.

From-SVN: r230466
2015-11-17 09:29:34 -08:00
Jakub Jelinek 00b9bd52a8 libgomp.texi: Update references from OpenMP 4.0 to OpenMP 4.5 sections.
* libgomp.texi: Update references from OpenMP 4.0 to OpenMP 4.5
	sections.

From-SVN: r230384
2015-11-14 23:02:42 +01:00
Jakub Jelinek e460634820 omp-low.c (lower_omp_ordered): Add argument to GOMP_SMD_ORDERED_* internal calls - 0 if...
gcc/
2015-11-14  Jakub Jelinek  <jakub@redhat.com>

	* omp-low.c (lower_omp_ordered): Add argument to GOMP_SMD_ORDERED_*
	internal calls - 0 if ordered simd and 1 for ordered threads simd.
	* tree-vectorizer.c (adjust_simduid_builtins): If GOMP_SIMD_ORDERED_*
	argument is 1, replace it with GOMP_ordered_* call instead of removing
	it.
gcc/c/
2015-11-14  Jakub Jelinek  <jakub@redhat.com>

	* c-typeck.c (c_finish_omp_clauses): Don't mark
	GOMP_MAP_FIRSTPRIVATE_POINTER decls addressable.
gcc/cp/
2015-11-14  Jakub Jelinek  <jakub@redhat.com>

	* semantics.c (finish_omp_clauses): Don't mark
	GOMP_MAP_FIRSTPRIVATE_POINTER decls addressable.
libgomp/
2015-11-14  Jakub Jelinek  <jakub@redhat.com>
	    Aldy Hernandez  <aldyh@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* ordered.c (gomp_doacross_init, GOMP_doacross_post,
	GOMP_doacross_wait, gomp_doacross_ull_init, GOMP_doacross_ull_post,
	GOMP_doacross_ull_wait): For GFS_GUIDED don't divide number of
	iterators or IV by chunk size.
	* parallel.c (gomp_resolve_num_threads): Don't assume that
	if thr->ts.team is non-NULL, then pool must be non-NULL.
	* libgomp-plugin.h (GOMP_PLUGIN_target_task_completion): Declare.
	* libgomp.map (GOMP_PLUGIN_1.1): New symbol version, export
	GOMP_PLUGIN_target_task_completion.
	* Makefile.am (libgomp_la_SOURCES): Add priority_queue.c.
	* Makefile.in: Regenerate.
	* libgomp.h: Shuffle prototypes and forward definitions around so
	priority queues can be defined.
	(enum gomp_task_kind): Add GOMP_TASK_ASYNC_RUNNING.
	(enum gomp_target_task_state): New enum.
	(struct gomp_target_task): Add state, tgt, task and team fields.
	(gomp_create_target_task): Change return type to bool, add
	state argument.
	(gomp_target_task_fn): Change return type to bool.
	(struct gomp_device_descr): Add async_run_func.
	(struct gomp_task): Remove children, next_child, prev_child,
	next_queue, prev_queue, next_taskgroup, prev_taskgroup.
	Add pnode field.
	(struct gomp_taskgroup): Remove children.
	Add taskgroup_queue.
	(struct gomp_team): Change task_queue type to a priority queue.
	(splay_compare): Define inline.
	(priority_queue_offset): New.
	(priority_node_to_task): New.
	(task_to_priority_node): New.
	* oacc-mem.c: Do not include splay-tree.h.
	* priority_queue.c: New file.
	* priority_queue.h: New file.
	* splay-tree.c: Do not include splay-tree.h.
	(splay_tree_foreach_internal): New.
	(splay_tree_foreach): New.
	* splay-tree.h: Become re-entrant if splay_tree_prefix is defined.
	(splay_tree_callback): Define typedef.
	* target.c (splay_compare): Move to libgomp.h.
	(GOMP_target): Don't adjust *thr in any way around running offloaded
	task.
	(GOMP_target_ext): Likewise.  Handle target nowait.
	(GOMP_target_update_ext, GOMP_target_enter_exit_data): Check
	return value from gomp_create_target_task, if false, fallthrough
	as if no dependencies exist.
	(gomp_target_task_fn): Change return type to bool, return true
	if the task should have another part scheduled later.  Handle
	target nowait.
	(gomp_load_plugin_for_device): Initialize async_run.
	* task.c (gomp_init_task): Initialize children_queue.
	(gomp_clear_parent_in_list): New.
	(gomp_clear_parent_in_tree): New.
	(gomp_clear_parent): Handle priorities.
	(GOMP_task): Likewise.
	(priority_queue_move_task_first,
	gomp_target_task_completion, GOMP_PLUGIN_target_task_completion):
	New functions.
	(gomp_create_target_task): Use priority queues.  Change return type
	to bool, add state argument, return false if for async
	{{enter,exit} data,update} constructs no dependencies need to be
	waited for, handle target nowait.  Set task->fn to NULL instead of
	gomp_target_task_fn.
	(verify_children_queue): Remove.
	(priority_list_upgrade_task): New.
	(priority_queue_upgrade_task): New.
	(verify_task_queue): Remove.
	(priority_list_downgrade_task): New.
	(priority_queue_downgrade_task): New.
	(gomp_task_run_pre): Use priority queues.
	Abstract code out to priority_queue_downgrade_task.
	(gomp_task_run_post_handle_dependers): Use priority queues.
	(gomp_task_run_post_remove_parent): Likewise.
	(gomp_task_run_post_remove_taskgroup): Likewise.
	(gomp_barrier_handle_tasks): Likewise.  Handle target nowait target
	tasks specially.
	(GOMP_taskwait): Likewise.
	(gomp_task_maybe_wait_for_dependencies): Likewise.  Abstract code to
	priority-queue_upgrade_task.
	(GOMP_taskgroup_start): Use priority queues.
	(GOMP_taskgroup_end): Likewise.  Handle target nowait target tasks
	specially.  If taskgroup is NULL, and thr->ts.level is 0, act as a
	barrier.
	* taskloop.c (GOMP_taskloop): Handle priorities.
	* team.c (gomp_new_team): Call priority_queue_init.
	(free_team): Call priority_queue_free.
	(gomp_free_thread): Call gomp_team_end if thr->ts.team is artificial
	team created for target nowait in implicit parallel region.
	(gomp_team_start): For nested check, test thr->ts.level instead of
	thr->ts.team != NULL.
	* testsuite/libgomp.c/doacross-3.c: New test.
	* testsuite/libgomp.c/ordered-5.c: New test.
	* testsuite/libgomp.c/priority.c: New test.
	* testsuite/libgomp.c/target-31.c: New test.
	* testsuite/libgomp.c/target-32.c: New test.
	* testsuite/libgomp.c/target-33.c: New test.
	* testsuite/libgomp.c/target-34.c: New test.
liboffloadmic/
2015-11-14  Ilya Verbin  <ilya.verbin@intel.com>

	* runtime/offload_host.cpp (task_completion_callback): New
	variable.
	(offload_proxy_task_completed_ooo): Call task_completion_callback.
	(__offload_register_task_callback): New function.
	* runtime/offload_host.h (__offload_register_task_callback): New
	declaration.
	* plugin/libgomp-plugin-intelmic.cpp (offload): Add async_data
	argument, handle async offloading.
	(register_main_image): Call register_main_image.
	(GOMP_OFFLOAD_init_device, get_target_table, GOMP_OFFLOAD_alloc,
	GOMP_OFFLOAD_free, GOMP_OFFLOAD_host2dev, GOMP_OFFLOAD_dev2host,
	GOMP_OFFLOAD_dev2dev) Adjust offload callers.
	(GOMP_OFFLOAD_async_run): New function.
	(GOMP_OFFLOAD_run): Implement using GOMP_OFFLOAD_async_run.

From-SVN: r230381
2015-11-14 19:42:13 +01:00
Nathan Sidwell c5a64cfec7 omp-low.c (scan_sharing_clauses): Accept INDEPENDENT, AUTO & SEQ.
gcc/
	* gcc/omp-low.c (scan_sharing_clauses): Accept INDEPENDENT, AUTO &
	SEQ.
	(oacc_loop_fixed_partitions): Correct return type to bool.
	(oacc_loop_auto_partitions): New.
	(oacc_loop_partition): Take mask argument, call
	oacc_loop_auto_partitions.
	(execute_oacc_device_lower): Provide mask to oacc_loop_partition.

	gcc/testsuite/
	* c-c++-common/goacc/loop-auto-1.c: New.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: New.

From-SVN: r230354
2015-11-13 21:51:32 +00:00
Nathan Sidwell 1d1ab74fcb collapse-2.c: Sequential loop is sequential.
* testsuite/libgomp.oacc-c-c++-common/collapse-2.c: Sequential
	loop is sequential.

From-SVN: r230333
2015-11-13 16:53:28 +00:00
Nathan Sidwell dd3c1b14af nvptx.c (nvptx_generate_vector_shuffle): Deal with complex types.
gcc/
	* config/nvptx/nvptx.c (nvptx_generate_vector_shuffle): Deal with
	complex types.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/reduction-cplx-dbl.c: New.
	* testsuite/libgomp.oacc-c-c++-common/reduction-cplx-flt.c: New.

From-SVN: r230325
2015-11-13 15:08:11 +00:00
James Norris 6e232ba424 c-pragma.c (oacc_pragmas): Add entry for declare directive.
2015-11-12  James Norris  <jnorris@codesourcery.com>
	    Joseph Myers  <joseph@codesourcery.com>

	gcc/c-family/
	* c-pragma.c (oacc_pragmas): Add entry for declare directive. 
	* c-pragma.h (enum pragma_kind): Add PRAGMA_OACC_DECLARE.
	(enum pragma_omp_clause): Add PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT and
	PRAGMA_OACC_CLAUSE_LINK.

	gcc/c/
	* c-parser.c (c_parser_pragma): Handle PRAGMA_OACC_DECLARE.
	(c_parser_omp_clause_name): Handle 'device_resident' clause.
	(c_parser_oacc_data_clause): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
	and PRAGMA_OMP_CLAUSE_LINK.
	(c_parser_oacc_all_clauses): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
	and PRAGMA_OACC_CLAUSE_LINK.
	(OACC_DECLARE_CLAUSE_MASK): New definition.
	(c_parser_oacc_declare): New function.

	gcc/cp/
	* parser.c (cp_parser_omp_clause_name): Handle 'device_resident'
	clause.
	(cp_parser_oacc_data_clause): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
	and PRAGMA_OMP_CLAUSE_LINK.
	(cp_paser_oacc_all_clauses): Handle PRAGMA_OACC_CLAUSE_DEVICE_RESIDENT
	and PRAGMA_OMP_CLAUSE_LINK.
	(OACC_DECLARE_CLAUSE_MASK): New definition.
	(cp_parser_oacc_declare): New function.
	(cp_parser_pragma): Handle PRAGMA_OACC_DECLARE.
	* pt.c (tsubst_expr): Handle OACC_DECLARE.

	gcc/
	* gimple-pretty-print.c (dump_gimple_omp_target): Handle
	GF_OMP_TARGET_KIND_OACC_DECLARE. 
	* gimple.h (enum gf_mask): Add GF_OMP_TARGET_KIND_OACC_DECLARE.
	(is_gomple_omp_oacc): Handle GF_OMP_TARGET_KIND_OACC_DECLARE.
	* gimplify.c (oacc_declare_returns): New.
	(gimplify_bind_expr): Prepend 'exit' stmt to cleanup.
	(device_resident_p): New function.
	(oacc_default_clause): Handle device_resident clause.
	(gimplify_oacc_declare_1, gimplify_oacc_declare): New functions.
	(gimplify_expr): Handle OACC_DECLARE.
	* omp-builtins.def (BUILT_IN_GOACC_DECLARE): New builtin.
	* omp-low.c (expand_omp_target): Handle
	GF_OMP_TARGET_KIND_OACC_DECLARE and BUILTIN_GOACC_DECLARE.
	(build_omp_regions_1): Handlde GF_OMP_TARGET_KIND_OACC_DECLARE.
	(lower_omp_target): Handle GF_OMP_TARGET_KIND_OACC_DECLARE,
	GOMP_MAP_DEVICE_RESIDENT and GOMP_MAP_LINK.
	(make_gimple_omp_edges): Handle GF_OMP_TARGET_KIND_OACC_DECLARE.
	* tree-pretty-print.c (dump_omp_clause): Handle GOMP_MAP_LINK and
	GOMP_MAP_DEVICE_RESIDENT.

	gcc/testsuite
	* c-c++-common/goacc/declare-1.c: New test.
	* c-c++-common/goacc/declare-2.c: Likewise.

	include/
	* gomp-constants.h (enum gomp_map_kind): Add GOMP_MAP_DEVICE_RESIDENT
	and GOMP_MAP_LINK.

	libgomp/
	* libgomp.map (GOACC_2.0.1): Export GOACC_declare.
	* oacc-parallel.c (GOACC_declare): New function.
	* testsuite/libgomp.oacc-c-c++-common/declare-1.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/declare-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/declare-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/declare-5.c: Likewise.
	* testsuite/libgomp.oacc-c++/declare-1.C: Likewise.

Co-Authored-By: Joseph Myers <joseph@codesourcery.com>

From-SVN: r230275
2015-11-12 22:20:41 +00:00
Nathan Sidwell fffeedeb5a gimplify.c (oacc_default_clause): New.
gcc/
	* gimplify.c (oacc_default_clause): New.
	(omp_notice_variable): Call it.

	gcc/testsuite/
	* c-c++-common/goacc/data-default-1.c: New.

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

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

From-SVN: r230256
2015-11-12 13:51:13 +00:00
Nathan Sidwell 182190f2b3 gimplify.c (enum omp_region_type): Add ORT_ACC, ORT_ACC_DATA, ORT_ACC_PARALLEL, ORT_ACC_KERNELS.
gcc/
	* gcc/gimplify.c (enum  omp_region_type): Add ORT_ACC,
	ORT_ACC_DATA, ORT_ACC_PARALLEL, ORT_ACC_KERNELS.  Adjust ORT_NONE.
	(gimple_add_tmp_var): Add ORT_ACC checks.
	(gimplify_var_or_parm_decl): Likewise.
	(omp_firstprivatize_variable): Likewise. Use ORT_TARGET_DATA as a
	mask.
	(omp_add_variable): Look in outer contexts for openacc and allow
	reductions with other sharing. Add ORT_ACC and ORT_TARGET_DATA
	checks.
	(omp_notice_variable, omp_is_private, omp_check_private): Add
	ORT_ACC checks.
	(gimplify_scan_omp_clauses: Treat ORT_ACC as ORT_WORKSHARE.
	Permit private openacc reductions.
	(gimplify_oacc_cache): Specify ORT_ACC.
	(gimplify_omp_workshare): Adjust OpenACC region types.
	(gimplify_omp_target_update): Likewise.
	* gcc/omp-low.c (scan_sharing_clauses): Remove Openacc
	firstprivate sorry.
	(lower-rec_input_clauses): Don't handle openacc firstprivate
	references here.
	(lower_omp_target): Emit initializers for openacc firstprivate vars.

	gcc/testsuite/
	* gfortran.dg/goacc/private-3.f95: Remove xfail.
	* gfortran.dg/goacc/combined_loop.f90: Remove xfail.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c: Remove xfail.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Remove xfail.
	* testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/firstprivate-2.c: New.

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

From-SVN: r230169
2015-11-11 14:24:09 +00:00
Nathan Sidwell d350c40cfd firstprivate-1.c: Remove inadvertent commit.
* testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c: Remove
	inadvertent commit.

From-SVN: r230107
2015-11-10 13:51:09 +00:00
Nathan Sidwell 36fa0f5f68 routine-1.c: New.
gcc/testsuite/
	* c-c++-common/goacc/routine-1.c: New.
	* c-c++-common/goacc/routine-2.c: New.
	* c-c++-common/goacc/routine-3.c: New.
	* c-c++-common/goacc/routine-4.c: New.
	* c-c++-common/goacc/routine-5.c: New.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/routine-g-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/routine-v-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c: New.

From-SVN: r230080
2015-11-10 01:01:15 +00:00
Thomas Schwinge 66a5f0b45f XFAIL testcases regressed after r229814, "Merge from gomp-4_5-branch to trunk"
gcc/testsuite/
	* gfortran.dg/goacc/private-3.f95: XFAIL.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c: XFAIL.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise.

From-SVN: r229841
2015-11-06 12:11:34 +01:00
Jakub Jelinek e01d41e553 gcc/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* builtin-types.def
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR): Remove.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): New.
	* cgraph.h (enum cgraph_simd_clone_arg_type): Add
	SIMD_CLONE_ARG_TYPE_LINEAR_REF_VARIABLE_STEP,
	SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_VARIABLE_STEP and
	SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP.
	(struct cgraph_simd_clone_arg): Adjust comment.
	* omp-builtins.def (BUILT_IN_GOMP_TARGET): Rename GOMP_target_41
	to GOMP_target_ext.  Add num_teams and thread_limit arguments.
	(BUILT_IN_GOMP_TARGET_DATA): Rename GOMP_target_data_41
	to GOMP_target_data_ext.
	(BUILT_IN_GOMP_TARGET_UPDATE): Rename GOMP_target_update_41
	to GOMP_target_update_ext.
	(BUILT_IN_GOMP_LOOP_NONMONOTONIC_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_NONMONOTONIC_GUIDED_START,
	BUILT_IN_GOMP_LOOP_NONMONOTONIC_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_NONMONOTONIC_GUIDED_NEXT,
	BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_GUIDED_START,
	BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_GUIDED_NEXT,
	BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_DYNAMIC,
	BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_GUIDED): New built-ins.
	* tree-core.h (enum omp_clause_schedule_kind): Add
	OMP_CLAUSE_SCHEDULE_MASK, OMP_CLAUSE_SCHEDULE_MONOTONIC,
	OMP_CLAUSE_SCHEDULE_NONMONOTONIC and change
	OMP_CLAUSE_SCHEDULE_LAST value.
	* tree.def (OMP_SIMD, CILK_SIMD, CILK_FOR, OMP_DISTRIBUTE,
	OMP_TASKLOOP, OACC_LOOP): Add OMP_FOR_ORIG_DECLS argument.
	* tree.h (OMP_FOR_ORIG_DECLS): Use OMP_LOOP_CHECK instead of
	OMP_FOR_CHECK.  Remove comment.
	* tree-pretty-print.c (dump_omp_clause): Handle
	GOMP_MAP_FIRSTPRIVATE_REFERENCE and GOMP_MAP_ALWAYS_POINTER.
	Simplify.  Print schedule clause modifiers.
	* tree-vect-stmts.c (vectorizable_simd_clone_call): Add
	SIMD_CLONE_ARG_TYPE_LINEAR_{REF,VAL,UVAL}_VARIABLE_STEP
	cases.
	* gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_ALWAYS_TO.
	(omp_default_clause): Tweak for
	private/firstprivate/is_device_ptr variables on target
	construct and use_device_ptr on target data.
	(omp_check_private): Likewise.
	(omp_notice_variable): For references check whether what it refers
	to has mappable type, rather than the reference itself.
	(omp_is_private): Diagnose linear iteration variables on non-simd
	constructs.
	(omp_no_lastprivate): Return true only for Fortran.
	(gimplify_scan_omp_clauses): Or in GOVD_MAP_ALWAYS_TO for
	GOMP_MAP_ALWAYS_TO or GOMP_MAP_ALWAYS_TOFROM kinds.
	Add support for GOMP_MAP_FIRSTPRIVATE_REFERENCE and
	GOMP_MAP_ALWAYS_POINTER, remove old handling of structure element
	based array sections.  Use GOMP_MAP_ALWAYS_P.  Fix up handling of
	lastprivate and linear when combined with distribute.  Gimplify
	variable low-bound for array reduction.  Look through
	POINTER_PLUS_EXPR when looking for ADDR_EXPR for array section
	reductions.
	(gimplify_adjust_omp_clauses_1): For implicit references to
	variables with reference type and when not ref to scalar or
	ref to pointer, map what they refer to using tofrom and
	use GOMP_MAP_FIRSTPRIVATE_REFERENCE for the reference.
	(gimplify_adjust_omp_clauses): Remove GOMP_MAP_ALWAYS_POINTER
	from target exit data.  Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE.
	Drop OMP_CLAUSE_MAP_PRIVATE support.  Use GOMP_MAP_ALWAYS_P.
	Diagnose the same var on both firstprivate and lastprivate on
	distribute construct.
	(gimplify_omp_for): Fix up handling of predetermined
	lastprivate or linear iter vars when combined with distribute.
	(find_omp_teams, computable_teams_clause, optimize_target_teams): New
	functions.
	(gimplify_omp_workshare): Call optimize_target_teams.
	* omp-low.c (struct omp_region): Add sched_modifiers field.
	(struct omp_for_data): Likewise.
	(omp_any_child_fn_dumped): New variable.
	(extract_omp_for_data): Fill in sched_modifiers, and mask out
	OMP_CLAUSE_SCHEDULE_KIND bits outside of OMP_CLAUSE_SCHEDULE_MASK
	from sched_kind.
	(determine_parallel_type): Use only OMP_CLAUSE_SCHEDULE_MASK
	bits of OMP_CLAUSE_SCHED_KIND.
	(scan_sharing_clauses): Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE,
	drop OMP_CLAUSE_MAP_PRIVATE support.  Look through POINTER_PLUS_EXPR
	for array section reductions.
	(add_taskreg_looptemp_clauses): Add one extra _looptemp_ clause even
	for distribute parallel for, if there are lastprivate clauses on the
	for.
	(lower_rec_input_clauses): Handle non-zero low-bound on array
	section reductions.
	(lower_reduction_clauses): Likewise.
	(lower_send_clauses): Look through POINTER_PLUS_EXPR
	for array section reductions.
	(expand_parallel_call): Use nonmonotonic entrypoints for
	nonmonotonic: dynamic/guided.
	(expand_omp_taskreg): Call assign_assembler_name_if_neeeded on
	child_fn if current_function_decl has assembler name set, but child_fn
	does not.  Dump the header and IL of the child function when not in SSA
	form.
	(expand_omp_target): Likewise.  Pass num_teams and thread_limit
	arguments to BUILT_IN_GOMP_TARGET.
	(expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
	Initialize the extra _looptemp_ clause to fd->loop.n2.
	(expand_omp_for): Use nonmonotonic entrypoints for
	nonmonotonic: dynamic/guided.  Initialize region->sched_modifiers.
	(expand_omp): Clear omp_any_child_fn_dumped.  Dump function header
	again if we have dumped any child functions.
	(lower_omp_for_lastprivate): Determine the right count variable
	for distribute simd, or distribute parallel for{, simd}.
	(lower_omp_target): Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE
	and GOMP_MAP_ALWAYS_POINTER.  Drop OMP_CLAUSE_MAP_PRIVATE
	support.
	(simd_clone_clauses_extract): Handle variable step
	for references and arguments passed by reference.
	(simd_clone_mangle): Mangle ref/uval/val variable steps.
	(simd_clone_adjust_argument_types): Handle
	SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_VARIABLE_STEP like
	SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP and
	SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP like
	SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP.
	(simd_clone_linear_addend): New function.
	(simd_clone_adjust): Handle variable step like similarly
	to constant step, use simd_clone_linear_addend to determine
	the actual step at runtime.
gcc/c-family/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>

	* c-common.h (c_finish_omp_atomic): Add TEST argument.
	(c_omp_check_loop_iv, c_omp_check_loop_iv_exprs): New prototypes.
	* c-omp.c (c_finish_omp_atomic): Add TEST argument.  Don't call
	save_expr or create_tmp_var* if TEST is true.
	(c_finish_omp_for): Store OMP_FOR_ORIG_DECLS always.
	Don't call add_stmt here.
	(struct c_omp_check_loop_iv_data): New type.
	(c_omp_check_loop_iv_r, c_omp_check_loop_iv,
	c_omp_check_loop_iv_exprs): New functions.
	(c_omp_split_clauses): Adjust for lastprivate being allowed on
	distribute.
	(c_omp_declare_simd_clauses_to_numbers): Change
	OMP_CLAUSE_LINEAR_VARIABLE_STRIDE OMP_CLAUSE_LINEAR_STEP into numbers.
	(c_omp_declare_simd_clauses_to_decls): Similarly change those
	from numbers to PARM_DECLs.
gcc/c/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* c-parser.c: Include context.h and gimple-expr.h.
	(c_parser_omp_clause_schedule): Parse schedule modifiers, diagnose
	monotonic together with nonmonotonic.
	(c_parser_omp_for_loop): Call c_omp_check_loop_iv.  Call add_stmt here.
	(OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause.
	(c_parser_omp_target_data, c_parser_omp_target_enter_data,
	c_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER.
	(c_parser_omp_target): Likewise.  Evaluate num_teams and thread_limit
	expressions on combined target teams before the target.
	(c_parser_omp_declare_target): If decl has "omp declare target" or
	"omp declare target link" attribute, and cgraph or varpool node already
	exists, then set corresponding flags.  Call c_finish_omp_clauses
	in the parenthesized extended-list syntax case.
	* c-decl.c (c_decl_attributes): Don't diagnose block scope vars inside
	declare target.
	* c-typeck.c (handle_omp_array_sections_1): Allow non-zero low-bound
	on OMP_CLAUSE_REDUCTION array sections.
	(handle_omp_array_sections): Encode low-bound into the MEM_REF, either
	into the constant offset, or for variable low-bound using
	POINTER_PLUS_EXPR.  For structure element based array sections use
	GOMP_MAP_ALWAYS_POINTER instead of GOMP_MAP_FIRSTPRIVATE_POINTER.
	(c_finish_omp_clauses): Drop generic_field_head, structure
	elements are now always mapped even as array section bases,
	diagnose same var in data sharing and mapping clauses.  Diagnose if
	linear step on declare simd is neither a constant nor a uniform
	parameter.  Look through POINTER_PLUS_EXPR for array section
	reductions.  Diagnose the same var or function appearing multiple
	times on the same directive.  Fix up wording for the to clause if t
	is neither a FUNCTION_DECL nor a VAR_DECL.  Diagnose nonmonotonic
	modifier on kinds other than dynamic or guided or nonmonotonic
	modifier together with ordered clause.
gcc/cp/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* cp-tree.h (finish_omp_for): Add ORIG_INITS argument.
	(omp_privatize_field): Add SHARED argument.
	* parser.c: Include context.h.
	(cp_parser_omp_clause_schedule): Parse schedule
	modifiers, diagnose monotonic together with nonmonotonic.
	(cp_parser_omp_clause_linear): Add DECLARE_SIMD argument.  Parse
	parameter name as linear step as id-expression rather than expression.
	(cp_parser_omp_all_clauses): Adjust caller.
	(cp_parser_omp_for_loop_init): Add ORIG_INIT argument,
	initialize it.  Adjust omp_privatize_field caller.
	(cp_parser_omp_for_loop): Compute orig_inits, pass it's address
	to finish_omp_for.
	(OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause.
	(cp_parser_omp_target_data,
	cp_parser_omp_target_enter_data,
	cp_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER
	and GOMP_MAP_FIRSTPRIVATE_REFERENCE.
	(cp_parser_omp_target): Likewise.  Evaluate num_teams and
	thread_limit expressions on combined target teams before the target.
	(cp_parser_omp_declare_target): If decl has "omp declare target" or
	"omp declare target link" attribute, and cgraph or varpool node already
	exists, then set corresponding flags.  Call finish_omp_clauses
	in the parenthesized extended-list syntax case.  Call
	cp_parser_require_pragma_eol instead of cp_parser_skip_to_pragma_eol.
	(cp_parser_omp_end_declare_target): Call cp_parser_require_pragma_eol
	instead of cp_parser_skip_to_pragma_eol.
	* decl2.c (cplus_decl_attributes): Don't diagnose block scope vars inside
	declare target.
	* pt.c (tsubst_omp_clauses): If OMP_CLAUSE_LINEAR_VARIABLE_STRIDE,
	use tsubst_omp_clause_decl instead of tsubst_expr on
	OMP_CLAUSE_LINEAR_STEP.  Handle non-static data members in shared
	clauses.
	(tsubst_omp_for_iterator): Adjust omp_privatize_field caller.
	(tsubst_find_omp_teams): New function.
	(tsubst_expr): Evaluate num_teams and thread_limit expressions on
	combined target teams before the target.  Use OMP_FOR_ORIG_DECLS for
	all OpenMP/OpenACC/Cilk+ looping constructs.  Adjust finish_omp_for
	caller.
	* semantics.c (omp_privatize_field): Add SHARED argument, if true,
	always create artificial var and never put it into the hash table
	or vector.
	(handle_omp_array_sections_1): Adjust omp_privatize_field caller.
	Allow non-zero low-bound on OMP_CLAUSE_REDUCTION array sections.
	(handle_omp_array_sections): For structure element
	based array sections use GOMP_MAP_ALWAYS_POINTER instead of
	GOMP_MAP_FIRSTPRIVATE_POINTER.  Encode low-bound into the MEM_REF,
	either into the constant offset, or for variable low-bound using
	POINTER_PLUS_EXPR.
	(finish_omp_clauses): Adjust omp_privatize_field caller.  Drop
	generic_field_head, structure elements are now always mapped even
	as array section bases, diagnose same var in data sharing and
	mapping clauses.  For references map what they refer to using
	GOMP_MAP_ALWAYS_POINTER for structure elements and
	GOMP_MAP_FIRSTPRIVATE_REFERENCE otherwise.  Diagnose if linear step
	on declare simd is neither a constant nor a uniform parameter.
	Allow non-static data members on shared clauses.  Look through
	POINTER_PLUS_EXPR for array section reductions.  Diagnose nonmonotonic
	modifier on kinds other than dynamic or guided or nonmonotonic
	modifier together with ordered clause.  Diagnose the same var or
	function appearing multiple times on the same directive.  Fix up
	wording for the to clause if t is neither a FUNCTION_DECL nor a
	VAR_DECL, use special wording for OVERLOADs and TEMPLATE_ID_EXPR.
	(handle_omp_for_class_iterator): Add ORIG_DECLS argument.  Call
	c_omp_check_loop_iv_exprs on cond.
	(finish_omp_for): Add ORIG_INITS argument.  Call
	c_omp_check_loop_iv_exprs on ORIG_INITS elements.  Adjust
	handle_omp_for_class_iterator caller.  Call c_omp_check_loop_iv.
	Call add_stmt.
	(finish_omp_atomic): Adjust c_finish_omp_atomic caller.
gcc/fortran/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>

	* types.def (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR): Remove.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): New.
gcc/testsuite/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>

	* c-c++-common/gomp/clauses-2.c (foo): Adjust for diagnostics
	of variables in both data sharing and mapping clauses and for
	structure element based array sections being mapped rather than
	privatized.
	* c-c++-common/gomp/declare-target-2.c: Add various new tests.  Adjust
	expected diagnostics wording in one case.
	* c-c++-common/gomp/distribute-1.c: New test.
	* c-c++-common/gomp/element-1.c: New test.
	* c-c++-common/gomp/pr61486-2.c: Add #pragma omp declare target
	and #pragma omp end declare target pair around the function.
	Change s from a parameter to a file scope variable.
	* c-c++-common/gomp/pr67521.c: Add dg-error directives.
	* c-c++-common/gomp/reduction-1.c (foo): Don't expect diagnostics
	on non-zero low-bound in reduction array sections.  Add further
	tests.
	* c-c++-common/gomp/schedule-modifiers-1.c: New test.
	* c-c++-common/gomp/target-teams-1.c: New test.
	* gcc.dg/gomp/declare-simd-1.c: Add scan-assembler-times directives
	for expected mangling on x86_64/i?86.
	* gcc.dg/gomp/declare-simd-3.c: New test.
	* gcc.dg/gomp/declare-simd-4.c: New test.
	* gcc.dg/gomp/for-20.c: New test.
	* gcc.dg/gomp/for-21.c: New test.
	* gcc.dg/gomp/for-22.c: New test.
	* gcc.dg/gomp/for-23.c: New test.
	* gcc.dg/gomp/for-24.c: New test.
	* gcc.dg/gomp/linear-1.c: New test.
	* gcc.dg/gomp/loop-1.c: New test.
	* g++.dg/gomp/atomic-17.C: New test.
	* g++.dg/gomp/clause-1.C (T::test): Don't expect error on
	non-static data member in shared clause.  Add single construct.
	* g++.dg/gomp/declare-simd-1.C: Add dg-options.  Add
	scan-assembler-times directives for expected mangling on x86_64/i?86.
	* g++.dg/gomp/declare-simd-3.C: Likewise.
	* g++.dg/gomp/declare-simd-4.C: New test.
	* g++.dg/gomp/declare-simd-5.C: New test.
	* g++.dg/gomp/declare-target-1.C: New test.
	* g++.dg/gomp/linear-2.C: New test.
	* g++.dg/gomp/loop-1.C: New test.
	* g++.dg/gomp/loop-2.C: New test.
	* g++.dg/gomp/loop-3.C: New test.
	* g++.dg/gomp/member-2.C (B::m2, B::m4): Don't expect error on
	non-static data member in shared clause.
	* g++.dg/gomp/member-3.C: New test.
	* g++.dg/gomp/member-4.C: New test.
	* g++.dg/gomp/pr38639.C (foo): Adjust dg-error.
	(bar): Remove dg-message.
	* g++.dg/gomp/target-teams-1.C: New test.
include/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* gomp-constants.h (GOMP_MAP_FLAG_SPECIAL_2): Define.
	(GOMP_MAP_FLAG_ALWAYS): Remove.
	(enum gomp_map_kind): Use GOMP_MAP_FLAG_SPECIAL_2 instead of
	GOMP_MAP_FLAG_ALWAYS for GOMP_MAP_ALWAYS_TO, GOMP_MAP_ALWAYS_FROM,
	GOMP_MAP_ALWAYS_TOFROM, GOMP_MAP_STRUCT, GOMP_MAP_RELEASE.
	Add GOMP_MAP_ALWAYS_POINTER and GOMP_MAP_FIRSTPRIVATE_REFERENCE.
	(GOMP_MAP_ALWAYS_P): Define.
	(GOMP_TARGET_FLAG_NOWAIT): Adjust comment.
libgomp/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* libgomp_g.h (GOMP_loop_nonmonotonic_dynamic_next,
	GOMP_loop_nonmonotonic_dynamic_start,
	GOMP_loop_nonmonotonic_guided_next,
	GOMP_loop_nonmonotonic_guided_start,
	GOMP_loop_ull_nonmonotonic_dynamic_next,
	GOMP_loop_ull_nonmonotonic_dynamic_start,
	GOMP_loop_ull_nonmonotonic_guided_next,
	GOMP_loop_ull_nonmonotonic_guided_start,
	GOMP_parallel_loop_nonmonotonic_dynamic,
	GOMP_parallel_loop_nonmonotonic_guided): New prototypes.
	(GOMP_target_41): Renamed to ...
	(GOMP_target_ext): ... this.  Add num_teams and thread_limit
	arguments.
	(GOMP_target_data_41): Renamed to ...
	(GOMP_target_data_ext): ... this.
	(GOMP_target_update_41): Renamed to ...
	(GOMP_target_update_ext): ... this.
	* libgomp.map (GOMP_4.5): Export GOMP_target_ext,
	GOMP_target_data_ext and GOMP_target_update_ext instead of
	GOMP_target_41, GOMP_target_data_41 and GOMP_target_update_41.
	Export GOMP_loop_nonmonotonic_dynamic_next,
	GOMP_loop_nonmonotonic_dynamic_start,
	GOMP_loop_nonmonotonic_guided_next,
	GOMP_loop_nonmonotonic_guided_start,
	GOMP_loop_ull_nonmonotonic_dynamic_next,
	GOMP_loop_ull_nonmonotonic_dynamic_start,
	GOMP_loop_ull_nonmonotonic_guided_next,
	GOMP_loop_ull_nonmonotonic_guided_start,
	GOMP_parallel_loop_nonmonotonic_dynamic and
	GOMP_parallel_loop_nonmonotonic_guided.
	* loop.c (GOMP_parallel_loop_nonmonotonic_dynamic,
	GOMP_parallel_loop_nonmonotonic_guided,
	GOMP_loop_nonmonotonic_dynamic_start,
	GOMP_loop_nonmonotonic_guided_start,
	GOMP_loop_nonmonotonic_dynamic_next,
	GOMP_loop_nonmonotonic_guided_next): New aliases or functions.
	* loop_ull.c (GOMP_loop_ull_nonmonotonic_dynamic_start,
	GOMP_loop_ull_nonmonotonic_guided_start,
	GOMP_loop_ull_nonmonotonic_dynamic_next,
	GOMP_loop_ull_nonmonotonic_guided_next): Likewise.
	* target.c (gomp_map_0len_lookup, gomp_map_val): New inline
	functions.
	(gomp_map_vars): Handle GOMP_MAP_ALWAYS_POINTER.  For
	GOMP_MAP_ZERO_LEN_ARRAY_SECTION use gomp_map_0len_lookup.
	Use gomp_map_val function.
	(gomp_target_fallback_firstprivate): New static function.
	(GOMP_target_41): Renamed to ...
	(GOMP_target_ext): ... this.  Add num_teams and thread_limit
	arguments.  Move firstprivate fallback handling into a new
	function.
	(GOMP_target_data_41): Renamed to ...
	(GOMP_target_data_ext): ... this.
	(GOMP_target_update_41): Renamed to ...
	(GOMP_target_update_ext): ... this.
	(gomp_exit_data): For GOMP_MAP_*ZERO_LEN* use
	gomp_map_0len_lookup instead of gomp_map_lookup.
	(omp_target_is_present): Use gomp_map_0len_lookup instead of
	gomp_map_lookup.
	* testsuite/libgomp.c/target-28.c: Likewise.
	* testsuite/libgomp.c/monotonic-1.c: New test.
	* testsuite/libgomp.c/monotonic-2.c: New test.
	* testsuite/libgomp.c/nonmonotonic-1.c: New test.
	* testsuite/libgomp.c/nonmonotonic-2.c: New test.
	* testsuite/libgomp.c/pr66199-5.c: New test.
	* testsuite/libgomp.c/pr66199-6.c: New test.
	* testsuite/libgomp.c/pr66199-7.c: New test.
	* testsuite/libgomp.c/pr66199-8.c: New test.
	* testsuite/libgomp.c/pr66199-9.c: New test.
	* testsuite/libgomp.c/reduction-11.c: New test.
	* testsuite/libgomp.c/reduction-12.c: New test.
	* testsuite/libgomp.c/reduction-13.c: New test.
	* testsuite/libgomp.c/reduction-14.c: New test.
	* testsuite/libgomp.c/reduction-15.c: New test.
	* testsuite/libgomp.c/target-12.c (main): Adjust for
	omp_target_is_present change for one-past-last element.
	* testsuite/libgomp.c/target-17.c (foo): Drop tests where
	the same var is both mapped and privatized.
	* testsuite/libgomp.c/target-19.c (foo): Adjust for different
	handling of zero-length array sections.
	* testsuite/libgomp.c/target-28.c: New test.
	* testsuite/libgomp.c/target-29.c: New test.
	* testsuite/libgomp.c/target-30.c: New test.
	* testsuite/libgomp.c/target-teams-1.c: New test.
	* testsuite/libgomp.c++/member-6.C: New test.
	* testsuite/libgomp.c++/member-7.C: New test.
	* testsuite/libgomp.c++/monotonic-1.C: New test.
	* testsuite/libgomp.c++/monotonic-2.C: New test.
	* testsuite/libgomp.c++/nonmonotonic-1.C: New test.
	* testsuite/libgomp.c++/nonmonotonic-2.C: New test.
	* testsuite/libgomp.c++/pr66199-3.C: New test.
	* testsuite/libgomp.c++/pr66199-4.C: New test.
	* testsuite/libgomp.c++/pr66199-5.C: New test.
	* testsuite/libgomp.c++/pr66199-6.C: New test.
	* testsuite/libgomp.c++/pr66199-7.C: New test.
	* testsuite/libgomp.c++/pr66199-8.C: New test.
	* testsuite/libgomp.c++/pr66199-9.C: New test.
	* testsuite/libgomp.c++/reduction-11.C: New test.
	* testsuite/libgomp.c++/reduction-12.C: New test.
	* testsuite/libgomp.c++/target-13.C: New test.
	* testsuite/libgomp.c++/target-14.C: New test.
	* testsuite/libgomp.c++/target-15.C: New test.
	* testsuite/libgomp.c++/target-16.C: New test.
	* testsuite/libgomp.c++/target-17.C: New test.
	* testsuite/libgomp.c++/target-18.C: New test.
	* testsuite/libgomp.c++/target-19.C: New test.

Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com>

From-SVN: r229814
2015-11-05 16:08:08 +01:00
Nathan Sidwell ccc8282bab nvptx.c (nvptx_goacc_validate_dims): Add checking.
gcc/
	* config/nvptx/nvptx.c (nvptx_goacc_validate_dims): Add checking.

	libgomp/
	* testsuite/libgomp.oacc-fortran/reduction-1.f90: Fix dimensions
	and reduction copy.
	* 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-6.f90: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/collapse-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: New.

From-SVN: r229780
2015-11-04 20:48:05 +00:00
Nathan Sidwell 5d6823a25e loop-red-g-1.c: New.
* libgomp.oacc-c-c++-common/loop-red-g-1.c: New.
	* libgomp.oacc-c-c++-common/loop-red-gwv-1.c: New.
	* libgomp.oacc-c-c++-common/loop-red-v-1.c: New.
	* libgomp.oacc-c-c++-common/loop-red-v-2.c: New.
	* libgomp.oacc-c-c++-common/loop-red-w-1.c: New.
	* libgomp.oacc-c-c++-common/loop-red-w-2.c: New.
	* libgomp.oacc-c-c++-common/loop-red-wv-1.c: New.
	* libgomp.oacc-fortran/reduction-5.f90: Avoid reference var.

From-SVN: r229770
2015-11-04 17:01:23 +00:00
Nathan Sidwell 5c06742f6f libgomp.h (struct acc_dispatch_t): Remove args from exec_func.
* libgomp.h (struct acc_dispatch_t): Remove args from exec_func.
	* plugin/plugin-nvptx.c (nvptx_exec): Remove sizes & kinds arg.
	(GOMP_OFFLOAD_openacc_parallel): Likewise.
	* oacc-host.c (host_openacc_exec): Likewise.
	* oacc-parallel.c (GOACC_parallel_keyed): Adjust exec_func call.

From-SVN: r229721
2015-11-03 20:18:33 +00:00
Thomas Schwinge 4bf9e5a8a2 OpenACC atomic directive
gcc/c-family/
	* c-pragma.c (oacc_pragmas): Add "atomic".
	* c-pragma.h (pragma_kind): Add PRAGMA_OACC_ATOMIC.
	gcc/c/
	* c-parser.c (c_parser_omp_construct): Handle PRAGMA_OACC_ATOMIC.
	gcc/cp/
	* parser.c (cp_parser_omp_construct, cp_parser_pragma): Handle
	PRAGMA_OACC_ATOMIC.
	gcc/fortran/
	* gfortran.h (gfc_statement): Add ST_OACC_ATOMIC,
	ST_OACC_END_ATOMIC.
	(gfc_exec_op): Add EXEC_OACC_ATOMIC.
	* match.h (gfc_match_oacc_atomic): New prototype.
	* openmp.c (gfc_match_omp_atomic, gfc_match_oacc_atomic): New
	wrapper functions around...
	(gfc_match_omp_oacc_atomic): ... this new function.
	(oacc_code_to_statement, gfc_resolve_oacc_directive): Handle
	EXEC_OACC_ATOMIC.
	* parse.c (decode_oacc_directive): Handle "atomic", "end atomic".
	(case_exec_markers): Add ST_OACC_ATOMIC.
	(gfc_ascii_statement): Handle ST_OACC_ATOMIC, ST_OACC_END_ATOMIC.
	(parse_omp_atomic): Rename to...
	(parse_omp_oacc_atomic): ... this new function.  Add omp_p formal
	parameter.  Adjust all users.
	(parse_executable): Handle ST_OACC_ATOMIC.
	(is_oacc): Handle EXEC_OACC_ATOMIC.
	* resolve.c (gfc_resolve_blocks, gfc_resolve_code): Handle
	EXEC_OACC_ATOMIC.
	* st.c (gfc_free_statement): Handle EXEC_OACC_ATOMIC.
	* trans-openmp.c (gfc_trans_oacc_directive): Handle
	EXEC_OACC_ATOMIC.
	* trans.c (trans_code): Handle EXEC_OACC_ATOMIC.
	gcc/
	* builtins.def (DEF_GOMP_BUILTIN): Enable for flag_openacc.
	* omp-low.c (check_omp_nesting_restrictions): Allow
	GIMPLE_OMP_ATOMIC_LOAD, GIMPLE_OMP_ATOMIC_STORE inside OpenACC
	contexts.
	gcc/testsuite/
	* c-c++-common/goacc-gomp/nesting-fail-1.c: Move "atomic" tests
	from here to...
	* c-c++-common/goacc-gomp/nesting-1.c: ... here, and expect them
	to succeed.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/atomic_capture-1.c: New
	file.
	* testsuite/libgomp.oacc-c-c++-common/atomic_capture-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/atomic_rw-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/atomic_update-1.c: Likewise.
	* testsuite/libgomp.oacc-fortran/atomic_capture-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/atomic_rw-1.f90: New file.
	* testsuite/libgomp.oacc-fortran/atomic_update-1.f90: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: New file.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/worker-single-1a.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/worker-single-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/worker-single-6.c: Likewise.

From-SVN: r229703
2015-11-03 12:28:22 +01:00
Nathan Sidwell a0e701d8a2 openacc.h (enum acc_device_t): Reformat.
gcc/
	* openacc.h (enum acc_device_t): Reformat. Ensure layout
	compatibility.
	(enum acc_async_t): Reformat.
	(acc_on_device): Declare compatible with builtin and provide C++
	wrapper.
	* testsuite/libgomp.oacc-c-c++-common/acc-on-device.c: New.

	gcc/testsuite/
	* c-c++-common/goacc/acc_on_device-2-off.c: Delete.
	* c-c++-common/goacc/acc_on_device-2.c: Delete.

From-SVN: r229562
2015-10-30 00:13:22 +00:00
Thomas Schwinge 41e977ac90 Improve filenames for test cases of OpenACC combined directives
libgomp/
	* testsuite/libgomp.oacc-c-c++-common/combdir-1.c: Rename to...
	* testsuite/libgomp.oacc-c-c++-common/combined-directives-1.c:
	... this.  Add a description of the test at the top of the file.
	* testsuite/libgomp.oacc-fortran/combdir-1.f90: Rename file to...
	* testsuite/libgomp.oacc-fortran/combined-directives-1.f90:
	... this.  Add a description of the test at the top of the file.

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

From-SVN: r229518
2015-10-29 10:03:40 +01:00
Nathan Sidwell e309140695 loop-g-1.c: New.
* testsuite/libgomp.oacc-c-c++-common/loop-g-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/loop-g-2.c: New.
	* testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/loop-v-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: New.
	* testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c: New.

From-SVN: r229487
2015-10-28 14:27:30 +00:00
Nathan Sidwell a1c1908bbd plugin-nvptx.c (nvptx_exec): Remove check on compute dimensions.
* plugin/plugin-nvptx.c (nvptx_exec): Remove check on compute
	dimensions.

From-SVN: r229471
2015-10-28 03:00:10 +00:00
Thomas Schwinge b3962a4a87 [PR testsuite/68063] Add missing private clause in libgomp.c++/member-1.C
PR testsuite/68063
	* testsuite/libgomp.c++/member-1.C (A::m1): Add missing private clause.

From-SVN: r229411
2015-10-27 11:32:32 +01:00
Thomas Schwinge 88bae6f494 [PR c/64765, c/64880] Support OpenACC Combined Directives in C, C++
gcc/c-family/
	PR c/64765
	PR c/64880
	* c-common.h (c_oacc_split_loop_clauses): Declare function.
	* c-omp.c (c_oacc_split_loop_clauses): New function.
	gcc/c/
	PR c/64765
	PR c/64880
	* c-parser.c (c_parser_oacc_loop): Add mask, cclauses formal
	parameters, and handle these.  Adjust all users.
	(c_parser_oacc_kernels, c_parser_oacc_parallel): Merge functions
	into...
	(c_parser_oacc_kernels_parallel): ... this new function.  Adjust
	all users.
	* c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels): Don't
	declare functions.
	(c_finish_omp_construct): Declare function.
	* c-typeck.c (c_finish_oacc_parallel, c_finish_oacc_kernels):
	Merge functions into...
	(c_finish_omp_construct): ... this new function.
	gcc/cp/
	PR c/64765
	PR c/64880
	* cp-tree.h (finish_oacc_kernels, finish_oacc_parallel): Don't
	declare functions.
	(finish_omp_construct): Declare function.
	* parser.c (cp_parser_oacc_loop): Add p_name, mask, cclauses
	formal parameters, and handle these.  Adjust all users.
	(cp_parser_oacc_kernels, cp_parser_oacc_parallel): Merge functions
	into...
	(cp_parser_oacc_kernels_parallel): ... this new function.  Adjust
	all users.
	* semantics.c (finish_oacc_kernels, finish_oacc_parallel): Merge functions into...
	(finish_omp_construct): ... this new function.
	gcc/
	* tree.h (OACC_PARALLEL_BODY, OACC_PARALLEL_CLAUSES)
	(OACC_KERNELS_BODY, OACC_KERNELS_CLAUSES, OACC_KERNELS_COMBINED)
	(OACC_PARALLEL_COMBINED): Don't define macros.  Adjust all users.
	gcc/testsuite/
	PR c/64765
	PR c/64880
	* c-c++-common/goacc/loop-1.c: Don't skip for C++.  Don't prune
	sorry message.
	(PR64765): New function.
	* gfortran.dg/goacc/coarray_2.f90: XFAIL.
	* gfortran.dg/goacc/combined_loop.f90: Extend.  Don't prune
	sorry message.
	* gfortran.dg/goacc/cray.f95: Refine prune directive.
	* gfortran.dg/goacc/parameter.f95: Likewise.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/combdir-1.c: New file.
	* testsuite/libgomp.oacc-fortran/combdir-1.f90: Likewise.

From-SVN: r229404
2015-10-27 09:39:15 +01:00
Thomas Schwinge bdeb752cf8 abort might not flush all open streams before process termination
libgomp/
	* testsuite/libgomp.oacc-c-c++-common/abort-1.c: Print to stderr.
	* testsuite/libgomp.oacc-c-c++-common/abort-3.c: Likewise.

From-SVN: r229382
2015-10-26 17:25:04 +01:00
Thomas Schwinge ecd4fd4382 libgomp testsuite: Remove some explicit acc_device_nvidia usage.
libgomp/
	* testsuite/libgomp.oacc-c-c++-common/lib-1.c: Remove explicit
	acc_device_nvidia usage.
	* testsuite/libgomp.oacc-c-c++-common/lib-10.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-9.c: Likewise.

From-SVN: r229381
2015-10-26 17:24:54 +01:00
Thomas Schwinge aa8b7d3051 libgomp: Additional acc_shutdown bug fixing and testing
libgomp/
	* oacc-init.c (acc_shutdown): Call gomp_init_targets_once.
	* testsuite/libgomp.oacc-c-c++-common/lib-8.c: New file.

From-SVN: r229380
2015-10-26 17:24:44 +01:00
Thomas Schwinge 7c8f138de6 [libgomp/66518] Resolve XFAIL in libgomp.oacc-c-c++-common/lib-3.c
libgomp/
	PR libgomp/66518
	* testsuite/libgomp.oacc-c-c++-common/lib-3.c: Resolve XFAIL.

From-SVN: r229379
2015-10-26 17:24:28 +01:00
Thomas Schwinge 8baa7864a6 [PR libgomp/65437, libgomp/66518] Initialize runtime in acc_update_device, acc_update_self
libgomp/
	PR libgomp/65437
	PR libgomp/66518
	* oacc-mem.c (update_dev_host): Call goacc_lazy_initialize.
	* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Remove XFAIL.

From-SVN: r229378
2015-10-26 17:24:17 +01:00
Tom de Vries 88ebcde507 Add missing private clause in libgomp.c++/member-2.C
2015-10-23  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/68063
	* testsuite/libgomp.c++/member-2.C (A::m1): Add missing private clause.

From-SVN: r229229
2015-10-23 10:45:13 +00:00
Nathan Sidwell 9ef83c047f reduction-5.c: Set sane vector_length.
* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Set sane
	vector_length.
	* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.

From-SVN: r229100
2015-10-20 21:09:09 +00:00
Ilya Verbin 3837c6d66f target.c (gomp_map_vars): Initialize tgt->tgt_start and tgt->tgt_end to 0 when mapnum is 0.
libgomp/
	* target.c (gomp_map_vars): Initialize tgt->tgt_start and tgt->tgt_end
	to 0 when mapnum is 0.

Co-Authored-By: Aleksander Ivanushenko <aleksander.ivanushenko@intel.com>

From-SVN: r228825
2015-10-14 18:37:10 +00:00
Sebastian Huber ac8a196536 [gomp] Fix build for 32-bit targets with int != int32_t
libgomp/
2015-10-14  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* fortran.c (omp_get_place_proc_ids_, omp_get_partition_place_nums_):
	Cast to int from int32_t.

From-SVN: r228805
2015-10-14 08:30:52 +00:00
Jakub Jelinek d9a6bd32ad builtin-types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR, [...]): New.
gcc/
2015-10-13  Jakub Jelinek  <jakub@redhat.com>
	    Aldy Hernandez  <aldyh@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* builtin-types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR,
	BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR,
	BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR,
	BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR,
	BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR,
	BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL,
	BT_FN_VOID_LONG_VAR, BT_FN_VOID_ULL_VAR): New.
	(BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
	BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): Remove.
	* cgraph.h (enum cgraph_simd_clone_arg_type): Add
	SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP,
	SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP and
	SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP.
	(struct cgraph_simd_clone_arg): Adjust comment.
	* coretypes.h (struct gomp_ordered): New forward decl.
	* gimple.c (gimple_build_omp_critical): Add CLAUSES argument,
	set critical clauses to it.
	(gimple_build_omp_ordered): Return gomp_ordered * instead of
	gimple *.  Add CLAUSES argument, set ordered clauses to it.
	(gimple_copy): Unshare clauses on GIMPLE_OMP_CRITICAL and
	GIMPLE_OMP_ORDERED.
	* gimple.def (GIMPLE_OMP_ORDERED): Change from GSS_OMP to
	GSS_OMP_SINGLE_LAYOUT, move it after GIMPLE_OMP_TEAMS.
	* gimple.h (enum gf_mask): Add GF_OMP_TASK_TASKLOOP.  Add another bit
	to GF_OMP_FOR_KIND_MASK mask. Add GF_OMP_FOR_KIND_TASKLOOP, renumber
	GF_OMP_FOR_KIND_CILKFOR and GF_OMP_FOR_KIND_OACC_LOOP.  Adjust
	GF_OMP_FOR_SIMD, GF_OMP_FOR_COMBINED and GF_OMP_FOR_COMBINED_INTO.
	Add another bit to GF_OMP_TARGET_KIND_MASK mask.  Add
	GF_OMP_TARGET_KIND_ENTER_DATA and GF_OMP_TARGET_KIND_EXIT_DATA,
	renumber
	GF_OMP_TARGET_KIND_OACC_{PARALLEL,KERNELS,DATA,UPDATE,ENTER_EXIT_DATA}.
	(gomp_critical): Add clauses field.
	(gomp_ordered): New struct.
	(is_a_helper <gomp_ordered *>::test): New inline.
	(gimple_build_omp_critical): Add CLAUSES argument.
	(gimple_build_omp_ordered): Likewise.  Return gomp_ordered *
	instead of gimple *.
	(gimple_omp_critical_clauses, gimple_omp_critical_clauses_ptr,
	gimple_omp_critical_set_clauses, gimple_omp_ordered_clauses,
	gimple_omp_ordered_clauses_ptr, gimple_omp_ordered_set_clauses,
	gimple_omp_task_taskloop_p, gimple_omp_task_set_taskloop_p): New
	inline functions.
	* gimple-pretty-print.c (dump_gimple_omp_for): Handle taskloop.
	(dump_gimple_omp_target): Handle enter data and exit data.
	(dump_gimple_omp_block): Don't handle GIMPLE_OMP_ORDERED here.
	(dump_gimple_omp_critical): Print clauses.
	(dump_gimple_omp_ordered): New function.
	(dump_gimple_omp_task): Handle taskloop.
	(pp_gimple_stmt_1): Use dump_gimple_omp_ordered for
	GIMPLE_OMP_ORDERED.
	* gimple-walk.c (walk_gimple_op): Walk clauses on
	GIMPLE_OMP_CRITICAL and GIMPLE_OMP_ORDERED.
	* gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_0LEN_ARRAY.
	(enum omp_region_type): Add ORT_COMBINED_TARGET and ORT_NONE.
	(struct gimplify_omp_ctx): Add loop_iter_var,
	target_map_scalars_firstprivate, target_map_pointers_as_0len_arrays
	and target_firstprivatize_array_bases fields.
	(delete_omp_context): Release loop_iter_var.
	(gimplify_bind_expr): Handle ORT_NONE.
	(maybe_fold_stmt): Adjust check for ORT_TARGET for the addition of
	ORT_COMBINED_TARGET.
	(is_gimple_stmt): Return true for OMP_TASKLOOP, OMP_TEAMS and
	OMP_TARGET{,_DATA,_UPDATE,_ENTER_DATA,_EXIT_DATA}.
	(omp_firstprivatize_variable): Handle ORT_NONE.  Adjust check for
	ORT_TARGET for the addition of ORT_COMBINED_TARGET.  Handle
	ctx->target_map_scalars_firstprivate.
	(omp_add_variable): Handle ORT_NONE.  Allow map clause together with
	data sharing clauses.  For data sharing clause with VLA decl
	on omp target/target data don't add firstprivate for the pointer.
	Call omp_notice_variable on TYPE_SIZE_UNIT only if it is a DECL_P.
	(omp_notice_threadprivate_variable): Adjust check for ORT_TARGET for
	the addition of ORT_COMBINED_TARGET.
	(omp_notice_variable): Handle ORT_NONE.  Adjust check for ORT_TARGET
	for the addition of ORT_COMBINED_TARGET.  Handle implicit mapping of
	pointers as zero length array sections and
	ctx->target_map_scalars_firstprivate mapping of scalars as firstprivate
	data sharing.
	(omp_check_private): Handle omp_member_access_dummy_var vars.
	(find_decl_expr): New function.
	(gimplify_scan_omp_clauses): Add CODE argument.  For OMP_CLAUSE_IF
	complain if OMP_CLAUSE_IF_MODIFIER is present and does not match code.
	Handle OMP_CLAUSE_GANG separately.  Handle
	OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD,SIMDLEN}
	clauses.  Diagnose linear clause on combined
	distribute {, parallel for} simd construct, unless it is the loop
	iterator.  Handle struct element GOMP_MAP_FIRSTPRIVATE_POINTER.
	Handle map clauses with COMPONENT_REF.  Initialize
	ctx->target_map_scalars_firstprivate,
	ctx->target_firstprivatize_array_bases and
	ctx->target_map_pointers_as_0len_arrays.  Add firstprivate for
	linear clause even to target region if combined.  Remove
	map clauses with GOMP_MAP_FIRSTPRIVATE_POINTER kind from
	OMP_TARGET_{,ENTER_,EXIT_}DATA.  For GOMP_MAP_FIRSTPRIVATE_POINTER
	map kind with non-INTEGER_CST OMP_CLAUSE_SIZE firstprivatize the bias.
	Handle OMP_CLAUSE_DEPEND_{SINK,SOURCE}.  Handle
	OMP_CLAUSE_{{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}.
	For linear clause on worksharing loop combined with parallel add
	shared clause on the parallel.  Handle OMP_CLAUSE_REDUCTION
	with MEM_REF OMP_CLAUSE_DECL.  Set DECL_NAME on
	omp_member_access_dummy_var vars.  Add lastprivate clause to outer
	taskloop if needed.
	(gimplify_adjust_omp_clauses_1): Handle GOVD_MAP_0LEN_ARRAY.
	If gimplify_omp_ctxp->target_firstprivatize_array_bases, use
	GOMP_MAP_FIRSTPRIVATE_POINTER map kind instead of
	GOMP_MAP_POINTER.
	(gimplify_adjust_omp_clauses): Add CODE argument.  Handle removal
	of GOMP_MAP_FIRSTPRIVATE_POINTER struct elements for struct not seen
	in target body.  Handle removal of struct mapping if struct is not
	seen in target body.  Remove GOMP_MAP_STRUCT map clause on
	OMP_TARGET_EXIT_DATA.  Adjust check for ORT_TARGET for the
	addition of ORT_COMBINED_TARGET.  Use GOMP_MAP_FIRSTPRIVATE_POINTER
	instead of GOMP_MAP_POINTER if ctx->target_firstprivatize_array_bases
	for VLAs.  Set OMP_CLAUSE_MAP_PRIVATE if both data sharing and map
	clause appear together.  Handle
	OMP_CLAUSE_{{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}.  Don't remove map
	clause if it has map-type-modifier always.  Handle
	OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD,SIMDLEN}
	clauses.
	(gimplify_oacc_cache, gimplify_omp_parallel, gimplify_omp_task):
	Adjust gimplify_scan_omp_clauses and gimplify_adjust_omp_clauses
	callers.
	(gimplify_omp_for): Likewise.  Handle OMP_TASKLOOP.  Initialize
	loop_iter_var.  Use OMP_FOR_ORIG_DECLS.  Fix handling of lastprivate
	iterators in doacross loops.
	(gimplify_omp_workshare): Adjust gimplify_scan_omp_clauses and
	gimplify_adjust_omp_clauses callers.  Use ORT_COMBINED_TARGET
	for OMP_TARGET_COMBINED.  Adjust check for ORT_TARGET
	for the addition of ORT_COMBINED_TARGET.
	(gimplify_omp_target_update): Adjust gimplify_scan_omp_clauses and
	gimplify_adjust_omp_clauses callers.  Handle OMP_TARGET_ENTER_DATA
	and OMP_TARGET_EXIT_DATA.
	(gimplify_omp_ordered): New function.
	(gimplify_expr): Handle OMP_TASKLOOP, OMP_TARGET_ENTER_DATA and
	OMP_TARGET_EXIT_DATA.  Use gimplify_omp_ordered for OMP_ORDERED.
	Gimplify clauses on OMP_CRITICAL.
	* internal-fn.c (expand_GOMP_SIMD_ORDERED_START,
	expand_GOMP_SIMD_ORDERED_END): New functions.
	* internal-fn.def (GOMP_SIMD_ORDERED_START,
	GOMP_SIMD_ORDERED_END): New internal functions.
	* omp-builtins.def (BUILT_IN_GOMP_LOOP_DOACROSS_STATIC_START,
	BUILT_IN_GOMP_LOOP_DOACROSS_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_DOACROSS_GUIDED_START,
	BUILT_IN_GOMP_LOOP_DOACROSS_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_ULL_DOACROSS_STATIC_START,
	BUILT_IN_GOMP_LOOP_ULL_DOACROSS_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_ULL_DOACROSS_GUIDED_START,
	BUILT_IN_GOMP_LOOP_ULL_DOACROSS_RUNTIME_START,
	BUILT_IN_GOMP_DOACROSS_POST, BUILT_IN_GOMP_DOACROSS_WAIT,
	BUILT_IN_GOMP_DOACROSS_ULL_POST, BUILT_IN_GOMP_DOACROSS_ULL_WAIT,
	BUILT_IN_GOMP_TARGET_ENTER_EXIT_DATA, BUILT_IN_GOMP_TASKLOOP,
	BUILT_IN_GOMP_TASKLOOP_ULL): New built-ins.
	(BUILT_IN_GOMP_TASK): Add INT argument to the end.
	(BUILT_IN_GOMP_TARGET): Rename from GOMP_target to GOMP_target_41,
	adjust type.
	(BUILT_IN_GOMP_TARGET_DATA): Rename from GOMP_target_data to
	GOMP_target_data_41, adjust type.
	(BUILT_IN_GOMP_TARGET_UPDATE): Rename from GOMP_target_update to
	GOMP_target_update_41, adjust type.
	* omp-low.c (struct omp_region): Adjust comments, add ord_stmt
	field.
	(struct omp_for_data): Add ordered and simd_schedule fields.
	(omp_member_access_dummy_var, unshare_and_remap_1,
	unshare_and_remap, is_taskloop_ctx): New functions.
	(is_taskreg_ctx): Use is_parallel_ctx and is_task_ctx.
	(extract_omp_for_data): Handle taskloops and doacross loops
	and simd schedule modifier.
	(omp_adjust_chunk_size): New function.
	(get_ws_args_for): Use it.
	(lookup_sfield): Change first argument to splay_tree_key,
	add overload with first argument tree.
	(maybe_lookup_field): Likewise.
	(use_pointer_for_field): Handle omp_member_access_dummy_var.
	(omp_copy_decl_2): If var is TREE_ADDRESSABLE listed in
	task_shared_vars, clear TREE_ADDRESSABLE on the copy.
	(build_outer_var_ref): Add LASTPRIVATE argument, handle
	taskloops and omp_member_access_dummy_var vars.
	(build_sender_ref): Change first argument to splay_tree_key,
	add overload with first argument tree.
	(install_var_field): For mask & 8 use &DECL_UID as key instead
	of the tree itself.
	(fixup_child_record_type): Const qualify *.omp_data_i.
	(scan_sharing_clauses): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE,
	C/C++ array reductions, OMP_CLAUSE_{IS,USE}_DEVICE_PTR clauses,
	OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,SIMDLEN,THREADS,SIMD} and
	OMP_CLAUSE_{NOGROUP,DEFAULTMAP} clauses, OMP_CLAUSE__LOOPTEMP_ clause
	on taskloop, GOMP_MAP_FIRSTPRIVATE_POINTER, OMP_CLAUSE_MAP_PRIVATE.
	(create_omp_child_function): Set TREE_READONLY on .omp_data_i.
	(find_combined_for): Allow searching for different GIMPLE_OMP_FOR
	kinds.
	(add_taskreg_looptemp_clauses): New function.
	(scan_omp_parallel): Use it.
	(scan_omp_task): Likewise.
	(finish_taskreg_scan): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE.
	For taskloop, move fields for the first two _LOOPTEMP_ clauses first.
	(check_omp_nesting_restrictions): Handle GF_OMP_TARGET_KIND_ENTER_DATA
	and GF_OMP_TARGET_KIND_EXIT_DATA.  Formatting fixes.  Allow the
	sandwiched taskloop constructs.  Type check
	OMP_CLAUSE_DEPEND_{KIND,SOURCE}.  Allow ordered simd inside of simd
	region.  Diagnose depend(source) or depend(sink:...) on
	target constructs or task/taskloop.
	(handle_simd_reference): Use get_name.
	(lower_rec_input_clauses): Likewise.  Ignore all
	OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE clauses on taskloop construct.
	Allow _LOOPTEMP_ clause on GOMP_TASK.  Unshare new_var
	before passing it to omp_clause_{default,copy}_ctor.  Handle
	OMP_CLAUSE_REDUCTION with MEM_REF OMP_CLAUSE_DECL.  Set
	lastprivate_firstprivate flag for linear that needs copyin and
	copyout.  Use BUILT_IN_ALLOCA_WITH_ALIGN instead of BUILT_IN_ALLOCA.
	(lower_lastprivate_clauses): For OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE
	on taskloop lookup decl in outer context.  Pass true to
	build_outer_var_ref lastprivate argument.  Handle
	OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV lastprivate if the decl is global
	outside of outer taskloop for.
	(lower_reduction_clauses): Handle OMP_CLAUSE_REDUCTION with MEM_REF
	OMP_CLAUSE_DECL.
	(lower_send_clauses): Ignore first two _LOOPTEMP_ clauses in taskloop
	GOMP_TASK.  Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE.  Handle
	omp_member_access_dummy_var vars.  Handle OMP_CLAUSE_REDUCTION
	with MEM_REF OMP_CLAUSE_DECL.  Use new lookup_sfield overload.
	(lower_send_shared_vars): Ignore fields with NULL or FIELD_DECL
	abstract origin.  Handle omp_member_access_dummy_var vars.
	(expand_parallel_call): Use expand_omp_build_assign.
	(expand_task_call): Handle taskloop construct expansion.  Add
	REGION argument.  Use GOMP_TASK_* defines instead of hardcoded
	integers.  Add priority argument to GOMP_task* calls.  Or in
	GOMP_TASK_FLAG_PRIORITY into flags if priority is present for
	GOMP_task call.
	(expand_omp_build_assign): Add prototype.  Add AFTER
	argument, if true emit statements after *GSI_P and continue linking.
	(expand_omp_taskreg): Adjust expand_task_call caller.
	(expand_omp_for_init_counts): Rename zero_iter_bb argument to
	zero_iter1_bb and first_zero_iter to first_zero_iter1, add
	zero_iter2_bb and first_zero_iter2 arguments, handle computation
	of counts even for ordered loops.
	(expand_omp_for_init_vars): Handle GOMP_TASK inner_stmt.
	(expand_omp_ordered_source, expand_omp_ordered_sink,
	expand_omp_ordered_source_sink, expand_omp_for_ordered_loops): New
	functions.
	(expand_omp_for_generic): Use omp_adjust_chunk_size.  Handle linear
	clauses on worksharing loop.  Handle DOACROSS loop expansion.
	(expand_omp_for_static_nochunk): Handle linear clauses on
	worksharing loop.  Adjust expand_omp_for_init_counts
	callers.
	(expand_omp_for_static_chunk): Likewise.  Use omp_adjust_chunk_size.
	(expand_omp_simd): Handle addressable fd->loop.v.  Adjust
	expand_omp_for_init_counts callers.
	(expand_omp_taskloop_for_outer, expand_omp_taskloop_for_inner): New
	functions.
	(expand_omp_for): Call expand_omp_taskloop_for_* for taskloop.
	Handle doacross loops.
	(expand_omp_target): Handle GF_OMP_TARGET_KIND_ENTER_DATA and
	GF_OMP_TARGET_KIND_EXIT_DATA.  Pass flags and depend arguments to
	GOMP_target_{41,update_41,enter_exit_data} libcalls.
	(expand_omp): Don't expand ordered depend constructs here, record
	ord_stmt instead for later expand_omp_for_generic.
	(build_omp_regions_1): Handle GF_OMP_TARGET_KIND_ENTER_DATA and
	GF_OMP_TARGET_KIND_EXIT_DATA.  Treat GIMPLE_OMP_ORDERED with depend
	clause as stand-alone directive.
	(lower_omp_ordered_clauses): New function.
	(lower_omp_ordered): Handle OMP_CLAUSE_SIMD, for OMP_CLAUSE_DEPEND
	don't lower anything.
	(lower_omp_for_lastprivate): Use last _looptemp_ clause
	on taskloop for comparison.
	(lower_omp_for): Handle taskloop constructs.  Adjust OMP_CLAUSE_DECL
	and OMP_CLAUSE_LINEAR_STEP so that expand_omp_for_* can use it during
	expansion for linear adjustments.
	(create_task_copyfn): Handle OMP_CLAUSE_SHARED_FIRSTPRIVATE.
	(lower_depend_clauses): Assert not seeing sink/source depend kinds.
	Set TREE_ADDRESSABLE on array.  Change first argument from gimple *
	to tree * pointing to the stmt's clauses.
	(lower_omp_taskreg): Adjust lower_depend_clauses caller.
	(lower_omp_target): Handle GF_OMP_TARGET_KIND_ENTER_DATA
	and GF_OMP_TARGET_KIND_EXIT_DATA, depend clauses,
	GOMP_MAP_{RELEASE,ALWAYS_{TO,FROM,TOFROM},FIRSTPRIVATE_POINTER,STRUCT}
	map kinds, OMP_CLAUSE_{FIRSTPRIVATE,PRIVATE,{IS,USE}_DEVICE_PTR
	clauses.  Always use short kind and 8-bit align shift.
	(lower_omp_regimplify_p): Use IS_TYPE_OR_DECL_P macro.
	(struct lower_omp_regimplify_operands_data): New type.
	(lower_omp_regimplify_operands_p, lower_omp_regimplify_operands):
	New functions.
	(lower_omp_1): Use lower_omp_regimplify_operands instead of
	gimple_regimplify_operands.
	(make_gimple_omp_edges): Handle GF_OMP_TARGET_KIND_ENTER_DATA and
	GF_OMP_TARGET_KIND_EXIT_DATA.  Treat GIMPLE_OMP_ORDERED with depend
	clause as stand-alone directive.
	(simd_clone_clauses_extract): Honor OMP_CLAUSE_LINEAR_KIND.
	(simd_clone_mangle): Mangle the various linear kinds
	per the new ABI.
	(simd_clone_adjust_argument_types): Handle
	SIMD_CLONE_ARG_TYPE_LINEAR_*_CONSTANT_STEP.
	(simd_clone_init_simd_arrays): Don't do anything for uval.
	(simd_clone_adjust): Handle
	SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP like
	SIMD_CLONE_ARG_TYPE_LINEAR_CONSTANT_STEP.
	Handle SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP.
	* omp-low.h (omp_member_access_dummy_var): New prototype.
	* passes.def (pass_simduid_cleanup): Schedule another copy of the
	pass after all optimizations.
	* tree.c (omp_clause_code_name): Add entries for
	OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}
	and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD}.
	(omp_clause_num_ops): Likewise.  Bump number of OMP_CLAUSE_REDUCTION
	arguments to 5 and for OMP_CLAUSE_ORDERED to 1.
	(walk_tree_1): Adjust for OMP_CLAUSE_ORDERED having 1 argument and
	OMP_CLAUSE_REDUCTION 5 arguments.  Handle
	OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}
	and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD}
	clauses.
	* tree-core.h (enum omp_clause_linear_kind): New.
	(struct tree_omp_clause): Change type of map_kind
	from unsigned char to unsigned int.  Add subcode.if_modifier
	and subcode.linear_kind fields.
	(enum omp_clause_code): Add
	OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,DEFAULTMAP,HINT}
	and OMP_CLAUSE_{PRIORITY,GRAINSIZE,NUM_TASKS,NOGROUP,THREADS,SIMD}.
	(OMP_CLAUSE_REDUCTION): Document
	OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER.
	(enum omp_clause_depend_kind): Add OMP_CLAUSE_DEPEND_{SOURCE,SINK}.
	* tree.def (OMP_FOR): Add OMP_FOR_ORIG_DECLS operand.
	(OMP_CRITICAL): Move before OMP_SINGLE.  Add OMP_CRITICAL_CLAUSES
	operand.
	(OMP_ORDERED): Move before OMP_SINGLE.  Add OMP_ORDERED_CLAUSES
	operand.
	(OMP_TASKLOOP, OMP_TARGET_ENTER_DATA, OMP_TARGET_EXIT_DATA): New tree
	codes.
	* tree.h (OMP_BODY): Replace OMP_CRITICAL with OMP_TASKGROUP.
	(OMP_CLAUSE_SET_MAP_KIND): Cast to unsigned int rather than unsigned
	char.
	(OMP_CRITICAL_NAME): Adjust to be 3rd operand instead of 2nd.
	(OMP_CLAUSE_NUM_TASKS_EXPR): Formatting fix.
	(OMP_STANDALONE_CLAUSES): Adjust to cover OMP_TARGET_{ENTER,EXIT}_DATA.
	(OMP_CLAUSE_DEPEND_SINK_NEGATIVE, OMP_TARGET_COMBINED,
	OMP_CLAUSE_MAP_PRIVATE, OMP_FOR_ORIG_DECLS, OMP_CLAUSE_IF_MODIFIER,
	OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION, OMP_CRITICAL_CLAUSES,
	OMP_CLAUSE_PRIVATE_TASKLOOP_IV, OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV,
	OMP_CLAUSE_HINT_EXPR, OMP_CLAUSE_SCHEDULE_SIMD,
	OMP_CLAUSE_LINEAR_KIND, OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER,
	OMP_CLAUSE_SHARED_FIRSTPRIVATE, OMP_ORDERED_CLAUSES,
	OMP_TARGET_ENTER_DATA_CLAUSES, OMP_TARGET_EXIT_DATA_CLAUSES,
	OMP_CLAUSE_NUM_TASKS_EXPR, OMP_CLAUSE_GRAINSIZE_EXPR,
	OMP_CLAUSE_PRIORITY_EXPR, OMP_CLAUSE_ORDERED_EXPR): Define.
	* tree-inline.c (remap_gimple_stmt): Handle clauses on
	GIMPLE_OMP_ORDERED and GIMPLE_OMP_CRITICAL.  For
	IFN_GOMP_SIMD_ORDERED_{START,END} set has_simduid_loops.
	* tree-nested.c (convert_nonlocal_omp_clauses): Handle
	OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,SIMDLEN,PRIORITY,SIMD}
	and OMP_CLAUSE_{GRAINSIZE,NUM_TASKS,HINT,NOGROUP,THREADS,DEFAULTMAP}
	clauses.  Handle OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER.
	(convert_local_omp_clauses): Likewise.
	* tree-pretty-print.c (dump_omp_clause): Handle
	OMP_CLAUSE_{TO_DECLARE,LINK,{USE,IS}_DEVICE_PTR,SIMDLEN,PRIORITY,SIMD}
	and OMP_CLAUSE_{GRAINSIZE,NUM_TASKS,HINT,NOGROUP,THREADS,DEFAULTMAP}
	clauses.  Handle OMP_CLAUSE_IF_MODIFIER, OMP_CLAUSE_ORDERED_EXPR,
	OMP_CLAUSE_SCHEDULE_SIMD, OMP_CLAUSE_LINEAR_KIND,
	OMP_CLAUSE_DEPEND_{SOURCE,SINK}.  Use "delete" for
	GOMP_MAP_FORCE_DEALLOC.  Handle
	GOMP_MAP_{ALWAYS_{TO,FROM,TOFROM},RELEASE,FIRSTPRIVATE_POINTER,STRUCT}.
	(dump_generic_node): Handle OMP_TASKLOOP, OMP_TARGET_{ENTER,EXIT}_DATA
	and clauses on OMP_ORDERED and OMP_CRITICAL.
	* tree-vectorizer.c (adjust_simduid_builtins): Adjust comment.
	Remove IFN_GOMP_SIMD_ORDERED_{START,END}.
	(vectorize_loops): Adjust comments.
	(pass_simduid_cleanup::execute): Likewise.
	* tree-vect-stmts.c (vectorizable_simd_clone_call): Handle
	SIMD_CLONE_ARG_TYPE_LINEAR_{REF,VAL,UVAL}_CONSTANT_STEP.
	* wide-int.h (wi::gcd): New.
gcc/c-family/
2015-10-13  Jakub Jelinek  <jakub@redhat.com>
	    Aldy Hernandez  <aldyh@redhat.com>

	* c-common.c (enum c_builtin_type): Define DEF_FUNCTION_TYPE_9,
	DEF_FUNCTION_TYPE_10 and DEF_FUNCTION_TYPE_11.
	(c_define_builtins): Likewise.
	* c-common.h (enum c_omp_clause_split): Add
	C_OMP_CLAUSE_SPLIT_TASKLOOP.
	(c_finish_omp_critical, c_finish_omp_ordered): Add CLAUSES argument.
	(c_finish_omp_for): Add ORIG_DECLV argument.
	* c-cppbuiltin.c (c_cpp_builtins): Predefine _OPENMP as
	201511 instead of 201307.
	* c-omp.c (c_finish_omp_critical): Add CLAUSES argument, set
	OMP_CRITICAL_CLAUSES to it.
	(c_finish_omp_ordered): Add CLAUSES argument, set
	OMP_ORDERED_CLAUSES to it.
	(c_finish_omp_for): Add ORIG_DECLV argument, set OMP_FOR_ORIG_DECLS
	to it if OMP_FOR.  Clear DECL_INITIAL on the IVs.
	(c_omp_split_clauses): Handle OpenMP 4.5 combined/composite
	constructs and new OpenMP 4.5 clauses.  Clear
	OMP_CLAUSE_SCHEDULE_SIMD if not combined with OMP_SIMD.  Add
	verification code.
	* c-pragma.c (omp_pragmas_simd): Add taskloop.
	* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_TASKLOOP.
	(enum pragma_omp_clause): Add
	PRAGMA_OMP_CLAUSE_{DEFAULTMAP,GRAINSIZE,HINT,{IS,USE}_DEVICE_PTR}
	and PRAGMA_OMP_CLAUSE_{LINK,NOGROUP,NUM_TASKS,PRIORITY,SIMD,THREADS}.
gcc/c/
2015-10-13  Jakub Jelinek  <jakub@redhat.com>
	    Aldy Hernandez  <aldyh@redhat.com>

	* c-parser.c (c_parser_pragma): Handle PRAGMA_OMP_ORDERED here.
	(c_parser_omp_clause_name): Handle OpenMP 4.5 clauses.
	(c_parser_omp_variable_list): Handle structure elements for
	map, to and from clauses.  Handle array sections in reduction
	clause.  Formatting fixes.
	(c_parser_omp_clause_if): Add IS_OMP argument, handle parsing of
	if clause modifiers.
	(c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize,
	c_parser_omp_clause_priority, c_parser_omp_clause_hint,
	c_parser_omp_clause_defaultmap, c_parser_omp_clause_use_device_ptr,
	c_parser_omp_clause_is_device_ptr): New functions.
	(c_parser_omp_clause_ordered): Parse optional parameter.
	(c_parser_omp_clause_reduction): Handle array reductions.
	(c_parser_omp_clause_schedule): Parse optional simd modifier.
	(c_parser_omp_clause_nogroup, c_parser_omp_clause_orderedkind): New
	functions.
	(c_parser_omp_clause_linear): Parse linear clause modifiers.
	(c_parser_omp_clause_depend_sink): New function.
	(c_parser_omp_clause_depend): Parse source/sink depend kinds.
	(c_parser_omp_clause_map): Parse release/delete map kinds and
	optional always modifier.
	(c_parser_oacc_all_clauses): Adjust c_parser_omp_clause_if
	and c_finish_omp_clauses callers.
	(c_parser_omp_all_clauses): Likewise.  Parse OpenMP 4.5 clauses.
	Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive.
	(c_parser_oacc_cache): Adjust c_finish_omp_clauses caller.
	(OMP_CRITICAL_CLAUSE_MASK): Define.
	(c_parser_omp_critical): Parse critical clauses.
	(c_parser_omp_for_loop): Handle doacross loops, adjust
	c_finish_omp_for and c_finish_omp_clauses callers.
	(OMP_SIMD_CLAUSE_MASK): Add simdlen clause.
	(c_parser_omp_simd): Allow ordered clause if it has no parameter.
	(OMP_FOR_CLAUSE_MASK): Add linear clause.
	(c_parser_omp_for): Disallow ordered clause when combined with
	distribute.  Disallow linear clause when combined with distribute
	and not combined with simd.
	(OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define.
	(c_parser_omp_ordered): Add CONTEXT argument, remove LOC argument,
	parse clauses and if depend clause is found, don't parse a body.
	(c_parser_omp_parallel): Disallow copyin clause on target parallel.
	Allow target parallel without for after it.
	(OMP_TASK_CLAUSE_MASK): Add priority clause.
	(OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause.
	(c_parser_omp_target_data): Diagnose no map clauses or clauses with
	invalid kinds.
	(OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses.
	(OMP_TARGET_ENTER_DATA_CLAUSE_MASK,
	OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define.
	(c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): New
	functions.
	(OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate,
	defaultmap and is_device_ptr clauses.
	(c_parser_omp_target): Parse target parallel and target simd.  Set
	OMP_TARGET_COMBINED on combined constructs.  Parse target enter data
	and target exit data.  Diagnose invalid map kinds.
	(OMP_DECLARE_TARGET_CLAUSE_MASK): Define.
	(c_parser_omp_declare_target): Parse OpenMP 4.5 forms of this
	construct.
	(c_parser_omp_declare_reduction): Use STRIP_NOPS when checking for
	&omp_priv.
	(OMP_TASKLOOP_CLAUSE_MASK): Define.
	(c_parser_omp_taskloop): New function.
	(c_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here,
	handle PRAGMA_OMP_TASKLOOP.
	(c_parser_cilk_for): Adjust c_finish_omp_clauses callers.
	* c-tree.h (c_finish_omp_clauses): Add two new arguments.
	* c-typeck.c (handle_omp_array_sections_1): Fix comment typo.
	Add IS_OMP argument, handle structure element bases, diagnose
	bitfields, pass IS_OMP recursively, diagnose known zero length
	array sections in depend clauses, handle array sections in reduction
	clause, diagnose negative length even for pointers.
	(handle_omp_array_sections): Add IS_OMP argument, use auto_vec for
	types, pass IS_OMP down to handle_omp_array_sections_1, handle
	array sections in reduction clause, set
	OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero
	length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP.
	(c_finish_omp_clauses): Add IS_OMP and DECLARE_SIMD arguments.
	Handle new OpenMP 4.5 clauses and new restrictions for the old ones.
gcc/cp/
2015-10-13  Jakub Jelinek  <jakub@redhat.com>
	    Aldy Hernandez  <aldyh@redhat.com>

	* class.c (finish_struct_1): Call finish_omp_declare_simd_methods.
	* cp-gimplify.c (cp_gimplify_expr): Handle OMP_TASKLOOP.
	(cp_genericize_r): Likewise.
	(cxx_omp_finish_clause): Don't diagnose references.
	(cxx_omp_disregard_value_expr): New function.
	* cp-objcp-common.h (LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR): Redefine.
	* cp-tree.h (OMP_FOR_GIMPLIFYING_P): Document for OMP_TASKLOOP.
	(DECL_OMP_PRIVATIZED_MEMBER): Define.
	(finish_omp_declare_simd_methods, push_omp_privatization_clauses,
	pop_omp_privatization_clauses, save_omp_privatization_clauses,
	restore_omp_privatization_clauses, omp_privatize_field,
	cxx_omp_disregard_value_expr): New prototypes.
	(finish_omp_clauses): Add two new arguments.
	(finish_omp_for): Add ORIG_DECLV argument.
	* parser.c (cp_parser_lambda_body): Call
	save_omp_privatization_clauses and restore_omp_privatization_clauses.
	(cp_parser_omp_clause_name): Handle OpenMP 4.5 clauses.
	(cp_parser_omp_var_list_no_open): Handle structure elements for
	map, to and from clauses.  Handle array sections in reduction
	clause.  Parse this keyword.  Formatting fixes.
	(cp_parser_omp_clause_if): Add IS_OMP argument, handle parsing of
	if clause modifiers.
	(cp_parser_omp_clause_num_tasks, cp_parser_omp_clause_grainsize,
	cp_parser_omp_clause_priority, cp_parser_omp_clause_hint,
	cp_parser_omp_clause_defaultmap): New functions.
	(cp_parser_omp_clause_ordered): Parse optional parameter.
	(cp_parser_omp_clause_reduction): Handle array reductions.
	(cp_parser_omp_clause_schedule): Parse optional simd modifier.
	(cp_parser_omp_clause_nogroup, cp_parser_omp_clause_orderedkind):
	New functions.
	(cp_parser_omp_clause_linear): Parse linear clause modifiers.
	(cp_parser_omp_clause_depend_sink): New function.
	(cp_parser_omp_clause_depend): Parse source/sink depend kinds.
	(cp_parser_omp_clause_map): Parse release/delete map kinds and
	optional always modifier.
	(cp_parser_oacc_all_clauses): Adjust cp_parser_omp_clause_if
	and finish_omp_clauses callers.
	(cp_parser_omp_all_clauses): Likewise.  Parse OpenMP 4.5 clauses.
	Parse "to" as OMP_CLAUSE_TO_DECLARE if on declare target directive.
	(OMP_CRITICAL_CLAUSE_MASK): Define.
	(cp_parser_omp_critical): Parse critical clauses.
	(cp_parser_omp_for_incr): Use cp_tree_equal if
	processing_template_decl.
	(cp_parser_omp_for_loop_init): Return tree instead of bool.  Handle
	non-static data member iterators.
	(cp_parser_omp_for_loop): Handle doacross loops, adjust
	finish_omp_for and finish_omp_clauses callers.
	(cp_omp_split_clauses): Adjust finish_omp_clauses caller.
	(OMP_SIMD_CLAUSE_MASK): Add simdlen clause.
	(cp_parser_omp_simd): Allow ordered clause if it has no parameter.
	(OMP_FOR_CLAUSE_MASK): Add linear clause.
	(cp_parser_omp_for): Disallow ordered clause when combined with
	distribute.  Disallow linear clause when combined with distribute
	and not combined with simd.
	(OMP_ORDERED_CLAUSE_MASK, OMP_ORDERED_DEPEND_CLAUSE_MASK): Define.
	(cp_parser_omp_ordered): Add CONTEXT argument, return bool instead
	of tree, parse clauses and if depend clause is found, don't parse
	a body.
	(cp_parser_omp_parallel): Disallow copyin clause on target parallel.
	Allow target parallel without for after it.
	(OMP_TASK_CLAUSE_MASK): Add priority clause.
	(OMP_TARGET_DATA_CLAUSE_MASK): Add use_device_ptr clause.
	(cp_parser_omp_target_data): Diagnose no map clauses or clauses with
	invalid kinds.
	(OMP_TARGET_UPDATE_CLAUSE_MASK): Add depend and nowait clauses.
	(OMP_TARGET_ENTER_DATA_CLAUSE_MASK,
	OMP_TARGET_EXIT_DATA_CLAUSE_MASK): Define.
	(cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data): New
	functions.
	(OMP_TARGET_CLAUSE_MASK): Add depend, nowait, private, firstprivate,
	defaultmap and is_device_ptr clauses.
	(cp_parser_omp_target): Parse target parallel and target simd.  Set
	OMP_TARGET_COMBINED on combined constructs.  Parse target enter data
	and target exit data.  Diagnose invalid map kinds.
	(cp_parser_oacc_cache): Adjust finish_omp_clauses caller.
	(OMP_DECLARE_TARGET_CLAUSE_MASK): Define.
	(cp_parser_omp_declare_target): Parse OpenMP 4.5 forms of this
	construct.
	(OMP_TASKLOOP_CLAUSE_MASK): Define.
	(cp_parser_omp_taskloop): New function.
	(cp_parser_omp_construct): Don't handle PRAGMA_OMP_ORDERED here,
	handle PRAGMA_OMP_TASKLOOP.
	(cp_parser_pragma): Handle PRAGMA_OMP_ORDERED here directly,
	handle PRAGMA_OMP_TASKLOOP, call push_omp_privatization_clauses
	and pop_omp_privatization_clauses around parsing calls.
	(cp_parser_cilk_for): Adjust finish_omp_clauses caller.
	* pt.c (apply_late_template_attributes): Adjust tsubst_omp_clauses
	and finish_omp_clauses callers.
	(tsubst_omp_clause_decl): Return NULL if decl is NULL.
	For TREE_LIST, copy over OMP_CLAUSE_DEPEND_SINK_NEGATIVE bit.
	Use tsubst_expr instead of tsubst_copy, undo convert_from_reference
	effects.
	(tsubst_omp_clauses): Add ALLOW_FIELDS argument.  Handle new
	OpenMP 4.5 clauses.  Use tsubst_omp_clause_decl for more clauses.
	If ALLOW_FIELDS, handle non-static data members in the clauses.
	Clear OMP_CLAUSE_LINEAR_STEP if it has been cleared before.
	(omp_parallel_combined_clauses): New variable.
	(tsubst_omp_for_iterator): Add ORIG_DECLV argument, recur on
	OMP_FOR_ORIG_DECLS, handle non-static data member iterators.
	Improve handling of clauses on combined constructs.
	(tsubst_expr): Call push_omp_privatization_clauses and
	pop_omp_privatization_clauses around instantiation of certain
	OpenMP constructs, improve handling of clauses on combined
	constructs, handle OMP_TASKLOOP, adjust tsubst_omp_for_iterator,
	tsubst_omp_clauses and finish_omp_for callers, handle clauses on
	critical and ordered, handle OMP_TARGET_{ENTER,EXIT}_DATA.
	(instantiate_decl): Call save_omp_privatization_clauses and
	restore_omp_privatization_clauses around instantiation.
	(dependent_omp_for_p): Fix up comment typo.  Handle SCOPE_REF.
	* semantics.c (omp_private_member_map, omp_private_member_vec,
	omp_private_member_ignore_next): New variables.
	(finish_non_static_data_member): Return dummy decl for privatized
	non-static data members.
	(omp_clause_decl_field, omp_clause_printable_decl,
	omp_note_field_privatization, omp_privatize_field): New functions.
	(handle_omp_array_sections_1): Fix comment typo.
	Add IS_OMP argument, handle structure element bases, diagnose
	bitfields, pass IS_OMP recursively, diagnose known zero length
	array sections in depend clauses, handle array sections in reduction
	clause, diagnose negative length even for pointers.
	(handle_omp_array_sections): Add IS_OMP argument, use auto_vec for
	types, pass IS_OMP down to handle_omp_array_sections_1, handle
	array sections in reduction clause, set
	OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION if map could be zero
	length array section, use GOMP_MAP_FIRSTPRIVATE_POINTER for IS_OMP.
	(finish_omp_reduction_clause): Handle array sections and arrays.
	Use omp_clause_printable_decl.
	(finish_omp_declare_simd_methods, cp_finish_omp_clause_depend_sink):
	New functions.
	(finish_omp_clauses): Add ALLOW_FIELDS and DECLARE_SIMD arguments.
	Handle new OpenMP 4.5 clauses and new restrictions for the old
	ones, handle non-static data members, reject this keyword when not
	allowed.
	(push_omp_privatization_clauses, pop_omp_privatization_clauses,
	save_omp_privatization_clauses, restore_omp_privatization_clauses):
	New functions.
	(handle_omp_for_class_iterator): Handle OMP_TASKLOOP class iterators.
	Add collapse and ordered arguments.  Fix handling of lastprivate
	iterators in doacross loops.
	(finish_omp_for): Add ORIG_DECLV argument, handle doacross loops,
	adjust c_finish_omp_for, handle_omp_for_class_iterator and
	finish_omp_clauses callers.  Fill in OMP_CLAUSE_LINEAR_STEP on simd
	loops with non-static data member iterators.
gcc/fortran/
2015-10-13  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* f95-lang.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
	DEF_FUNCTION_TYPE_11, DEF_FUNCTION_TYPE_VAR_1): Define.
	* trans-openmp.c (gfc_trans_omp_clauses): Set
	OMP_CLAUSE_IF_MODIFIER to ERROR_MARK, OMP_CLAUSE_ORDERED_EXPR
	to NULL.
	(gfc_trans_omp_critical): Adjust for addition of clauses.
	(gfc_trans_omp_ordered): Likewise.
	* types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR,
	BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR,
	BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR,
	BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR,
	BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR,
	BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL,
	BT_FN_VOID_LONG_VAR, BT_FN_VOID_ULL_VAR): New.
	(BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
	BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): Remove.
gcc/lto/
2015-10-13  Jakub Jelinek  <jakub@redhat.com>

	* lto-lang.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
	DEF_FUNCTION_TYPE_11): Define.
gcc/jit/
2015-10-13  Jakub Jelinek  <jakub@redhat.com>

	* jit-builtins.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
	DEF_FUNCTION_TYPE_11): Define.
	* jit-builtins.h (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
	DEF_FUNCTION_TYPE_11): Define.
gcc/ada/
2015-10-13  Jakub Jelinek  <jakub@redhat.com>

	* gcc-interface/utils.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
	DEF_FUNCTION_TYPE_11): Define.
gcc/testsuite/
2015-10-13  Jakub Jelinek  <jakub@redhat.com>
	    Aldy Hernandez  <aldyh@redhat.com>

	* c-c++-common/gomp/cancel-1.c (f2): Add map clause to target data.
	* c-c++-common/gomp/clauses-1.c: New test.
	* c-c++-common/gomp/clauses-2.c: New test.
	* c-c++-common/gomp/clauses-3.c: New test.
	* c-c++-common/gomp/clauses-4.c: New test.
	* c-c++-common/gomp/declare-target-1.c: New test.
	* c-c++-common/gomp/declare-target-2.c: New test.
	* c-c++-common/gomp/depend-3.c: New test.
	* c-c++-common/gomp/depend-4.c: New test.
	* c-c++-common/gomp/doacross-1.c: New test.
	* c-c++-common/gomp/if-1.c: New test.
	* c-c++-common/gomp/if-2.c: New test.
	* c-c++-common/gomp/linear-1.c: New test.
	* c-c++-common/gomp/map-2.c: New test.
	* c-c++-common/gomp/map-3.c: New test.
	* c-c++-common/gomp/nesting-1.c (f_omp_parallel,
	f_omp_target_data): Add map clause to target data.
	* c-c++-common/gomp/nesting-warn-1.c (f_omp_target): Likewise.
	* c-c++-common/gomp/ordered-1.c: New test.
	* c-c++-common/gomp/ordered-2.c: New test.
	* c-c++-common/gomp/ordered-3.c: New test.
	* c-c++-common/gomp/pr61486-1.c (foo): Remove linear clause
	on non-iterator.
	* c-c++-common/gomp/pr61486-2.c (test, test2): Remove ordered
	clause and ordered construct where no longer allowed.
	* c-c++-common/gomp/priority-1.c: New test.
	* c-c++-common/gomp/reduction-1.c: New test.
	* c-c++-common/gomp/schedule-simd-1.c: New test.
	* c-c++-common/gomp/sink-1.c: New test.
	* c-c++-common/gomp/sink-2.c: New test.
	* c-c++-common/gomp/sink-3.c: New test.
	* c-c++-common/gomp/sink-4.c: New test.
	* c-c++-common/gomp/udr-1.c: New test.
	* c-c++-common/taskloop-1.c: New test.
	* c-c++-common/cpp/openmp-define-3.c: Adjust for the new
	value of _OPENMP macro.
	* c-c++-common/cilk-plus/PS/body.c (foo): Adjust expected diagnostics.
	* c-c++-common/goacc-gomp/nesting-fail-1.c (f_acc_parallel,
	f_acc_kernels, f_acc_data, f_acc_loop): Add map clause to target data.
	* gcc.dg/gomp/clause-1.c:
	* gcc.dg/gomp/reduction-1.c: New test.
	* gcc.dg/gomp/sink-fold-1.c: New test.
	* gcc.dg/gomp/sink-fold-2.c: New test.
	* gcc.dg/gomp/sink-fold-3.c: New test.
	* gcc.dg/vect/vect-simd-clone-15.c: New test.
	* g++.dg/gomp/clause-1.C (T::test): Remove dg-error on privatization
	of non-static data members.
	* g++.dg/gomp/clause-3.C (foo): Remove one dg-error directive.
	Add some linear clause tests.
	* g++.dg/gomp/declare-simd-3.C: New test.
	* g++.dg/gomp/linear-1.C: New test.
	* g++.dg/gomp/member-1.C: New test.
	* g++.dg/gomp/member-2.C: New test.
	* g++.dg/gomp/pr66571-2.C: New test.
	* g++.dg/gomp/pr67504.C (foo): Add test for ordered clause with
	dependent argument.
	* g++.dg/gomp/pr67522.C (foo): Add test for invalid array section
	in reduction clause.
	* g++.dg/gomp/reference-1.C: New test.
	* g++.dg/gomp/sink-1.C: New test.
	* g++.dg/gomp/sink-2.C: New test.
	* g++.dg/gomp/sink-3.C: New test.
	* g++.dg/gomp/task-1.C: Remove both dg-error directives.
	* g++.dg/gomp/this-1.C: New test.
	* g++.dg/gomp/this-2.C: New test.
	* g++.dg/vect/simd-clone-2.cc: New test.
	* g++.dg/vect/simd-clone-2.h: New test.
	* g++.dg/vect/simd-clone-3.cc: New test.
	* g++.dg/vect/simd-clone-4.cc: New test.
	* g++.dg/vect/simd-clone-4.h: New test.
	* g++.dg/vect/simd-clone-5.cc: New test.
include/
2015-10-13  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* gomp-constants.h (GOMP_MAP_FLAG_ALWAYS): Define.
	(enum gomp_map_kind): Add GOMP_MAP_FIRSTPRIVATE,
	GOMP_MAP_FIRSTPRIVATE_INT, GOMP_MAP_USE_DEVICE_PTR,
	GOMP_MAP_ZERO_LEN_ARRAY_SECTION, GOMP_MAP_ALWAYS_TO,
	GOMP_MAP_ALWAYS_FROM, GOMP_MAP_ALWAYS_TOFROM, GOMP_MAP_STRUCT,
	GOMP_MAP_DELETE_ZERO_LEN_ARRAY_SECTION, GOMP_MAP_DELETE,
	GOMP_MAP_RELEASE, GOMP_MAP_FIRSTPRIVATE_POINTER.
	(GOMP_MAP_ALWAYS_TO_P, GOMP_MAP_ALWAYS_FROM_P): Define.
	(GOMP_TASK_FLAG_UNTIED, GOMP_TASK_FLAG_FINAL, GOMP_TASK_FLAG_MERGEABLE,
	GOMP_TASK_FLAG_DEPEND, GOMP_TASK_FLAG_PRIORITY, GOMP_TASK_FLAG_UP,
	GOMP_TASK_FLAG_GRAINSIZE, GOMP_TASK_FLAG_IF, GOMP_TASK_FLAG_NOGROUP,
	GOMP_TARGET_FLAG_NOWAIT, GOMP_TARGET_FLAG_EXIT_DATA,
	GOMP_TARGET_FLAG_UPDATE): Define.
libgomp/
2015-10-13  Jakub Jelinek  <jakub@redhat.com>
	    Aldy Hernandez  <aldyh@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* config/linux/affinity.c (omp_get_place_num_procs,
	omp_get_place_proc_ids, gomp_get_place_proc_ids_8): New functions.
	* config/linux/doacross.h: New file.
	* config/posix/affinity.c (omp_get_place_num_procs,
	omp_get_place_proc_ids, gomp_get_place_proc_ids_8): New functions.
	* config/posix/doacross.h: New file.
	* env.c: Include gomp-constants.h.
	(struct gomp_task_icv): Rename run_sched_modifier to
	run_sched_chunk_size.
	(gomp_max_task_priority_var): New variable.
	(parse_schedule): Rename run_sched_modifier to run_sched_chunk_size.
	(handle_omp_display_env): Change _OPENMP value from 201307 to
	201511.  Print OMP_MAX_TASK_PRIORITY.
	(initialize_env): Parse OMP_MAX_TASK_PRIORITY.
	(omp_set_schedule, omp_get_schedule): Rename modifier argument to
	chunk_size and run_sched_modifier to run_sched_chunk_size.
	(omp_get_max_task_priority, omp_get_initial_device,
	omp_get_num_places, omp_get_place_num, omp_get_partition_num_places,
	omp_get_partition_place_nums): New functions.
	* fortran.c (omp_set_schedule_, omp_set_schedule_8_,
	omp_get_schedule_, omp_get_schedule_8_): Rename modifier argument
	to chunk_size.
	(omp_get_num_places_, omp_get_place_num_procs_,
	omp_get_place_num_procs_8_, omp_get_place_proc_ids_,
	omp_get_place_proc_ids_8_, omp_get_place_num_,
	omp_get_partition_num_places_, omp_get_partition_place_nums_,
	omp_get_partition_place_nums_8_, omp_get_initial_device_,
	omp_get_max_task_priority_): New functions.
	* libgomp_g.h (GOMP_loop_doacross_static_start,
	GOMP_loop_doacross_dynamic_start, GOMP_loop_doacross_guided_start,
	GOMP_loop_doacross_runtime_start, GOMP_loop_ull_doacross_static_start,
	GOMP_loop_ull_doacross_dynamic_start,
	GOMP_loop_ull_doacross_guided_start,
	GOMP_loop_ull_doacross_runtime_start, GOMP_doacross_post,
	GOMP_doacross_wait, GOMP_doacross_ull_post, GOMP_doacross_wait,
	GOMP_taskloop, GOMP_taskloop_ull, GOMP_target_41,
	GOMP_target_data_41, GOMP_target_update_41,
	GOMP_target_enter_exit_data): New prototypes.
	(GOMP_task): Add prototype argument.
	* libgomp.h (_LIBGOMP_CHECKING_): Define to 0 if not yet defined.
	(struct gomp_doacross_work_share): New type.
	(struct gomp_work_share): Add doacross field.
	(struct gomp_task_icv): Rename run_sched_modifier to
	run_sched_chunk_size.
	(enum gomp_task_kind): Rename GOMP_TASK_IFFALSE to
	GOMP_TASK_UNDEFERRED.  Add comments.
	(struct gomp_task_depend_entry): Add comments.
	(struct gomp_task): Likewise.
	(struct gomp_taskgroup): Likewise.
	(struct gomp_target_task): New type.
	(struct gomp_team): Add comment.
	(gomp_get_place_proc_ids_8, gomp_doacross_init,
	gomp_doacross_ull_init, gomp_task_maybe_wait_for_dependencies,
	gomp_create_target_task, gomp_target_task_fn): New prototypes.
	(struct target_var_desc): New type.
	(struct target_mem_desc): Adjust comment.  Use struct
	target_var_desc instead of splay_tree_key for list.
	(REFCOUNT_INFINITY): Define.
	(struct splay_tree_key_s): Remove copy_from field.
	(struct gomp_device_descr): Add dev2dev_func field.
	(enum gomp_map_vars_kind): New enum.
	(gomp_map_vars): Add one argument.
	* libgomp.map (OMP_4.5): Export omp_get_max_task_priority,
	omp_get_max_task_priority_, omp_get_num_places, omp_get_num_places_,
	omp_get_place_num_procs, omp_get_place_num_procs_,
	omp_get_place_num_procs_8_, omp_get_place_proc_ids,
	omp_get_place_proc_ids_, omp_get_place_proc_ids_8_, omp_get_place_num,
	omp_get_place_num_, omp_get_partition_num_places,
	omp_get_partition_num_places_, omp_get_partition_place_nums,
	omp_get_partition_place_nums_, omp_get_partition_place_nums_8_,
	omp_get_initial_device, omp_get_initial_device_, omp_target_alloc,
	omp_target_free, omp_target_is_present, omp_target_memcpy,
	omp_target_memcpy_rect, omp_target_associate_ptr and
	omp_target_disassociate_ptr.
	(GOMP_4.0.2): Renamed to ...
	(GOMP_4.5): ... this.  Export GOMP_target_41, GOMP_target_data_41,
	GOMP_target_update_41, GOMP_target_enter_exit_data, GOMP_taskloop,
	GOMP_taskloop_ull, GOMP_loop_doacross_dynamic_start,
	GOMP_loop_doacross_guided_start, GOMP_loop_doacross_runtime_start,
	GOMP_loop_doacross_static_start, GOMP_doacross_post,
	GOMP_doacross_wait, GOMP_loop_ull_doacross_dynamic_start,
	GOMP_loop_ull_doacross_guided_start,
	GOMP_loop_ull_doacross_runtime_start,
	GOMP_loop_ull_doacross_static_start, GOMP_doacross_ull_post and
	GOMP_doacross_ull_wait.
	* libgomp.texi: Document omp_get_max_task_priority.
	Rename modifier argument to chunk_size for omp_set_schedule and
	omp_get_schedule.  Document OMP_MAX_TASK_PRIORITY env var.
	* loop.c (GOMP_loop_runtime_start): Adjust for run_sched_modifier
	to run_sched_chunk_size renaming.
	(GOMP_loop_ordered_runtime_start): Likewise.
	(gomp_loop_doacross_static_start, gomp_loop_doacross_dynamic_start,
	gomp_loop_doacross_guided_start, GOMP_loop_doacross_runtime_start,
	GOMP_parallel_loop_runtime_start): New functions.
	(GOMP_parallel_loop_runtime): Adjust for run_sched_modifier
	to run_sched_chunk_size renaming.
	(GOMP_loop_doacross_static_start, GOMP_loop_doacross_dynamic_start,
	GOMP_loop_doacross_guided_start): New functions or aliases.
	* loop_ull.c (GOMP_loop_ull_runtime_start): Adjust for
	run_sched_modifier to run_sched_chunk_size renaming.
	(GOMP_loop_ull_ordered_runtime_start): Likewise.
	(gomp_loop_ull_doacross_static_start,
	gomp_loop_ull_doacross_dynamic_start,
	gomp_loop_ull_doacross_guided_start,
	GOMP_loop_ull_doacross_runtime_start): New functions.
	(GOMP_loop_ull_doacross_static_start,
	GOMP_loop_ull_doacross_dynamic_start,
	GOMP_loop_ull_doacross_guided_start): New functions or aliases.
	* oacc-mem.c (acc_map_data, present_create_copy,
	gomp_acc_insert_pointer): Pass GOMP_MAP_VARS_OPENACC instead of false
	to gomp_map_vars.
	(gomp_acc_remove_pointer): Use copy_from from target_var_desc.
	* oacc-parallel.c (GOACC_data_start): Pass GOMP_MAP_VARS_OPENACC
	instead of false to gomp_map_vars.
	(GOACC_parallel_keyed): Likewise.  Use copy_from from target_var_desc.
	* omp.h.in (omp_lock_hint_t): New type.
	(omp_init_lock_with_hint, omp_init_nest_lock_with_hint,
	omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids,
	omp_get_place_num, omp_get_partition_num_places,
	omp_get_partition_place_nums, omp_get_initial_device,
	omp_get_max_task_priority, omp_target_alloc, omp_target_free,
	omp_target_is_present, omp_target_memcpy, omp_target_memcpy_rect,
	omp_target_associate_ptr, omp_target_disassociate_ptr): New
	prototypes.
	* omp_lib.f90.in (omp_lock_hint_kind): New parameter.
	(omp_lock_hint_none, omp_lock_hint_uncontended,
	omp_lock_hint_contended, omp_lock_hint_nonspeculative,
	omp_lock_hint_speculative): New parameters.
	(omp_init_lock_with_hint, omp_init_nest_lock_with_hint,
	omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids,
	omp_get_place_num, omp_get_partition_num_places,
	omp_get_partition_place_nums, omp_get_initial_device,
	omp_get_max_task_priority): New interfaces.
	(omp_set_schedule, omp_get_schedule): Rename modifier argument
	to chunk_size.
	* omp_lib.h.in (omp_lock_hint_kind): New parameter.
	(omp_lock_hint_none, omp_lock_hint_uncontended,
	omp_lock_hint_contended, omp_lock_hint_nonspeculative,
	omp_lock_hint_speculative): New parameters.
	(omp_init_lock_with_hint, omp_init_nest_lock_with_hint,
	omp_get_num_places, omp_get_place_num_procs, omp_get_place_proc_ids,
	omp_get_place_num, omp_get_partition_num_places,
	omp_get_partition_place_nums, omp_get_initial_device,
	omp_get_max_task_priority): New functions and subroutines.
	* ordered.c: Include stdarg.h and string.h.
	(MAX_COLLAPSED_BITS): Define.
	(gomp_doacross_init, GOMP_doacross_post, GOMP_doacross_wait,
	gomp_doacross_ull_init, GOMP_doacross_ull_post,
	GOMP_doacross_ull_wait): New functions.
	* target.c: Include errno.h.
	(resolve_device): If device is not initialized, call
	gomp_init_device on it.
	(gomp_map_lookup): New function.
	(gomp_map_vars_existing): Add tgt_var argument, fill it in.
	Don't bump refcount if REFCOUNT_INFINITY.  Handle
	GOMP_MAP_ALWAYS_TO_P.
	(get_kind): Rename is_openacc argument to short_mapkind.
	(gomp_map_pointer): Use gomp_map_lookup.
	(gomp_map_fields_existing): New function.
	(gomp_map_vars): Rename is_openacc argument to short_mapkind
	and is_target to pragma_kind.  Handle GOMP_MAP_VARS_ENTER_DATA,
	handle GOMP_MAP_FIRSTPRIVATE_INT, GOMP_MAP_STRUCT,
	GOMP_MAP_USE_DEVICE_PTR, GOMP_MAP_ZERO_LEN_ARRAY_SECTION.
	Adjust for tgt->list changed type and copy_from living in there.
	(gomp_copy_from_async): Adjust for tgt->list changed type and
	copy_from living in there.
	(gomp_unmap_vars): Likewise.
	(gomp_update): Likewise.  Rename is_openacc argument to
	short_mapkind.  Don't fail if object is not mapped.
	(gomp_load_image_to_device): Initialize refcount to
	REFCOUNT_INFINITY.
	(gomp_target_fallback): New function.
	(gomp_get_target_fn_addr): Likewise.
	(GOMP_target): Adjust gomp_map_vars caller, use
	gomp_get_target_fn_addr and gomp_target_fallback.
	(GOMP_target_41): New function.
	(gomp_target_data_fallback): New function.
	(GOMP_target_data): Use it, adjust gomp_map_vars caller.
	(GOMP_target_data_41): New function.
	(GOMP_target_update): Adjust gomp_update caller.
	(GOMP_target_update_41): New function.
	(gomp_exit_data, GOMP_target_enter_exit_data,
	gomp_target_task_fn, omp_target_alloc, omp_target_free,
	omp_target_is_present, omp_target_memcpy,
	omp_target_memcpy_rect_worker, omp_target_memcpy_rect,
	omp_target_associate_ptr, omp_target_disassociate_ptr,
	gomp_load_plugin_for_device): New functions.
	* task.c: Include gomp-constants.h.  Include taskloop.c
	twice to get GOMP_taskloop and GOMP_taskloop_ull definitions.
	(gomp_task_handle_depend): New function.
	(GOMP_task): Use it.  Add priority argument.  Use
	gomp-constant.h constants instead of hardcoded numbers.
	Rename GOMP_TASK_IFFALSE to GOMP_TASK_UNDEFERRED.
	(gomp_create_target_task): New function.
	(verify_children_queue, verify_taskgroup_queue,
	verify_task_queue): New functions.
	(gomp_task_run_pre): Call verify_*_queue functions.
	If an upcoming tied task is about to leave the sibling or
	taskgroup queues in an invalid state, adjust appropriately.
	Remove taskgroup argument.  Add comments.
	(gomp_task_run_post_handle_dependers): Add comments.
	(gomp_task_run_post_remove_parent): Likewise.
	(gomp_barrier_handle_tasks): Adjust gomp_task_run_pre caller.
	(GOMP_taskwait): Likewise.  Add comments.
	(gomp_task_maybe_wait_for_dependencies): Fix scheduling
	problem such that the first non parent_depends_on task does not
	end up at the end of the children queue.
	(GOMP_taskgroup_start): Rename GOMP_TASK_IFFALSE to
	GOMP_TASK_UNDEFERRED.
	(GOMP_taskgroup_end): Adjust gomp_task_run_pre caller.
	* taskloop.c: New file.
	* testsuite/lib/libgomp.exp
	(check_effective_target_offload_device_nonshared_as): New proc.
	* testsuite/libgomp.c/affinity-2.c: New test.
	* testsuite/libgomp.c/doacross-1.c: New test.
	* testsuite/libgomp.c/doacross-2.c: New test.
	* testsuite/libgomp.c/examples-4/declare_target-1.c (fib_wrapper):
	Add map clause to target.
	* testsuite/libgomp.c/examples-4/declare_target-4.c (accum): Likewise.
	* testsuite/libgomp.c/examples-4/declare_target-5.c (accum): Likewise.
	* testsuite/libgomp.c/examples-4/device-1.c (main): Likewise.
	* testsuite/libgomp.c/examples-4/device-3.c (main): Likewise.
	* testsuite/libgomp.c/examples-4/target_data-3.c (gramSchmidt):
	Likewise.
	* testsuite/libgomp.c/examples-4/teams-2.c (dotprod): Likewise.
	* testsuite/libgomp.c/examples-4/teams-3.c (dotprod): Likewise.
	* testsuite/libgomp.c/examples-4/teams-4.c (dotprod): Likewise.
	* testsuite/libgomp.c/for-2.h (OMPTGT, OMPTO, OMPFROM): Define if
	not defined.  Use those where needed.
	* testsuite/libgomp.c/for-4.c: New test.
	* testsuite/libgomp.c/for-5.c: New test.
	* testsuite/libgomp.c/for-6.c: New test.
	* testsuite/libgomp.c/linear-1.c: New test.
	* testsuite/libgomp.c/ordered-4.c: New test.
	* testsuite/libgomp.c/pr66199-2.c (f2): Adjust for linear clause
	only allowed on the loop iterator.
	* testsuite/libgomp.c/pr66199-3.c: New test.
	* testsuite/libgomp.c/pr66199-4.c: New test.
	* testsuite/libgomp.c/reduction-7.c: New test.
	* testsuite/libgomp.c/reduction-8.c: New test.
	* testsuite/libgomp.c/reduction-9.c: New test.
	* testsuite/libgomp.c/reduction-10.c: New test.
	* testsuite/libgomp.c/target-1.c (fn2, fn3, fn4): Add
	map(tofrom:s).
	* testsuite/libgomp.c/target-2.c (fn2, fn3, fn4): Likewise.
	* testsuite/libgomp.c/target-7.c (foo): Add map(h) where needed.
	* testsuite/libgomp.c/target-11.c: New test.
	* testsuite/libgomp.c/target-12.c: New test.
	* testsuite/libgomp.c/target-13.c: New test.
	* testsuite/libgomp.c/target-14.c: New test.
	* testsuite/libgomp.c/target-15.c: New test.
	* testsuite/libgomp.c/target-16.c: New test.
	* testsuite/libgomp.c/target-17.c: New test.
	* testsuite/libgomp.c/target-18.c: New test.
	* testsuite/libgomp.c/target-19.c: New test.
	* testsuite/libgomp.c/target-20.c: New test.
	* testsuite/libgomp.c/target-21.c: New test.
	* testsuite/libgomp.c/target-22.c: New test.
	* testsuite/libgomp.c/target-23.c: New test.
	* testsuite/libgomp.c/target-24.c: New test.
	* testsuite/libgomp.c/target-25.c: New test.
	* testsuite/libgomp.c/target-26.c: New test.
	* testsuite/libgomp.c/target-27.c: New test.
	* testsuite/libgomp.c/taskloop-1.c: New test.
	* testsuite/libgomp.c/taskloop-2.c: New test.
	* testsuite/libgomp.c/taskloop-3.c: New test.
	* testsuite/libgomp.c/taskloop-4.c: New test.
	* testsuite/libgomp.c++/ctor-13.C: New test.
	* testsuite/libgomp.c++/doacross-1.C: New test.
	* testsuite/libgomp.c++/examples-4/declare_target-2.C:
	Replace offload_device with offload_device_nonshared_as.
	* testsuite/libgomp.c++/for-12.C: New test.
	* testsuite/libgomp.c++/for-13.C: New test.
	* testsuite/libgomp.c++/for-14.C: New test.
	* testsuite/libgomp.c++/linear-1.C: New test.
	* testsuite/libgomp.c++/member-1.C: New test.
	* testsuite/libgomp.c++/member-2.C: New test.
	* testsuite/libgomp.c++/member-3.C: New test.
	* testsuite/libgomp.c++/member-4.C: New test.
	* testsuite/libgomp.c++/member-5.C: New test.
	* testsuite/libgomp.c++/ordered-1.C: New test.
	* testsuite/libgomp.c++/reduction-5.C: New test.
	* testsuite/libgomp.c++/reduction-6.C: New test.
	* testsuite/libgomp.c++/reduction-7.C: New test.
	* testsuite/libgomp.c++/reduction-8.C: New test.
	* testsuite/libgomp.c++/reduction-9.C: New test.
	* testsuite/libgomp.c++/reduction-10.C: New test.
	* testsuite/libgomp.c++/reference-1.C: New test.
	* testsuite/libgomp.c++/simd14.C: New test.
	* testsuite/libgomp.c++/target-2.C (fn2): Add map(tofrom: s) clause.
	* testsuite/libgomp.c++/target-5.C: New test.
	* testsuite/libgomp.c++/target-6.C: New test.
	* testsuite/libgomp.c++/target-7.C: New test.
	* testsuite/libgomp.c++/target-8.C: New test.
	* testsuite/libgomp.c++/target-9.C: New test.
	* testsuite/libgomp.c++/target-10.C: New test.
	* testsuite/libgomp.c++/target-11.C: New test.
	* testsuite/libgomp.c++/target-12.C: New test.
	* testsuite/libgomp.c++/taskloop-1.C: New test.
	* testsuite/libgomp.c++/taskloop-2.C: New test.
	* testsuite/libgomp.c++/taskloop-3.C: New test.
	* testsuite/libgomp.c++/taskloop-4.C: New test.
	* testsuite/libgomp.c++/taskloop-5.C: New test.
	* testsuite/libgomp.c++/taskloop-6.C: New test.
	* testsuite/libgomp.c++/taskloop-7.C: New test.
	* testsuite/libgomp.c++/taskloop-8.C: New test.
	* testsuite/libgomp.c++/taskloop-9.C: New test.
	* testsuite/libgomp.fortran/affinity1.f90: New test.
	* testsuite/libgomp.fortran/affinity2.f90: New test.
liboffloadmic/
2015-10-13  Ilya Verbin  <ilya.verbin@intel.com>

	* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_dev2dev): New
	function.
	* plugin/offload_target_main.cpp (__offload_target_tgt2tgt): New
	static function, register it in liboffloadmic.

From-SVN: r228777
2015-10-13 21:06:23 +02:00
Tom de Vries 1f600feab0 Add param parloops-schedule
2015-10-13  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/67476
	* doc/invoke.texi (@item parloops-schedule): New item.
	* params.def (PARAM_PARLOOPS_SCHEDULE): New DEFPARAMENUM5.
	* tree-parloops.c: Include params-enum.h.
	(create_parallel_loop): Handle PARAM_PARLOOPS_SCHEDULE.

	* testsuite/libgomp.c/autopar-3.c: New test.
	* testsuite/libgomp.c/autopar-4.c: New test.
	* testsuite/libgomp.c/autopar-5.c: New test.
	* testsuite/libgomp.c/autopar-6.c: New test.
	* testsuite/libgomp.c/autopar-7.c: New test.
	* testsuite/libgomp.c/autopar-8.c: New test.

From-SVN: r228756
2015-10-13 10:08:59 +00:00
James Norris 058a654b30 vector-loop.c: Fix loop initializer.
* testsuite/libgomp.oacc-c-c++-common/vector-loop.c: Fix loop
	initializer.

From-SVN: r228737
2015-10-12 20:22:30 +00:00
David Malcolm 9e531d3749 Testsuite: add dg-{begin|end}-multiline-output commands
This patch adds an easy way to write tests for expected multiline
output.  For example we can test carets and underlines for
a particular diagnostic with:

/* { dg-begin-multiline-output "" }
 typedef struct _GMutex GMutex;
                ^~~~~~~
   { dg-end-multiline-output "" } */

multiline.exp is used by prune.exp; hence we need to load it before
prune.exp via *load_gcc_lib* for the testsuites of the various
non-"gcc" support libraries (e.g. boehm-gc).

gcc/testsuite/ChangeLog:
	* lib/multiline.exp: New file.
	* lib/prune.exp: Load multiline.exp.
	(prune_gcc_output): Call into multiline.exp to handle any
	multiline output directives.
	* lib/libgo.exp: Load multiline.exp before prune.exp, using
	load_gcc_lib.

boehm-gc/ChangeLog:
	* testsuite/lib/boehm-gc.exp: Load multiline.exp before
	prune.exp, using load_gcc_lib.

libatomic/ChangeLog:
	* testsuite/lib/libatomic.exp: Load multiline.exp before
	prune.exp, using load_gcc_lib.

libgomp/ChangeLog:
	* testsuite/lib/libgomp.exp: Load multiline.exp before prune.exp,
	using load_gcc_lib.

libitm/ChangeLog:
	* testsuite/lib/libitm.exp: Load multiline.exp before prune.exp,
	using load_gcc_lib.

libvtv/ChangeLog:
	* testsuite/lib/libvtv.exp: Load multiline.exp before prune.exp,
	using load_gcc_lib.

From-SVN: r228655
2015-10-09 13:55:23 +00:00
Thomas Schwinge 113020dc59 nvptx offloading linking
gcc/
	* config/nvptx/mkoffload.c (Kind, Vis): Remove enums.
	(Token, Stmt): Remove structs.
	(decls, vars, fns): Remove variables.
	(alloc_comment, append_stmt, is_keyword): Remove macros.
	(tokenize, write_token, write_tokens, alloc_stmt, rev_stmts)
	(write_stmt, write_stmts, parse_insn, parse_list_nosemi)
	(parse_init, parse_file): Remove functions.
	(read_file): Accept a pointer to a length and store into it.
	(process): Don't try to parse the input file, just write it out as
	a string, but looking for maps.  Also write out the length.
	(main): Don't use "-S" to compile PTX code.

	libgomp/
	* oacc-ptx.h: Remove file, moving its content into...
	* config/nvptx/fortran.c: ... here...
	* config/nvptx/oacc-init.c: ..., here...
	* config/nvptx/oacc-parallel.c: ..., and here.
	* config/nvptx/openacc.f90: New file.
	* plugin/plugin-nvptx.c: Don't include "oacc-ptx.h".
	(link_ptx): Don't link in predefined bits of PTX code.

Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com>

From-SVN: r228418
2015-10-02 21:43:41 +02:00
Nathan Sidwell cc3cd79bc2 mkoffload.c (process): Change offload data format.
gcc/
	* config/nvptx/mkoffload.c (process): Change offload data format.

	libgomp/
	* plugin/plugin-nvptx.c (targ_fn_launch): Use GOMP_DIM_MAX.
	(struct targ_ptx_obj): New.
	(nvptx_tdata): Move earlier, change data format.
	(link_ptx): Take targ_ptx_obj ptr and count.  Allow multiple
	objects.
	(GOMP_OFFLOAD_load_image): Adjust.

Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com>

From-SVN: r228308
2015-09-30 21:35:47 +00:00
Thomas Schwinge 4e2a5450e9 Add checkpoint to libgomp dg-shouldfail tests
That is, verify that we're actually reaching the expected checkpoint before
terminating.

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/abort-1.c: Add checkpoint.
	* testsuite/libgomp.oacc-c-c++-common/abort-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/clauses-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-1.c: Likewise.
	* 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-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-11.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-16.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-17.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-18.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-20.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-21.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-22.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-23.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-25.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-26.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-27.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-28.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-29.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-30.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-34.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-35.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-36.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-39.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-40.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-43.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-44.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-47.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-48.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-52.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-53.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-54.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-57.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-58.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-62.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-63.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-64.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-65.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-67.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-68.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-71.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-77.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-80.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/present-1.c: Likewise.
	* testsuite/libgomp.oacc-fortran/abort-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-1.f: Likewise.
	* 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.

From-SVN: r228282
2015-09-30 10:44:49 +02:00
Nathan Sidwell 164453bba4 builtins.c (expand_builtin_acc_on_device): Delete.
gcc/
	* builtins.c (expand_builtin_acc_on_device): Delete.
	(expand_builtin): Don't call it.
	(fold_builtin_1): Fold acc_on_device.

	libgomp/
	* oacc-init.c (acc_on_device): Force optimization level.

From-SVN: r228267
2015-09-29 20:03:33 +00:00
Nathan Sidwell a12a043782 plugin-nvptx.c (ARRAYSIZE): Delete.
* plugin/plugin-nvptx.c (ARRAYSIZE): Delete.
	(cuda_errlist): Delete.
	(cuda_error): Reimplement.

From-SVN: r228265
2015-09-29 19:45:47 +00:00
Nathan Sidwell 3e32ee19a5 gomp-constants.h (GOMP_VERSION_NVIDIA_PTX): Increment.
inlude/
	* gomp-constants.h (GOMP_VERSION_NVIDIA_PTX): Increment.
	(GOMP_DIM_GANG, GOMP_DIM_WORKER, GOMP_DIM_VECTOR, GOMP_DIM_MAX,
	GOMP_DIM_MASK): New.
	(GOMP_LAUNCH_DIM, GOMP_LAUNCH_ASYNC, GOMP_LAUNCH_WAIT): New.
	(GOMP_LAUNCH_CODE_SHIFT, GOMP_LAUNCH_DEVICE_SHIFT,
	GOMP_LAUNCH_OP_SHIFT): New.
	(GOMP_LAUNCH_PACK, GOMP_LAUNCH_CODE, GOMP_LAUNCH_DEVICE,
	GOMP_LAUNCH_OP): New.
	(GOMP_LAUNCH_OP_MAX): New.

	libgomp/
	* libgomp.h (acc_dispatch_t): Replace separate geometry args with
	array.
	* libgomp.map (GOACC_parallel_keyed): New.
	* oacc-parallel.c (goacc_wait): Take pointer to va_list.  Adjust
	all callers.
	(GOACC_parallel_keyed): New interface.  Lose geometry arguments
	and take keyed varargs list.  Adjust call to exec_func.
	(GOACC_parallel): Force host fallback.
	* libgomp_g.h (GOACC_parallel): Remove.
	(GOACC_parallel_keyed): Declare.
	* plugin/plugin-nvptx.c (struct targ_fn_launch): New struct.
	(stuct targ_gn_descriptor): Replace name field with launch field.
	(nvptx_exec): Lose separate geometry args, take array.  Process
	dynamic dimensions and adjust.
	(struct nvptx_tdata): Replace fn_names field with fn_descs.
	(GOMP_OFFLOAD_load_image): Adjust for change in function table
	data.
	(GOMP_OFFLOAD_openacc_parallel): Adjust for change in dimension
	passing.
	* oacc-host.c (host_openacc_exec): Adjust for change in dimension
	passing.

	gcc/
	* config/nvptx/nvptx.c: Include omp-low.h and gomp-constants.h.
	(nvptx_record_offload_symbol): Record function execution geometry.
	* config/nvptx/mkoffload.c (process): Include launch geometry in
	function data.
	* omp-low.c (oacc_launch_pack): New.
	(replace_oacc_fn_attrib): New.
	(set_oacc_fn_attrib): New.
	(get_oacc_fn_attrib): New.
	(expand_omp_target): Create keyed varargs for GOACC_parallel call
	generation.
	* omp-low.h (get_oacc_fn_attrib): Declare.
	* builtin-types.def (DEF_FUNCTION_TyPE_VAR_6): New.
	(DEF_FUNCTION_TYPE_VAR_11): Delete.
	* tree.h (OMP_CLAUSE_EXPR): New.
	* omp-builtins.def (BUILT_IN_GOACC_PARALLEL): Change target fn name.

	gcc/lto/
	* lto-lang.c (DEF_FUNCTION_TYPE_VAR_6): New.
	(DEF_FUNCTION_TYPE_VAR_11): Delete.

	gcc/c-family/
	* c-common.c (DEF_FUNCTION_TYPE_VAR_6): New.
	(DEF_FUNCTION_TYPE_VAR_11): Delete.

	gcc/fortran/
	* f95-lang.c (DEF_FUNCTION_TYPE_VAR_6): New.
	(DEF_FUNCTION_TYPE_VAR_11): Delete.
	* types.def (DEF_FUNCTION_TYPE_VAR_6): New.
	(DEF_FUNCTION_TYPE_VAR_11): Delete.

	gcc/ada/
	* gcc-interface/utils.c (DEF_FUNCTION_TYPE_VAR_6): Define

From-SVN: r228220
2015-09-28 19:37:33 +00:00
Thomas Schwinge 64186aad5a Fix --enable-offload-targets/-foffload handling, pt. 1
gcc/
	* configure.ac (offload_targets, OFFLOAD_TARGETS): Separate
	offload targets by commas, not colons.
	* config.in: Regenerate.
	* configure: Likewise.
	* gcc.c (driver::maybe_putenv_COLLECT_LTO_WRAPPER): Due to that,
	instead of setting up the default offload targets here...
	(process_command): ..., do it here.
	libgomp/
	* plugin/configfrag.ac (OFFLOAD_TARGETS): Clarify that offload
	targets are separated by commas.
	* config.h.in: Regenerate.

From-SVN: r228053
2015-09-23 16:52:50 +02:00
Chung-Lin Tang 6bb4c3e2d8 re PR libgomp/67141 (wrong libgomp mutex initialisation order)
2015-09-22  Chung-Lin Tang  <cltang@codesourcery.com>

	PR libgomp/67141
	* oacc-int.h (goacc_host_init): Add declaration.
	* oacc-host.c (goacc_host_init): Remove static and constructor attribute.
	* oacc-init.c (goacc_runtime_initialize): Call goacc_host_init() at end.

From-SVN: r227994
2015-09-22 06:45:22 +00:00
Aditya Kumar 74032f471d Remove limit_scops
This patch removes graphite-scop-detection.c:limit_scops function and fix
related issues arising because of that. The functionality limit_scop was added
as an intermediate step to discard the loops which graphite could not
handle. Removing limit_scop required handling of different cases of loops and
surrounding code.  The scop is now larger so most test cases required 'number of
scops detected' to be fixed. By increasing the size of scop we can now optimize
loops which are 'siblings' of each other. This could enable loop fusion on a
number of loops. Since in the graphite framework we mostly want to opimize
loop-nests/adjacent-loops, we now discard scops with less than 2 loops. We
also discard scops without any data references.

Essentially:
 - Remove limite_scops.
 - Only select scops when there are at least two loops (loop nest or, side by side).
 - Discard loops without data-refs.
 - Fix test cases.

Passes bootstrap and reg-test.

gcc/ChangeLog:

2015-09-02  Aditya Kumar  <hiraditya@msn.com>
            Sebastian Pop  <s.pop@samsung.com>

        * graphite-isl-ast-to-gimple.c (gcc_expression_from_isl_ast_expr_id):
        Return the parameter if it was saved in corresponding
        parameter_rename_map of the region.
        (copy_def): Copy def from sese region to the newly created region.
        (copy_internal_parameters): Copy all the internal parameters defined
        within a region to the newly created region.
        (graphite_regenerate_ast_isl): Copy parameters to the new region before
        translating isl to gimple.
        * graphite-scop-detection.c (graphite_can_represent_loop): Bail out if
          the loop-nest does not have any data-references.
        (build_graphite_scops): Create a scop only when there is at least one
        loop inside it.
        (contains_only_close_phi_nodes): Deleted.
        (print_graphite_scop_statistics): Deleted
        (print_graphite_statistics): Deleted
        (limit_scops): Deleted.
        (build_scops): Removed call to limit_scops.
        * sese.c (new_sese): Construct.
        (free_sese): Destruct.
        (sese_add_exit_phis_edge): update_stmt after exit phi edge has been
        added.
        (set_rename): Pass sese region so that parameters inside the region can
        be added to its parameter_rename_map.
        (rename_uses): Pass sese region.
        (graphite_copy_stmts_from_block): Do not copy parameters that have been
        generated in the header of the scop. For each SSA_NAME in the
        parameter_rename_map rename its usage.
        (invariant_in_sese_p_rec): Return false if tree t is defined outside
        sese region.
        (scalar_evolution_in_region): If the tree t is invariant just return t.
        * sese.h: Added a parameter renamne map (parameter_rename_map_t) to
          struct sese to keep track of all the parameters which need renaming.
        * tree-data-ref.c (loop_nest_has_data_refs): Check if a loop nest has
          any data-refs.
        * tree-data-ref.h: Declaration of loop_nest_has_data_refs.

gcc/testsuite/ChangeLog:

2015-09-02  Aditya Kumar  <hiraditya@msn.com>
            Sebastian Pop  <s.pop@samsung.com>

        * gcc.dg/graphite/block-0.c: Modifed test case to match current output.
        * gcc.dg/graphite/block-1.c: Same.
        * gcc.dg/graphite/block-5.c: Same.
        * gcc.dg/graphite/block-6.c: Same.
        * gcc.dg/graphite/interchange-1.c: Same.
        * gcc.dg/graphite/interchange-10.c: Same.
        * gcc.dg/graphite/interchange-11.c: Same.
        * gcc.dg/graphite/interchange-13.c: Same.
        * gcc.dg/graphite/interchange-14.c: Same.
        * gcc.dg/graphite/interchange-3.c: Same.
        * gcc.dg/graphite/interchange-4.c: Same.
        * gcc.dg/graphite/interchange-7.c: Same.
        * gcc.dg/graphite/interchange-8.c: Same.
        * gcc.dg/graphite/interchange-9.c: Same.
        * gcc.dg/graphite/isl-codegen-loop-dumping.c: Same.
        * gcc.dg/graphite/pr35356-1.c (foo): Same.
        * gcc.dg/graphite/pr37485.c: Same.
        * gcc.dg/graphite/scop-0.c (int toto): Same.
        * gcc.dg/graphite/scop-1.c: Same.
        * gcc.dg/graphite/scop-10.c: Same.
        * gcc.dg/graphite/scop-11.c: Same.
        * gcc.dg/graphite/scop-12.c: Same.
        * gcc.dg/graphite/scop-13.c: Same.
        * gcc.dg/graphite/scop-16.c: Same.
        * gcc.dg/graphite/scop-17.c: Same.
        * gcc.dg/graphite/scop-18.c: Same.
        * gcc.dg/graphite/scop-2.c: Same.
        * gcc.dg/graphite/scop-21.c (int test): Same.
        * gcc.dg/graphite/scop-22.c (void foo): Same.
        * gcc.dg/graphite/scop-4.c: Same.
        * gcc.dg/graphite/scop-5.c: Same.
        * gcc.dg/graphite/scop-6.c: Same.
        * gcc.dg/graphite/scop-7.c: Same.
        * gcc.dg/graphite/scop-8.c: Same.
        * gcc.dg/graphite/scop-9.c: Same.
        * gcc.dg/graphite/scop-mvt.c (void mvt): Introduced dependency so that
          data-refs remain inside the inner loop.
        * gcc.dg/graphite/uns-block-1.c: Modifed test case to match o/p.
        * gcc.dg/graphite/uns-interchange-14.c: Same.
        * gcc.dg/graphite/uns-interchange-9.c: Same.
        * gfortran.dg/graphite/interchange-3.f90

libgomp/ChangeLog:

2015-09-04  Aditya Kumar  <hiraditya@msn.com>
            Sebastian Pop  <s.pop@samsung.com>

        * testsuite/libgomp.graphite/bounds.c (int foo): Modifed test case to
          match o/p.
        * testsuite/libgomp.graphite/force-parallel-1.c (void parloop): Same.
        * testsuite/libgomp.graphite/force-parallel-4.c: Same.
        * testsuite/libgomp.graphite/force-parallel-5.c: Same.
        * testsuite/libgomp.graphite/force-parallel-7.c: Same.
        * testsuite/libgomp.graphite/force-parallel-8.c: Same.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r227567
2015-09-08 22:18:11 +00:00
Jakub Jelinek 97875f4a94 configure.tgt: Add missing ;; in between nvptx and rtems snippets.
* configure.tgt: Add missing ;; in between nvptx and rtems
	snippets.

From-SVN: r227457
2015-09-03 18:20:35 +02:00
Sebastian Huber 06441dd5e3 [gomp] Add thread attribute customization
libgomp/ChangeLog

	* config/posix/pool.h (gomp_adjust_thread_attr): New.
	* config/rtems/pool.h (gomp_adjust_thread_attr): Likewise.
	(gomp_thread_pool_reservoir): Add priority member.
	* confi/rtems/proc.c (allocate_thread_pool_reservoir): Add
	priority.
	(parse_thread_pools): Likewise.
	* team.c (gomp_team_start): Call configuration provided
	gomp_adjust_thread_attr(). Destroy thread attributes if
	necessary.
	* libgomp.texi: Document GOMP_RTEMS_THREAD_POOLS.

From-SVN: r227442
2015-09-03 11:34:28 +00:00
Sebastian Huber 66c59f9238 [gomp] Thread pool management
libgomp/ChangeLog

	* config/posix/pool.h: New.
	* config/rtems/pool.h: Likewise.
	* config/rtems/proc.c: Likewise.
	* libgomp.h (gomp_thread_destructor): Declare.
	* team.c: Include configuration provided "pool.h".
	(gomp_get_thread_pool): Define in configuration.
	(gomp_team_end): Call configuration defined
	gomp_release_thread_pool().

From-SVN: r227441
2015-09-03 11:29:59 +00:00
Sebastian Huber 13c41b2e3e [gomp] Add RTEMS configuration
libgomp/ChangeLog

	* config/rtems/bar.c: New.
	* config/rtems/bar.h: Likewise.
	* config/rtems/mutex.c: Likewise.
	* config/rtems/mutex.h: Likewise.
	* config/rtems/sem.c: Likewise.
	* config/rtems/sem.h: Likewise.
	* configure.ac (*-*-rtems*): Check that Newlib provides a proper
	<sys/lock.h> header file.
	* configure.tgt (*-*-rtems*): Enable RTEMS configuration if
	supported by Newlib.
	* configure: Regenerate.

From-SVN: r227440
2015-09-03 11:26:36 +00:00
Sebastian Huber 7892ec670c [gomp] Simplify thread pool initialization
libgomp/ChangeLog

	* team.c (gomp_new_thread_pool): Delete and move content to ...
	(gomp_get_thread_pool): ... new function.  Allocate and
	initialize thread pool on demand.
	(get_last_team): Use gomp_get_thread_pool().
	(gomp_team_start): Delete thread pool initialization.

From-SVN: r227439
2015-09-03 11:24:34 +00:00
Tom de Vries 1b96e9a4bf Fix inner loop phi in expand_omp_for_static_chunk
2015-09-03  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/65637
	* omp-low.c (find_phi_with_arg_on_edge): New function.
	(expand_omp_for_static_chunk): Fix inner loop phi.

	* testsuite/libgomp.c/autopar-2.c: New test.

From-SVN: r227437
2015-09-03 11:01:14 +00:00
Tom de Vries 3ff2d74e9c Handle mix/max pointer reductions in parloops
2015-08-29  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/46193
	* omp-low.c (omp_reduction_init): Handle pointer type for min or max
	clause.

	* gcc.dg/autopar/pr46193.c: New test.

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

From-SVN: r227315
2015-08-29 07:07:51 +00:00
Nathan Sidwell 2a21ff193a libgomp.map: Add 4.0.2 version.
libgomp/
	* libgomp.map: Add 4.0.2 version.
	* target.c (offload_image_descr): Add version field.
	(gomp_load_image_to_device): Add version argument.  Adjust plugin
	call.  Improve load mismatch diagnostic.
	(gomp_unload_image_from_device): Add version argument.  Adjust plugin
	call.
	(GOMP_offload_regster): Make stub function, move bulk to ...
	(GOMP_offload_register_ver): ... here.  Process version argument.
	(GOMP_offload_unregister): Make stub function, move bulk to ...
	(GOMP_offload_unregister_ver): ... here.  Process version argument.
	(gomp_init_device): Process version field.
	(gomp_unload_device): Process version field.
	(gomp_load_plugin_for_device): Reimplement DLSYM & DLSYM_OPT
	macros.  Check plugin version.
	* libgomp.h (gomp_device_descr): Add version function field.  Adjust
	loader and unloader types.
	* oacc-host.c: Include gomp-constants.h.
	(host_version): New.
	(host_load_image, host_unload_image): Adjust.
	(host_dispatch): Add host_version.
	* plugin/plugin-nvptx.c: Include gomp-constants.h.
	(GOMP_OFFLOAD_version): New.
	(GOMP_OFFLOAD_load_image): Add version arg and check it.
	(GOMP_OFFLOAD_unload_image): Likewise.
	* plugin/plugin-host.c: Include gomp-constants.h.
	(GOMP_OFFLOAD_version): New.
	(GOMP_OFFLOAD_load_image): Add version arg.
	(GOMP_OFFLOAD_unload_image): Likewise.

	liboffloadmic/
	* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_version): New.
	(GOMP_OFFLOAD_load_image): Add version arg and check it.
	(GOMP_OFFLOAD_unload_image): Likewise.

	include/
	* gomp-constants.h (GOMP_VERSION, GOMP_VERSION_NVIDIA_PTX,
	GOMP_VERSION_INTEL_MIC): New.
	(GOMP_VERSION_PACK, GOMP_VERSION_LIB, GOMP_VERSION_DEV): New.

	gcc/
	* config/nvptx/mkoffload.c (process): Replace
	GOMP_offload_{,un}register with GOMP_offload_{,un}register_ver.

From-SVN: r227137
2015-08-24 17:10:06 +00:00
Tom de Vries 1358a74795 Add libgomp.oacc-c-c++-common/vector-loop.c
2015-08-24  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/65468
	* testsuite/libgomp.oacc-c-c++-common/vector-loop.c: New test.

From-SVN: r227130
2015-08-24 15:01:44 +00:00
Tom de Vries 6be5c241bb Optimize expand_omp_for_static_chunk for chunk_size one
2015-08-24  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/65468
	* omp-low.c (expand_omp_for_static_chunk): Remove inner loop if
	chunk_size is one.

	* gcc.dg/gomp/static-chunk-size-one.c: New test.

	* testsuite/libgomp.c/static-chunk-size-one.c: New test.

From-SVN: r227124
2015-08-24 13:14:17 +00:00
Joost VandeVondele bfe7ac89a0 re PR libgomp/66761 (libgomp: ThreadSanitizer: data race in libgomp)
PR libgomp/66761
        PR libgomp/67303
        * iter.c (gomp_iter_dynamic_next): Employ an atomic load.
        (gomp_iter_guided_next): Idem.
        * iter_ull.c (gomp_iter_ull_dynamic_next): Idem.
        (gomp_iter_ull_guided_next): Idem.
        * config/linux/wait.h (do_spin): Idem.

From-SVN: r227119
2015-08-24 11:01:25 +00:00
Thomas Schwinge b97e78b712 [PR libgomp/65742, PR middle-end/66332] libgomp: Remove plugin for non-shared memory host execution
gcc/
	* builtins.c (expand_builtin_acc_on_device) [ACCEL_COMPILER]: Emit
	open-coded sequence.
	* omp-low.c (oacc_process_reduction_data): Remove handline of
	GOMP_DEVICE_HOST_NONSHM.
	gcc/testsuite/
	* c-c++-common/goacc/acc_on_device-2.c: Remove XFAIL for C.
	include/
	* gomp-constants.c (GOMP_DEVICE_HOST_NONSHM): Remove.
	libgomp/
	* libgomp-plugin.h (enum offload_target_type): Remove
	OFFLOAD_TARGET_TYPE_HOST_NONSHM.
	* openacc.f90 (openacc_kinds): Remove acc_device_host_nonshm.
	* openacc.h (enum acc_device_t): Likewise.
	* openacc_lib.h: Likewise.
	* oacc-init.c (name_of_acc_device_t): Don't handle it.
	(acc_on_device): Just use __builtin_acc_on_device.
	* testsuite/libgomp.oacc-c-c++-common/if-1.c: Don't forbid usage
	of acc_on_device builtin.
	* plugin/plugin-host.h: Remove file.
	* plugin/plugin-host.c: Likewise, but salvage some content into...
	* oacc-host.c: ... this file.
	* plugin/Makefrag.am: Don't build libgomp-plugin-host_nonshm.la.
	* plugin/configfrag.ac (offload_targets): Don't add host_nonshm.
	* Makefile.in: Regenerate.
	* configure: Likewise.
	* testsuite/lib/libgomp.exp
	(check_effective_target_openacc_host_nonshm_selected): Remove.
	* testsuite/libgomp.oacc-c++/c++.exp: Don't handle
	ACC_DEVICE_TYPE=host_nonshm.
	* testsuite/libgomp.oacc-c/c.exp: Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_on_device-1.c: 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.

From-SVN: r226763
2015-08-10 18:48:26 +02:00
Thomas Schwinge 44a7d18d95 Empty libgomp for nvptx
* configure.ac (noconfigdirs): Don't add "target-libgomp" for target
	nvptx*-*-*.
	* configure: Regenerate.
	libgomp/
	* config/nvptx/affinity.c: New file.
	* config/nvptx/alloc.c: Likewise.
	* config/nvptx/bar.c: Likewise.
	* config/nvptx/barrier.c: Likewise.
	* config/nvptx/critical.c: Likewise.
	* config/nvptx/env.c: Likewise.
	* config/nvptx/error.c: Likewise.
	* config/nvptx/fortran.c: Likewise.
	* config/nvptx/iter.c: Likewise.
	* config/nvptx/iter_ull.c: Likewise.
	* config/nvptx/libgomp-plugin.c: Likewise.
	* config/nvptx/lock.c: Likewise.
	* config/nvptx/loop.c: Likewise.
	* config/nvptx/loop_ull.c: Likewise.
	* config/nvptx/mutex.c: Likewise.
	* config/nvptx/oacc-async.c: Likewise.
	* config/nvptx/oacc-cuda.c: Likewise.
	* config/nvptx/oacc-host.c: Likewise.
	* config/nvptx/oacc-init.c: Likewise.
	* config/nvptx/oacc-mem.c: Likewise.
	* config/nvptx/oacc-parallel.c: Likewise.
	* config/nvptx/oacc-plugin.c: Likewise.
	* config/nvptx/omp-lock.h: Likewise.
	* config/nvptx/ordered.c: Likewise.
	* config/nvptx/parallel.c: Likewise.
	* config/nvptx/proc.c: Likewise.
	* config/nvptx/ptrlock.c: Likewise.
	* config/nvptx/sections.c: Likewise.
	* config/nvptx/sem.c: Likewise.
	* config/nvptx/single.c: Likewise.
	* config/nvptx/splay-tree.c: Likewise.
	* config/nvptx/target.c: Likewise.
	* config/nvptx/task.c: Likewise.
	* config/nvptx/team.c: Likewise.
	* config/nvptx/time.c: Likewise.
	* config/nvptx/work.c: Likewise.
	* configure.ac: Don't probe pthreads support for host nvptx*-*-*.
	* configure: Regenerate.
	* configure.tgt (config_path): Set to "nvptx" for target
	nvptx*-*-*.

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

From-SVN: r226760
2015-08-10 17:53:33 +02:00
Thomas Schwinge 96a2d174cc Fix offloading machine mode stream reading
... in context of the GET_MODE_INNER changes applied in r226328.

	gcc/
	* lto-streamer-in.c (lto_input_mode_table): Adjust to
	GET_MODE_INNER changes.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/vector-type-1.c: New file.

From-SVN: r226759
2015-08-10 17:22:30 +02:00
Nathan Sidwell 9ebddeb045 plugin-nvptx.c: Don't include dlfcn.h.
* plugin/plugin-nvptx.c: Don't include dlfcn.h.
	(cuda_errlist): Constify.
	(errmsg):  Move into ...
	(cuda_error): ... here.  Make smaller.
	(_XSTR, _STR): Delete.
	(cuda_synames): Delete.
	(verify_device_library): Delete.
	(nvptx_init): Don't call it.

From-SVN: r226539
2015-08-04 00:40:18 +00:00
Tom de Vries 12efb1d75f Handle double reduction in parloops
2015-07-28  Tom de Vries  <tom@codesourcery.com>

	* tree-parloops.c (reduc_stmt_res): New function.
	(initialize_reductions, add_field_for_reduction)
	(create_phi_for_local_result, create_loads_for_reductions)
	(create_stores_for_reduction, build_new_reduction): Handle case that
	reduc_stmt is a phi.
	(gather_scalar_reductions): Allow double_reduc reductions.

	* gcc.dg/autopar/uns-outer-4.c: Remove xfail on scan for parallelizing
	outer loop.

	* testsuite/libgomp.c/uns-outer-4.c: New test.

From-SVN: r226300
2015-07-28 07:54:04 +00:00
Cesar Philippidis 710ee21854 re PR libgomp/66714 (ICE in loc_list_from_tree with -g)
PR 66714

	gcc/
	* tree-cfg.c (struct replace_decls_d): New struct.
	(replace_block_vars_by_duplicates_1): New function.
	(replace_block_vars_by_duplicates): Use it to replace the decls
	in the value exprs by duplicates.

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

From-SVN: r226160
2015-07-24 07:38:43 -07:00
Maxim Blumenthal 27c4ac7db7 re PR libgomp/66950 (FAIL: libgomp.fortran/examples-4/simd-7.f90 -O0 execution test)
2015-07-22  Maxim Blumenthal  <maxim.blumenthal@intel.com>

	PR libgomp/66950
	* testsuite/libgomp.c/examples-4/simd-7.c (N): Change to 30 from 45.
	(fib_ref): New function.
	(fib): Correct corner cases in the recursion.
	(main): Replace the non-simd loop with fib_ref call.
	* testsuite/libgomp.fortran/examples-4/simd-7.f90: (fib_ref): New
	subroutine.
	(fibonacci): Lower the parameter N to 30.  Correct accordingly check
	for the last array element value.  Replace the non-simd loop with
	fib_ref call.  Remove redundant b_ref array.  Remove the comparison
	of the last array element with according Fibonacci sequence element.
	(fib): Correct corner cases in the recursion.

From-SVN: r226080
2015-07-22 17:19:31 +00:00
Nathan Sidwell 22be23495a target.c (gomp_offload_image_to_device): Rename to ...
libgomp/
	* target.c (gomp_offload_image_to_device): Rename to ...
	(gomp_load_image_to_device): ... here.
	(GOMP_offload_register): Adjust call.
	(gomp_init_device): Likewise.
	(gomp_unload_image_from_device): New.  Broken out of ...
	(GOMP_offload_unregister): ... here.  Call it.
	(gomp_unload_device): New.
	* libgomp.h (gomp_unload_device): Declare.
	* oacc-init.c (acc_shutdown_1): Unload from device before deleting
	mem maps.

	gcc/
	* config/nvptx/mkoffload.c (process): Add static destructor call.

From-SVN: r226039
2015-07-21 13:30:06 +00:00
Nathan Sidwell a051317b73 Missed a difference between gomp4 and trunk
From-SVN: r226012
2015-07-20 17:38:49 +00:00
Nathan Sidwell a091118d2c oacc-parallel.c (GOACC_parallel): Move variadic handling into wait=-specific if.
* oacc-parallel.c (GOACC_parallel): Move variadic handling into
	wait=-specific if.
	(GOACC_enter_exit_data, GOACC_update): Use consistent num_waits
	!=0 condition.
	(goacc_waits): Move !num_waits handling to ...
	(GOACC_wait): ... here, the only caller that might have zero waits.

From-SVN: r226011
2015-07-20 17:31:46 +00:00
Nathan Sidwell f3e9a059a7 plugin-nvptx.c (struct targ_fn_descriptor): Move later.
* plugin/plugin-nvptx.c (struct targ_fn_descriptor): Move later.
	(struct ptx_image_data): Move earlier, add fns field.
	(struct ptx_device): Add images and image_lock fields.
	(ptx_images, ptx_image_lock): Delete.
	(nvptx_open_device): Initialize images and image_lock fields.
	(nvptx_close_device): Destroy image_lock.
	(GOMP_OFFLOAD_load_image): Register image to device-specific fields.
	(GOMP_OFFLOAD_unload_image): Unregister image from device-specific
	fields.

From-SVN: r226004
2015-07-20 16:17:57 +00:00
Nathan Sidwell 896c28a7fa target.c (GOMP_offload_register): Use int for device type arg.
* target.c (GOMP_offload_register): Use int for device type arg.
	(GOMP_offload_unregister): Likewise.

From-SVN: r225944
2015-07-17 17:17:26 +00:00
Nathan Sidwell ebe4a56073 mkoffload.c (process): Constify host data.
gcc/
	* config/nvptx/mkoffload.c (process): Constify host data.
	* config/i386/intelmic-mkoffload.c (generate_target_descr_file):
	Constify host data.
	(generate_host_descr_file): Likewise.

	libgomp/
	* target.c (struct_offload_image_descr): Constify host_table.
	(gomp_offload_image_to_device): Likewise.
	(GOMP_offload_register, GOMP_offload_unregister): Likewise.

	libgcc/
	* offloadstuff.c: Constify host data.

From-SVN: r225943
2015-07-17 17:12:01 +00:00
Nathan Sidwell afb2d80bc5 mkoffload.c (process): Constify target data.
gcc/
	* config/nvptx/mkoffload.c (process): Constify target data.
	* config/i386/intelmic-mkoffload.c (generate_target_descr_file):
	Constify target data.
	(generate_target_offloadend_file): Likewise.

	libgomp/
	* libgomp.h (gomp_device_descr): Constify target data arguments.
	* target.c (struct offload_image_descr): Constify target_data.
	(gomp_offload_image_to_device): Likewise.
	(GOMP_offload_register): Likewise.
	(GOMP_offload_unrefister): Likewise.
	* plugin/plugin-host.c (GOMP_OFFLOAD_load_image,
	GOMP_OFFLOAD_unload_image): Constify target data.
	* plugin/plugin-nvptx.c (struct ptx_image_data): Constify target data.
	(GOMP_OFFLOAD_load_image, GOMP_OFFLOAD_unload_image): Likewise.

	liboffloadmic/
	* plugin/libgomp-plugin-intelmic.cpp (ImgDevAddrMap): Constify.
	(offload_image, GOMP_OFFLOAD_load_image,
	OMP_OFFLOAD_unload_image): Constify target data.

From-SVN: r225936
2015-07-17 14:07:53 +00:00
Nathan Sidwell a4cb876dc9 plugin-nvptx.c (link_ptx): Constify string argument.
libgomp/
	* plugin/plugin-nvptx.c (link_ptx): Constify string argument.
	Workaround driver library const error.
	(struct nvptx_tdata, nvptx_tdata_t): New.
	(GOMP_OFFLOAD_load_image): Use struct for target_data's real
	type.

	gcc/
	* config/nvptx/mkoffload.c (process): Constify mapping variables.
	Define target data struct and initialize it.

From-SVN: r225897
2015-07-16 17:17:31 +00:00
Maxim Blumenthal 28ef6a27c8 Fix libgomp tests.
2015-07-15  Maxim Blumenthal  <maxim.blumenthal@intel.com>

libgomp/
	* testsuite/libgomp.fortran/examples-4/simd-8.f90: (main): Change type
	of EPS parameter from integer to real.
	* testsuite/libgomp.fortran/examples-4/task_dep-5.f90: (check): Change
	type of EPS parameter from integer to real.

From-SVN: r225827
2015-07-15 13:13:10 +00:00
Sebastian Huber 6dba011330 [gomp] Recycle last non-nested team if possible
libgomp/ChangeLog
2015-07-15  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* team.c (get_last_team): New.
	(gomp_new_team): Recycle last non-nested team if possible.
	(gomp_team_end): Move team work share list free lock destruction
	to ...
	(free_team): ... here.

From-SVN: r225811
2015-07-15 09:11:11 +00:00
Maxim Blumenthal 4c1cb4da7a simd-3.c: (main): Change type of res and ref from int to double.
2015-07-14  Maxim Blumenthal  <maxim.blumenthal@intel.com>

libgomp/
	* testsuite/libgomp.c/examples-4/simd-3.c: (main): Change type of res
	and ref from int to double.  Replaced their comparison with
	an inequality of their difference and EPS.
	* testsuite/libgomp.c/examples-4/simd-8.c: (main): Replace the
	comparison of pri and a reference number with an inequality of their
	difference and EPS.
	* testsuite/libgomp.fortran/examples-4/simd-3.f90: (main): Replaced
	the comparison of sum and sum_ref with an inequality of their
	difference and EPS.
	* testsuite/libgomp.fortran/examples-4/simd-8.f90: (main): Replace
	the comparison of pri and a reference number with an inequality of
	their difference and EPS.

From-SVN: r225786
2015-07-14 18:54:35 +00:00
Maxim Blumenthal 343587dc64 Update libgomp/testsuite/*/examples-4/* according to latest version (4.0.2)
2015-07-13  Maxim Blumenthal  <maxim.blumenthal@intel.com>

	* testsuite/libgomp.c++/examples-4/e.53.2.C: Renamed to...
	* testsuite/libgomp.c++/examples-4/declare_target-2.C: ...this.
	* testsuite/libgomp.c++/examples-4/e.51.5.C: Renamed to...
	* testsuite/libgomp.c++/examples-4/target_data-5.C: ...this.
	* testsuite/libgomp.c/examples-4/e.56.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/array_sections-3.c: ...this.
	* testsuite/libgomp.c/examples-4/e.56.4.c: Renamed to...
	* testsuite/libgomp.c/examples-4/array_sections-4.c: ...this.
	* testsuite/libgomp.c/examples-4/e.55.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/async_target-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.55.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/async_target-2.c: ...this.
	(vec_mult_ref): Remove v1 and v2 arguments, turn them into local
	variables.
	(vec_mult): Likewise.  Add #pragma omp taskwait.
	(main): Adjust caller.
	* testsuite/libgomp.c/examples-4/e.53.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/declare_target-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.53.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/declare_target-3.c: ...this.
	* testsuite/libgomp.c/examples-4/e.53.4.c: Renamed to...
	* testsuite/libgomp.c/examples-4/declare_target-4.c: ...this.
	* testsuite/libgomp.c/examples-4/e.53.5.c: Renamed to...
	* testsuite/libgomp.c/examples-4/declare_target-5.c: ...this.
	* testsuite/libgomp.c/examples-4/e.57.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/device-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.57.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/device-2.c: ...this.
	* testsuite/libgomp.c/examples-4/e.57.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/device-3.c: ...this.
	* testsuite/libgomp.c/examples-4/simd-1.c: New file.
	* testsuite/libgomp.c/examples-4/simd-2.c: New file.
	* testsuite/libgomp.c/examples-4/simd-3.c: New file.
	* testsuite/libgomp.c/examples-4/simd-4.c: New file.
	* testsuite/libgomp.c/examples-4/simd-5.c: New file.
	* testsuite/libgomp.c/examples-4/simd-6.c: New file.
	* testsuite/libgomp.c/examples-4/simd-7.c: New file.
	* testsuite/libgomp.c/examples-4/simd-8.c: New file.
	* testsuite/libgomp.c/examples-4/e.50.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.50.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target-2.c: ...this.
	* testsuite/libgomp.c/examples-4/e.50.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target-3.c: ...this.
	* testsuite/libgomp.c/examples-4/e.50.4.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target-4.c: ...this.
	* testsuite/libgomp.c/examples-4/e.50.5.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target-5.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-2.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-3.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.4.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-4.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.6.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-6.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.7.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-7.c: ...this.
	* testsuite/libgomp.c/examples-4/e.52.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_update-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.52.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_update-2.c: ...this.
	* testsuite/libgomp.c/examples-4/task_dep-1.c: New file.
	* testsuite/libgomp.c/examples-4/task_dep-2.c: New file.
	* testsuite/libgomp.c/examples-4/task_dep-3.c: New file.
	* testsuite/libgomp.c/examples-4/task_dep-4.c: New file.
	* testsuite/libgomp.c/examples-4/task_dep-5.c: New file.
	* testsuite/libgomp.c/examples-4/e.54.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/teams-2.c: ...this.
	* testsuite/libgomp.c/examples-4/e.54.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/teams-3.c: ...this.
	* testsuite/libgomp.c/examples-4/e.54.4.c: Renamed to...
	* testsuite/libgomp.c/examples-4/teams-4.c: ...this.
	* testsuite/libgomp.c/examples-4/e.54.5.c: Renamed to...
	* testsuite/libgomp.c/examples-4/teams-5.c: ...this.
	* testsuite/libgomp.c/examples-4/e.54.6.c: Renamed to...
	* testsuite/libgomp.c/examples-4/teams-6.c: ...this.
	* testsuite/libgomp.fortran/examples-4/e.56.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/array_sections-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.56.4.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/array_sections-4.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.55.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/async_target-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.55.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/async_target-2.f90: ...this.
	(vec_mult): Add !$omp taskwait.
	* testsuite/libgomp.fortran/examples-4/e.53.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/declare_target-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.53.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/declare_target-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.53.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/declare_target-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.53.4.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/declare_target-4.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.53.5.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/declare_target-5.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.57.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/device-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.57.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/device-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.57.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/device-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/simd-1.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-2.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-3.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-4.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-5.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-6.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-7.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-8.f90: New file.
	* testsuite/libgomp.fortran/examples-4/e.50.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.50.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.50.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.50.4.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target-4.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.50.5.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target-5.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.4.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-4.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.5.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-5.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.6.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-6.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.7.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-7.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.52.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_update-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.52.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_update-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/task_dep-1.f90: New file.
	* testsuite/libgomp.fortran/examples-4/task_dep-2.f90: New file.
	* testsuite/libgomp.fortran/examples-4/task_dep-3.f90: New file.
	* testsuite/libgomp.fortran/examples-4/task_dep-4.f90: New file.
	* testsuite/libgomp.fortran/examples-4/task_dep-5.f90: New file.
	* testsuite/libgomp.fortran/examples-4/e.54.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/teams-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.54.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/teams-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.54.4.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/teams-4.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.54.5.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/teams-5.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.54.6.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/teams-6.f90: ...this.

From-SVN: r225735
2015-07-13 13:08:13 +00:00
Tom de Vries 9f620bf1ea Insert new bound in try_transform_to_exit_first_loop_alt
2015-07-10  Tom de Vries  <tom@codesourcery.com>

	* tree-parloops.c (try_transform_to_exit_first_loop_alt): If not found,
	insert nit + 1 bound.

	* testsuite/libgomp.fortran/parloops-exit-first-loop-alt-2.f95: New test.
	* testsuite/libgomp.fortran/parloops-exit-first-loop-alt.f95: New test.

	* gfortran.dg/parloops-exit-first-loop-alt-2.f95: New test.
	* gfortran.dg/parloops-exit-first-loop-alt.f95: New test.

From-SVN: r225655
2015-07-10 08:25:18 +00:00
Thomas Schwinge a92defdab7 [nvptx offloading] Only 64-bit configurations are currently supported
PR libgomp/65099
	gcc/
	* config/nvptx/mkoffload.c (main): Create an offload image only in
	64-bit configurations.
	libgomp/
	* plugin/plugin-nvptx.c (nvptx_get_num_devices): Return 0 if not
	in a 64-bit configuration.
	* testsuite/libgomp.oacc-c++/c++.exp: Don't attempt nvidia
	offloading testing if no such device is available.
	* testsuite/libgomp.oacc-c/c.exp: Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.

From-SVN: r225560
2015-07-08 16:59:59 +02:00
Tom de Vries cadb53a5e6 Fix libgomp.c/parloops-exit-first-loop-alt{,-3}.c testcases
2015-07-08  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c (main): Fix
	second call to f.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: Same.

From-SVN: r225548
2015-07-08 12:31:00 +00:00
Tom de Vries 712cb0bbf3 Add empty loop exit block in transform_to_exit_first_loop_alt
2015-07-07  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/66642
	* tree-parloops.c (transform_to_exit_first_loop_alt): Update function
	header comment.  Rename split_edge variable to edge_at_split.  Split
	exit edge to create new loop exit bb.  Insert loop exit phis in new loop
	exit bb.

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c (main): Test low
	iteration count case.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c (init): New
	function, factor out of ...
	(main): ... here.  Test low iteration count case.

From-SVN: r225521
2015-07-07 16:25:22 +00:00
Sebastian Huber e5210c77a1 libgomp: Add comment to clarify last_team usage
libgomp/ChangeLog
2015-07-06  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* libgomp.h (gomp_thread_pool): Comment last_team field.

From-SVN: r225444
2015-07-06 07:21:48 +00:00
Uros Bizjak f70360e7b3 pr66702-1.C: Require vect_simd_clones effective target.
* testsuite/libgomp.c++/pr66702-1.C: Require
	vect_simd_clones effective target.
	* testsuite/libgomp.c++/pr66702-2.C: Ditto.

From-SVN: r225301
2015-07-02 10:17:20 +02:00
Tom de Vries b451c27117 Run testsuite/libgomp.oacc-c++/c++.exp at -O2 by default
2015-06-30  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c++/c++.exp: Set DEFAULT_CFLAGS to -O2 if not
	already set.  Use DEFAULT_CFLAGS in dg-runtest.
	* testsuite/libgomp.oacc-c-c++-common/collapse-3.c: Remove dg-options
	"-O2".

From-SVN: r225194
2015-06-30 15:43:55 +00:00
Tom de Vries f8e89d9f4d Run testsuite/libgomp.c++/c++.exp at -O2 by default
2015-06-30  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c++/c++.exp: Set DEFAULT_CFLAGS to -O2 if not
	already set.  Use DEFAULT_CFLAGS in dg-runtest.
	* testsuite/libgomp.c++/atomic-16.C: Remove dg-options "-O2 -fopenmp".
	* testsuite/libgomp.c++/pr64824.C: Same.
	* testsuite/libgomp.c++/pr64868.C: Same.
	* testsuite/libgomp.c++/pr66199-1.C: Same.
	* testsuite/libgomp.c++/pr66199-2.C: Same.
	* testsuite/libgomp.c++/target-2.C: Same.
	* testsuite/libgomp.c++/for-7.C: Use dg-additional-options for
	-std=<standard> option.
	* testsuite/libgomp.c++/udr-11.C: Same.
	* testsuite/libgomp.c++/udr-12.C: Same.
	* testsuite/libgomp.c++/udr-13.C: Same.
	* testsuite/libgomp.c++/udr-14.C: Same.
	* testsuite/libgomp.c++/udr-15.C: Same.
	* testsuite/libgomp.c++/udr-16.C: Same.
	* testsuite/libgomp.c++/udr-17.C: Same.
	* testsuite/libgomp.c++/udr-18.C: Same.
	* testsuite/libgomp.c++/udr-19.C: Same.
	* testsuite/libgomp.c++/atomic-1.C: Remove dg-options "-O2".
	* testsuite/libgomp.c++/simd-1.C: Same.
	* testsuite/libgomp.c++/simd-2.C: Same.
	* testsuite/libgomp.c++/simd-3.C: Same.
	* testsuite/libgomp.c++/simd-4.C: Same.
	* testsuite/libgomp.c++/simd-5.C: Same.
	* testsuite/libgomp.c++/simd-6.C: Same.
	* testsuite/libgomp.c++/simd-7.C: Same.
	* testsuite/libgomp.c++/simd-8.C: Same.
	* testsuite/libgomp.c++/simd-9.C: Same.
	* testsuite/libgomp.c++/simd10.C: Same.
	* testsuite/libgomp.c++/simd11.C: Same.
	* testsuite/libgomp.c++/simd12.C: Same.
	* testsuite/libgomp.c++/simd13.C: Same.

From-SVN: r225181
2015-06-30 12:22:04 +00:00
Jakub Jelinek 3446fe483e re PR middle-end/66702 (#pragma omp declare simd uniform and linear issues)
PR middle-end/66702
	* omp-low.c (simd_clone_adjust): Handle addressable linear
	or uniform parameters or non-gimple type uniform parameters.

	* testsuite/libgomp.c++/pr66702-1.C: New test.
	* testsuite/libgomp.c++/pr66702-2.C: New test.

From-SVN: r225179
2015-06-30 14:12:42 +02:00
Tom de Vries 8a36714a1b Add parloops-exit-first-loop-alt-{5,6,7}.c
2015-06-30  Tom de Vries  <tom@codesourcery.com>

	* gcc.dg/parloops-exit-first-loop-alt-5.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt-6.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt-7.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt.c: Update comment.

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-5.c: New test.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-6.c: New test.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-7.c: New test.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: Update comment.

From-SVN: r225172
2015-06-30 11:00:32 +00:00
Tom de Vries 4f75d60893 Use max_loop_iterations in transform_to_exit_first_loop_alt
2015-06-30  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/66652
	* tree-parloops.c (try_transform_to_exit_first_loop_alt): Use
	max_loop_iterations to determine if nit + 1 overflows.

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c (f): Rewrite
	using restrict pointers.
	(main): Add arguments to calls to f.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: Same.

	* gcc.dg/parloops-exit-first-loop-alt-pr66652.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt-3.c (f):  Rewrite using restrict
	pointers.
	* gcc.dg/parloops-exit-first-loop-alt.c: Same.

From-SVN: r225162
2015-06-30 08:35:57 +00:00
Andreas Tobler 6d9d1eeb97 configure.ac: Fix check for header <sys/sysctl.h>.
2015-06-23  Andreas Tobler  <andreast@gcc.gnu.org>

    * configure.ac: Fix check for header <sys/sysctl.h>.
    * configure: Regenerate.
    * config.h.in: Likewise.

From-SVN: r224855
2015-06-23 19:59:59 +02:00
Tom de Vries 1222f22bd8 Use abort in parloops-exit-first-loop-alt-{3,4}.c
2015-06-23  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c (main): Use
	abort.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c (main): Same.

From-SVN: r224849
2015-06-23 15:02:25 +00:00
Thomas Schwinge bfcd036fbe libgomp: libgomp.oacc-c-c++-common/lib-62.c is for acc_device_nvidia only
libgomp/
	* testsuite/libgomp.oacc-c-c++-common/lib-62.c: Only consider for
	acc_device_nvidia.

From-SVN: r224640
2015-06-19 09:41:44 +02:00
Thomas Schwinge d7efbbf6af libgomp: XFAIL two libgomp.oacc-* tests
PR libgomp/66518
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/lib-3.c: XFAIL.
	* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Likewise.

From-SVN: r224639
2015-06-19 09:41:37 +02:00
Tom de Vries d7bfc710ab Remove dg-options -O2 in libgomp.c
2015-06-15  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/atomic-1.c: Remove dg-options "-O2".  Use
	dg-additional-options for any remaining options.
	* testsuite/libgomp.c/atomic-2.c: Same.
	* testsuite/libgomp.c/atomic-4.c: Same.
	* testsuite/libgomp.c/atomic-5.c: Same.
	* testsuite/libgomp.c/atomic-6.c: Same.
	* testsuite/libgomp.c/autopar-1.c: Same.
	* testsuite/libgomp.c/copyin-1.c: Same.
	* testsuite/libgomp.c/copyin-2.c: Same.
	* testsuite/libgomp.c/copyin-3.c: Same.
	* testsuite/libgomp.c/examples-4/e.53.5.c: Same.
	* testsuite/libgomp.c/nestedfn-5.c: Same.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-2.c: Same.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c: Same.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c: Same.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: Same.
	* testsuite/libgomp.c/pr32362-1.c: Same.
	* testsuite/libgomp.c/pr32362-2.c: Same.
	* testsuite/libgomp.c/pr32362-3.c: Same.
	* testsuite/libgomp.c/pr39591-1.c: Same.
	* testsuite/libgomp.c/pr39591-2.c: Same.
	* testsuite/libgomp.c/pr39591-3.c: Same.
	* testsuite/libgomp.c/pr58392.c: Same.
	* testsuite/libgomp.c/pr58756.c: Same.
	* testsuite/libgomp.c/simd-1.c: Same.
	* testsuite/libgomp.c/simd-10.c: Same.
	* testsuite/libgomp.c/simd-11.c: Same.
	* testsuite/libgomp.c/simd-12.c: Same.
	* testsuite/libgomp.c/simd-13.c: Same.
	* testsuite/libgomp.c/simd-14.c: Same.
	* testsuite/libgomp.c/simd-15.c: Same.
	* testsuite/libgomp.c/simd-2.c: Same.
	* testsuite/libgomp.c/simd-3.c: Same.
	* testsuite/libgomp.c/simd-4.c: Same.
	* testsuite/libgomp.c/simd-5.c: Same.
	* testsuite/libgomp.c/simd-6.c: Same.
	* testsuite/libgomp.c/simd-7.c: Same.
	* testsuite/libgomp.c/simd-8.c: Same.
	* testsuite/libgomp.c/simd-9.c: Same.

From-SVN: r224489
2015-06-15 18:10:51 +00:00
Tom de Vries fb5b535246 Fix typo in libgomp/testsuite/libgomp.c/pr35625.c
2015-06-15  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/pr35625.c: Fix typo.

From-SVN: r224483
2015-06-15 13:57:04 +00:00
Tom de Vries ca431befaa Remove -fopenmp in dg-options in libgomp.c
2015-06-15  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/atomic-18.c: Remove superfluous -fopenmp setting
	in dg-options.
	* testsuite/libgomp.c/atomic-3.c: Same.
	* testsuite/libgomp.c/debug-1.c: Same.
	* testsuite/libgomp.c/nqueens-1.c: Same.
	* testsuite/libgomp.c/pr26171.c: Same.
	* testsuite/libgomp.c/pr48591.c: Same.
	* testsuite/libgomp.c/pr64824.c: Same.
	* testsuite/libgomp.c/pr64868.c: Same.
	* testsuite/libgomp.c/pr66133.c: Same.
	* testsuite/libgomp.c/pr66199-1.c: Same.
	* testsuite/libgomp.c/pr66199-2.c: Same.
	* testsuite/libgomp.c/target-8.c: Same.

From-SVN: r224480
2015-06-15 13:26:12 +00:00
Tom de Vries 0d8a9e2065 Use dg-additional-options for -std={gnu99,c99}
2015-06-15  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/collapse-3.c: Use dg-additional-options for
	-std={gnu99,c99}.
	* testsuite/libgomp.c/for-1.c: Same.
	* testsuite/libgomp.c/for-2.c: Same.
	* testsuite/libgomp.c/for-3.c: Same.
	* testsuite/libgomp.c/pr35625.c: Same.
	* testsuite/libgomp.c/pr39154.c: Same.
	* testsuite/libgomp.c/simd-16.c: Same.
	* testsuite/libgomp.c/simd-17.c: Same.

From-SVN: r224479
2015-06-15 13:26:03 +00:00
Tom de Vries a6860be9c8 Add gcc.dg/parloops-exit-first-loop-alt-4.c
2015-06-13  Tom de Vries  <tom@codesourcery.com>

	* gcc.dg/parloops-exit-first-loop-alt-4.c: New test.

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c: New test.

From-SVN: r224453
2015-06-13 08:05:54 +00:00
Tom de Vries ab3306d23c Update parloops-exit-first-loop-alt{,-2,-3}.c
2015-06-13  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-2.c: Add comment.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: Same.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c: Add comment.
	(N): Define.
	(main): Use N instead of hardcoded constants.

	* gcc.dg/parloops-exit-first-loop-alt-2.c: Add comment.
	(main): Remove superfluous attributes.
	* gcc.dg/parloops-exit-first-loop-alt-3.c: Same.
	* gcc.dg/parloops-exit-first-loop-alt.c: Same.

From-SVN: r224452
2015-06-13 08:05:44 +00:00
Tom de Vries 7c82d82716 Add transform_to_exit_first_loop_alt
2015-06-05  Tom de Vries  <tom@codesourcery.com>

	merge from gomp4 branch:
	2015-05-28  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/65443
	* tree-parloops.c (replace_imm_uses, replace_uses_in_bb_by)
	(replace_uses_in_bbs_by, transform_to_exit_first_loop_alt)
	(try_transform_to_exit_first_loop_alt): New function.
	(transform_to_exit_first_loop): Use
	try_transform_to_exit_first_loop_alt.

	* gcc.dg/parloops-exit-first-loop-alt-2.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt-3.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt.c: New test.

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-2.c: New test.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c: New test.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: New test.

From-SVN: r224154
2015-06-05 15:57:34 +00:00
Uros Bizjak 6aa54a8b25 futex.h (futex_wait): Remove doouble initialization.
* config/linux/x86/futex.h (futex_wait) [__x86_64__]:
	Remove doouble initialization.

From-SVN: r224150
2015-06-05 12:56:14 +02:00
Bernhard Reutner-Fischer c469078de7 testsuite: auto-wipe dump files
gcc/testsuite/ChangeLog

2015-05-29  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* lib/gcc-dg.exp (cleanup-ipa-dump, cleanup-rtl-dump,
	cleanup-tree-dump, cleanup-dump, cleanup-saved-temps): Remove.
	Adjust all callers.
	(schedule-cleanups, dg-keep-saved-temps): New proc.
	(gcc-dg-test-1): Schedule cleanups.
	* lib/profopt.exp (profopt-execute): Likewise.
	* g++.dg/cdce3.C: Adjust expected line numbers.
	* gcc.dg/cdce1.c: Likewise.
	* gcc.dg/cdce2.c: Likewise.
	* gcc.dg/strlenopt-22.c: Fix comment delimiter.
	* gcc.dg/strlenopt-24.c: Likewise.
	* gcc.dg/tree-ssa/vrp26.c: Likewise.
	* gcc.dg/tree-ssa/vrp28.c: Likewise.
	* obj-c++.dg/encode-2.mm: Likewise.

libgomp/ChangeLog

2015-05-29  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* testsuite/libgomp.graphite/bounds.c: Adjust for
	cleanup-tree-dump removal.
	* testsuite/libgomp.graphite/force-parallel-1.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-2.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-3.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-4.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-5.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-6.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-7.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-8.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-9.c: Likewise.
	* testsuite/libgomp.graphite/pr41118.c: Likewise.


gcc/ChangeLog

2015-05-29  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* config/arm/neon-testgen.ml (emit_epilogue): Remove manual call
	to cleanup-saved-temps.
	* doc/sourcebuild.texi (Clean up generated test files): Expand
	introduction.
	(dg-keep-saved-temps): Document new proc.
	(cleanup-ipa-dump, cleanup-rtl-dump, cleanup-tree-dump,
	cleanup-saved-temps): Remove.

From-SVN: r223858
2015-05-29 10:20:29 +02:00
Uros Bizjak bb3caa3577 futex.h (sys_futex0): Remove function.
* config/linux/x86/futex.h (sys_futex0) [!__x86_64__]: Remove function.
	(futex_wait) [!__x86_64__]: Use __asm operand instead of sys_futex0.
	(futex_wake) [!__x86_64__]: Ditto.

From-SVN: r223821
2015-05-28 15:59:17 +02:00
Julian Brown 9fb5fd444b oacc-init.c (resolve_device): Add FAIL_IS_ERROR argument.
* oacc-init.c (resolve_device): Add FAIL_IS_ERROR argument. Update
	function comment. Only call gomp_fatal if new argument is true.
	(acc_dev_num_out_of_range): New function.
	(acc_init_1, acc_shutdown_1): Update call to resolve_device. Call
	acc_dev_num_out_of_range as appropriate.
	(acc_get_num_devices, acc_set_device_type, acc_get_device_type)
	(acc_get_device_num, acc_set_device_num): Update calls to resolve_device.
	* testsuite/libgomp.oacc-c-c++-common/lib-4.c: Update expected test
	output.

From-SVN: r223803
2015-05-28 10:35:39 +00:00
Julian Brown 32eaed9380 re PR libgomp/65742 (Several libgomp.oacc-* failures after r221922.)
PR libgomp/65742

    gcc/
    * builtins.c (expand_builtin_acc_on_device): Don't use open-coded
    sequence for !ACCEL_COMPILER.

    libgomp/
    * oacc-init.c (plugin/plugin-host.h): Include.
    (acc_on_device): Check whether we're in an offloaded region for
    host_nonshm
    plugin. Don't use __builtin_acc_on_device.
    * plugin/plugin-host.c (GOMP_OFFLOAD_openacc_parallel): Set
    nonshm_exec flag in thread-local data.
    (GOMP_OFFLOAD_openacc_create_thread_data): Allocate thread-local
    data for host_nonshm plugin.
    (GOMP_OFFLOAD_openacc_destroy_thread_data): Free thread-local data
    for host_nonshm plugin.
    * plugin/plugin-host.h: New.

From-SVN: r223801
2015-05-28 09:29:19 +00:00
Uros Bizjak 8ed501f167 wait.h (gomp_futex_wait, [...]): Declare as int.
2015-05-27  Uros Bizjak  <ubizjak@gmail.com>

	* config/linux/wait.h (gomp_futex_wait, gomp_futex_wake):
	Declare as int.
	(FUTEX_PRIVATE_FLAG): Remove L suffix.
	* config/linux/mutex.c (gomp_futex_wait, gomp_futex_wake):
	Declare as int.

2015-05-27  Uros Bizjak  <ubizjak@gmail.com>

	* config/linux/ia64/futex.h (sys_futex0) Change operand "op" to int.

2015-05-27  Uros Bizjak  <ubizjak@gmail.com>

	Revert:
	* config/linux/x86/futex.h (sys_futex0) [!__x86_64__]:
	Change operand "op" to long.

From-SVN: r223780
2015-05-27 23:07:09 +02:00
Uros Bizjak ea023bcfd8 futex.h (sys_futex0): Change operand "op" to long.
libgomp/ChangeLog:

	* config/linux/x86/futex.h (sys_futex0) [!__x86_64__]:
	Change operand "op" to long.
	[__PIC__]: Remove sys_futex0 function.

libitm/ChangeLog:

	* config/linux/x86/futex_bits.h (sys_futex0) [!__x86_64__]:
	Change operand "op" to long.
	[__PIC__]: Remove sys_futex0 function.

From-SVN: r223771
2015-05-27 21:35:58 +02:00
Chung-Lin Tang 1716efeb6d target.c (gomp_map_pointer): New function abstracting out GOMP_MAP_POINTER handling.
2015-05-27  Chung-Lin Tang  <cltang@codesourcery.com>

	libgomp/
	* target.c (gomp_map_pointer): New function abstracting out
	GOMP_MAP_POINTER handling.
	(gomp_map_vars): Remove GOMP_MAP_POINTER handling code and use
	gomp_map_pointer().

From-SVN: r223737
2015-05-27 06:16:37 +00:00
Jakub Jelinek 41b37d5ec1 re PR middle-end/66199 (lastprivate/linear clause issues on combined constructs)
PR middle-end/66199
	* tree.h (OMP_TEAMS_COMBINED): Define.
	* gimplify.c (enum gimplify_omp_var_data): Add
	GOVD_LINEAR_LASTPRIVATE_NO_OUTER.
	(enum omp_region_type): Add ORT_COMBINED_TEAMS.
	(omp_notice_variable): Accept both ORT_TEAMS
	and ORT_COMBINED_TEAMS.  Don't recurse if
	GOVD_LINEAR_LASTPRIVATE_NO_OUTER is set and either
	GOVD_LINEAR is set, or GOVD_LASTPRIVATE without
	GOVD_FIRSTPRIVATE.
	(omp_no_lastprivate): New function.
	(gimplify_scan_omp_clauses): For OMP_CLAUSE_LASTPRIVATE
	and OMP_CLAUSE_LINEAR, if omp_no_lastprivate, don't
	notice_outer and set appropriate bits, otherwise make
	sure default(none) combined constructs won't complain.
	(gimplify_adjust_omp_clauses): Remove OMP_CLAUSE_LINEAR
	outer special casing, for OMP_CLAUSE_LASTPRIVATE if
	omp_no_lastprivate either remove the clause or turn it
	into OMP_CLAUSE_PRIVATE.
	(gimplify_omp_for): Fix up handling of implicit
	lastprivate or linear iterators.
	(gimplify_omp_workshare): For OMP_TEAMS_COMBINED use
	ORT_COMBINED_TEAMS.
	* omp-low.c (lower_omp_for_lastprivate): For combined
	for simd use fd.loop.n2 from the for rather than simd.
gcc/c/
	* c-parser.c (c_parser_omp_for_loop): Don't add
	OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
	OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
	(c_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
	constructs.
gcc/cp/
	* parser.c (cp_parser_omp_for_loop): Don't add
	OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
	OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
	(cp_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
	constructs.
gcc/fortran/
	* trans-openmp.c (gfc_trans_omp_teams): Set OMP_TEAMS_COMBINED for
	combined constructs.
	(gfc_trans_omp_target): Make sure BIND_EXPR has non-NULL
	BIND_EXPR_BLOCK.
libgomp/
	* testsuite/libgomp.c/pr66199-1.c: New test.
	* testsuite/libgomp.c/pr66199-2.c: New test.
	* testsuite/libgomp.c++/pr66199-1.C: New test.
	* testsuite/libgomp.c++/pr66199-2.C: New test.
	* testsuite/libgomp.fortran/pr66199-1.f90: New test.
	* testsuite/libgomp.fortran/pr66199-2.f90: New test.

From-SVN: r223387
2015-05-19 18:16:15 +02:00
Julian Brown c831982647 plugin-nvptx.c (nvptx_get_num_devices): Return zero on cuInit failure.
* plugin/plugin-nvptx.c (nvptx_get_num_devices): Return zero
	on cuInit failure.

From-SVN: r223352
2015-05-19 11:06:31 +00:00
Jakub Jelinek b37dddbc77 re PR middle-end/66133 (Wrong-code with noreturn #pragma omp task body)
PR middle-end/66133
	* omp-low.c (expand_omp_taskreg): For GIMPLE_OMP_TASK expansion,
	make sure it is never noreturn, even when the task body does not
	return.
	(lower_omp_taskreg): For GIMPLE_OMP_TASK, emit GIMPLE_OMP_CONTINUE
	right before GIMPLE_OMP_RETURN.
	(make_gimple_omp_edges): Accept GIMPLE_OMP_CONTINUE as ->cont
	for GIMPLE_OMP_TASK.  For GIMPLE_OMP_RETURN corresponding to
	GIMPLE_OMP_TASK add an EDGE_ABNORMAL edge from entry to exit.

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

From-SVN: r223171
2015-05-13 18:59:20 +02:00
Michael Haubenwallner 55fba60115 libgomp: Bump to automake 1.11.6
2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>

	* Makefile.in: Regenerated with automake-1.11.6.
	* aclocal.m4: Likewise.
	* config.h.in: Likewise.
	* configure: Likewise.
	* testsuite/Makefile.in: Likewise.

From-SVN: r223143
2015-05-13 11:24:38 +00:00
Jason Merrill 1be0899d94 openacc.h (__GOACC_NOTHROW): Fix noexcept syntax.
* openacc.h (__GOACC_NOTHROW): Fix noexcept syntax.

	* testsuite/libgomp.oacc-c-c++-common/reduction-4.c (main): Use
	_Complex.

From-SVN: r222966
2015-05-09 00:50:35 -04:00
Julian Brown d2463960a4 oacc-init.c (acc_device_lock): Add explanatory comment.
* oacc-init.c (acc_device_lock): Add explanatory comment.
	(resolve_device): Add comment about locking requirement.
	(acc_init_1, acc_shutdown_1): Likewise. Add locking around
	gomp_init_device and gomp_fini_device calls.
	(acc_get_num_devices, acc_set_device_type, acc_get_device_type)
	(acc_get_device_num, acc_set_device_num): Add locking around
	resolve_device and gomp_init_device calls.

From-SVN: r222862
2015-05-06 19:10:14 +00:00
Julian Brown e38fdba42b oacc-init.c (acc_shutdown_1): Call gomp_mutex_unlock for goacc_thread_lock on error paths.
* oacc-init.c (acc_shutdown_1): Call gomp_mutex_unlock for
	goacc_thread_lock on error paths.
	* oacc-mem.c (lookup_host): Remove locking from function. Note
	locking requirement for caller in function comment.
	(lookup_dev): Likewise.
	(acc_free, acc_deviceptr, acc_hostptr, acc_is_present)
	(acc_map_data, acc_unmap_data, present_create_copy, delete_copyout)
	(update_dev_host, gomp_acc_insert_pointer, gomp_acc_remove_pointer):
	Add locking.

From-SVN: r222860
2015-05-06 16:45:49 +00:00
Thomas Schwinge ae8ffbbb8d [PR testsuite/65205, libgomp/65993] Fix dg-shouldfail usage in OpenACC libgomp tests
In dg-output, don't expect "0x" prefix for "%p" format specifier, don't expect
"(nil)" for NULL pointer.

	PR testsuite/65205
	PR libgomp/65993
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/clauses-2.c: In dg-output,
	don't expect "0x" prefix for "%p" format specifier, don't expect
	"(nil)" for NULL pointer.
	* testsuite/libgomp.oacc-c-c++-common/lib-16.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-17.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-18.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-20.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-21.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-22.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-23.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-25.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-26.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-27.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-28.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-29.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-30.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-34.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-35.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-36.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-39.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-40.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-43.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-44.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-47.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-48.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-52.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-53.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-54.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-57.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-58.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-1.c: More
	accurately specify what we're looking for.
	* testsuite/libgomp.oacc-c-c++-common/data-already-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-8.c: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-8.f: Likewise.

From-SVN: r222799
2015-05-05 11:39:29 +02:00
James Norris 1309f1d25b [PR testsuite/65205] Fix dg-shouldfail usage in OpenACC libgomp tests
PR testsuite/65205
	libgomp/
	* testsuite/lib/libgomp.exp
	(check_effective_target_openacc_host_selected)
	(check_effective_target_openacc_host_nonshm_selected): New
	procedures.
	* testsuite/libgomp.oacc-c-c++-common/clauses-2.c: Fix misuse of
	dg-shouldfail.
	* testsuite/libgomp.oacc-c-c++-common/lib-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-11.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-16.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-17.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-18.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-20.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-21.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-22.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-23.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-25.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-26.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-27.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-28.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-29.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-30.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-34.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-35.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-36.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-39.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-40.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-43.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-44.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-47.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-48.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-52.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-53.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-54.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-57.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-58.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-62.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-63.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-64.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-65.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-67.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-68.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-71.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-77.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-80.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/present-1.c: Likewise.

From-SVN: r222620
2015-04-30 14:44:39 +02:00
Julian Brown d93bdab53b mkoffload.c (process): Support variable mapping.
gcc/
	* config/nvptx/mkoffload.c (process): Support variable mapping.

	libgomp/
	* libgomp.h (target_mem_desc: Remove mem_map field.
	(acc_dispatch_t): Remove open_device_func, close_device_func,
	get_device_num_func, set_device_num_func, target_data members.
	Change create_thread_data_func argument to device number instead of
	generic pointer.
	* oacc-async.c (assert.h): Include.
	(acc_async_test, acc_async_test_all, acc_wait, acc_wait_async)
	(acc_wait_all, acc_wait_all_async): Use current host thread's
	active device, not base_dev.
	* oacc-cuda.c (acc_get_current_cuda_device)
	(acc_get_current_cuda_context, acc_get_cuda_stream)
	(acc_set_cuda_stream): Likewise.
	* oacc-host.c (host_dispatch): Don't set open_device_func,
	close_device_func, get_device_num_func or set_device_num_func.
	* oacc-init.c (base_dev, init_key): Remove.
	(cached_base_dev): New.
	(name_of_acc_device_t): New.
	(acc_init_1): Initialise default-numbered device, not zeroth.
	(acc_shutdown_1): Close all devices of a given type.
	(goacc_destroy_thread): Don't use base_dev.
	(lazy_open, lazy_init, lazy_init_and_open): Remove.
	(goacc_attach_host_thread_to_device): New.
	(acc_init): Reimplement with goacc_attach_host_thread_to_device.
	(acc_get_num_devices): Don't use base_dev.
	(acc_set_device_type): Reimplement.
	(acc_get_device_type): Don't use base_dev.
	(acc_get_device_num): Tweak logic.
	(acc_set_device_num): Likewise.
	(acc_on_device): Use acc_get_device_type.
	(goacc_runtime_initialize): Initialize cached_base_dev not base_dev.
	(goacc_lazy_initialize): Reimplement with acc_init and
	goacc_attach_host_thread_to_device.
	* oacc-int.h (goacc_thread): Add base_dev field.
	(base_dev): Remove extern declaration.
	(goacc_attach_host_thread_to_device): Add prototype.
	* oacc-mem.c (acc_malloc): Use current thread's device instead of
	base_dev.
	(acc_free): Likewise.
	(acc_memcpy_to_device): Likewise.
	(acc_memcpy_from_device): Likewise.
	* oacc-parallel.c (select_acc_device): Remove. Replace calls with
	goacc_lazy_initialize (throughout).
	(GOACC_parallel): Use tgt_offset to locate target functions.
	* target.c (gomp_map_vars): Don't set tgt->mem_map.
	(gomp_unmap_vars): Use devicep->mem_map pointer not tgt->mem_map.
	(gomp_load_plugin_for_device): Remove open_device, close_device,
	get_device_num, set_device_num openacc hook initialisation. Don't set
	openacc.target_data.
	* plugin/plugin-host.c (GOMP_OFFLOAD_openacc_open_device)
	(GOMP_OFFLOAD_openacc_close_device)
	(GOMP_OFFLOAD_openacc_get_device_num)
	(GOMP_OFFLOAD_openacc_set_device_num): Remove.
	(GOMP_OFFLOAD_openacc_create_thread_data): Change (unused) argument
	to int.
	* plugin/plugin-nvptx.c (ptx_inited): Remove.
	(instantiated_devices, ptx_dev_lock): New.
	(struct ptx_image_data): New.
	(ptx_devices, ptx_images, ptx_image_lock): New.
	(fini_streams_for_device): Reorder cuStreamDestroy call.
	(nvptx_get_num_devices): Remove forward declaration.
	(nvptx_init): Change return type to bool.
	(nvptx_fini): Remove.
	(nvptx_attach_host_thread_to_device): New.
	(nvptx_open_device): Return struct ptx_device* instead of void*.
	(nvptx_close_device): Change argument type to struct ptx_device*,
	return type to void.
	(nvptx_get_num_devices): Use instantiated_devices not ptx_inited.
	(kernel_target_data, kernel_host_table): Remove static globals.
	(GOMP_OFFLOAD_register_image, GOMP_OFFLOAD_get_table): Remove.
	(GOMP_OFFLOAD_init_device): Reimplement.
	(GOMP_OFFLOAD_fini_device): Likewise.
	(GOMP_OFFLOAD_load_image, GOMP_OFFLOAD_unload_image): New.
	(GOMP_OFFLOAD_alloc, GOMP_OFFLOAD_free, GOMP_OFFLOAD_dev2host)
	(GOMP_OFFLOAD_host2dev): Use ORD argument.
	(GOMP_OFFLOAD_openacc_open_device)
	(GOMP_OFFLOAD_openacc_close_device)
	(GOMP_OFFLOAD_openacc_set_device_num)
	(GOMP_OFFLOAD_openacc_get_device_num): Remove.
	(GOMP_OFFLOAD_openacc_create_thread_data): Change argument to int
	(device number).

	libgomp/testsuite/
	* libgomp.oacc-c-c++-common/lib-9.c: Fix devnum check in test.

From-SVN: r221922
2015-04-08 15:58:33 +00:00
Ilya Verbin a51df54e48 libgomp: rework initialization of offloading
gcc/
	* config/i386/intelmic-mkoffload.c (generate_host_descr_file): Call
	GOMP_offload_unregister from the destructor.
libgomp/
	* libgomp-plugin.h (struct mapping_table): Replace with addr_pair.
	* libgomp.h (struct gomp_memory_mapping): Remove.
	(struct target_mem_desc): Change type of mem_map from
	gomp_memory_mapping * to splay_tree_s *.
	(struct gomp_device_descr): Remove register_image_func, get_table_func.
	Add load_image_func, unload_image_func.
	Change type of mem_map from gomp_memory_mapping to splay_tree_s.
	Remove offload_regions_registered.
	(gomp_init_tables): Remove.
	(gomp_free_memmap): Change type of argument from gomp_memory_mapping *
	to splay_tree_s *.
	* libgomp.map (GOMP_4.0.1): Add GOMP_offload_unregister.
	* oacc-host.c (host_dispatch): Do not initialize register_image_func,
	get_table_func, mem_map.is_initialized, mem_map.splay_tree.root,
	offload_regions_registered.
	Initialize load_image_func, unload_image_func, mem_map.root.
	(goacc_host_init): Do not initialize host_dispatch.mem_map.lock.
	* oacc-init.c (lazy_open): Don't call gomp_init_tables.
	(acc_shutdown_1): Use dev's lock and splay_tree instead of mem_map's.
	* oacc-mem.c (lookup_host): Get gomp_device_descr *dev instead of
	gomp_memory_mapping *.  Use dev's lock and splay_tree.
	(lookup_dev): Use dev's lock.
	(acc_deviceptr): Pass dev to lookup_host instead of mem_map.
	(acc_is_present): Likewise.
	(acc_map_data): Likewise.
	(acc_unmap_data): Likewise.  Use dev's lock.
	(present_create_copy): Likewise.
	(delete_copyout): Pass dev to lookup_host instead of mem_map.
	(update_dev_host): Likewise.
	(gomp_acc_remove_pointer): Likewise.  Use dev's lock.
	* oacc-parallel.c (GOACC_parallel): Use dev's lock and splay_tree.
	* plugin/plugin-host.c (GOMP_OFFLOAD_register_image): Remove.
	(GOMP_OFFLOAD_get_table): Remove
	(GOMP_OFFLOAD_load_image): New function.
	(GOMP_OFFLOAD_unload_image): New function.
	* target.c (register_lock): New mutex for offload image registration.
	(num_devices): Do not guard with PLUGIN_SUPPORT.
	(gomp_realloc_unlock): New static function.
	(gomp_map_vars_existing): Add device descriptor argument.  Unlock mutex
	before gomp_fatal.
	(gomp_map_vars): Use dev's lock and splay_tree instead of mem_map's.
	Pass devicep to gomp_map_vars_existing.  Unlock mutex before gomp_fatal.
	(gomp_copy_from_async): Use dev's lock and splay_tree instead of
	mem_map's.
	(gomp_unmap_vars): Likewise.
	(gomp_update): Remove gomp_memory_mapping argument.  Use dev's lock and
	splay_tree instead of mm's.  Unlock mutex before gomp_fatal.
	(gomp_offload_image_to_device): New static function.
	(GOMP_offload_register): Add mutex lock.
	Call gomp_offload_image_to_device for all initialized devices.
	Replace gomp_realloc with gomp_realloc_unlock.
	(GOMP_offload_unregister): New function.
	(gomp_init_tables): Replace with gomp_init_device.  Replace a call to
	get_table_func from the plugin with calls to init_device_func and
	gomp_offload_image_to_device.
	(gomp_free_memmap): Change type of argument from gomp_memory_mapping *
	to splay_tree_s *.
	(GOMP_target): Do not call gomp_init_tables.  Use dev's lock and
	splay_tree instead of mem_map's.  Unlock mutex before gomp_fatal.
	(GOMP_target_data): Do not call gomp_init_tables.
	(GOMP_target_update): Likewise.  Remove argument from gomp_update.
	(gomp_load_plugin_for_device): Replace register_image and get_table
	with load_image and unload_image in DLSYM ().
	(gomp_register_images_for_device): Remove function.
	(gomp_target_init): Do not initialize current_device.mem_map.*,
	current_device.offload_regions_registered.
	Remove call to gomp_register_images_for_device.
	Do not free offload_images and num_offload_images.
liboffloadmic/
	* plugin/libgomp-plugin-intelmic.cpp: Include map.
	(AddrVect, DevAddrVect, ImgDevAddrMap): New typedefs.
	(num_devices, num_images, address_table): New static vars.
	(num_libraries, lib_descrs): Remove static vars.
	(set_mic_lib_path): Rename to ...
	(init): ... this.  Allocate address_table and get num_devices.
	(GOMP_OFFLOAD_get_num_devices): return num_devices.
	(load_lib_and_get_table): Remove static function.
	(offload_image): New static function.
	(GOMP_OFFLOAD_get_table): Remove function.
	(GOMP_OFFLOAD_load_image, GOMP_OFFLOAD_unload_image): New functions.

From-SVN: r221878
2015-04-06 12:40:28 +00:00
Jakub Jelinek 6c384511a3 re PR middle-end/65597 (ICE in build_outer_var_ref, at omp-low.c:1043)
PR fortran/65597
	* trans-openmp.c (gfc_trans_omp_do): For !simple simd with explicit
	linear clause for the iterator set OMP_CLAUSE_LINEAR_NO_COPYIN.
	For implcitly added !simple OMP_CLAUSE_LINEAR set it too.  Use step 1
	instead of the original step on the new iterator - count.

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

From-SVN: r221776
2015-03-30 19:54:05 +02:00
Tom de Vries 3e8165a5df Add verification to libgomp.graphite/force-parallel-6.c
2015-03-27  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/65594
	* testsuite/libgomp.graphite/force-parallel-6.c (abort): Declare.
	(init, check): New function.
	(foo): Change return type to void.
	(main): Call init and check.

From-SVN: r221728
2015-03-27 12:10:16 +00:00
Tom de Vries 4d688c9a17 Scale down libgomp.graphite/force-parallel-6.c
2015-03-27  Tom de Vries  <tom@codesourcery.com>

	PR testsuite/65594
	* testsuite/libgomp.graphite/force-parallel-6.c (M): Define.
	(foo): Use M for non-inner loops to scale down test-case.

From-SVN: r221727
2015-03-27 12:10:07 +00:00
Kai Tietz 01c0b3b076 re PR libgomp/64972 (Build failure in libgomp for i686-w64-mingw32 target after latest merge from gomp-4_0-branch)
PR libgomp/64972
	* oacc-parallel.c (GOACC_parallel): Use PRIu64 if available.
	(GOACC_data_start): Likewise.
	* target.c (gomp_map_vars): Likewise.

From-SVN: r221665
2015-03-25 16:05:02 +01:00
John David Anglin 844d9a76bc reduction-4.c: Don't run on hppa*-*-hpux*.
* testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Don't run on
	hppa*-*-hpux*.

From-SVN: r221557
2015-03-21 16:19:43 +00:00
Jakub Jelinek 9b65e171ed c-decl.c (c_decl_attributes): Also add "omp declare target" attribute for DECL_EXTERNAL VAR_DECLs.
* c-decl.c (c_decl_attributes): Also add "omp declare target"
	attribute for DECL_EXTERNAL VAR_DECLs.

	* decl2.c (cplus_decl_attributes): Also add "omp declare target"
	attribute for DECL_EXTERNAL VAR_DECLs.

	* testsuite/libgomp.c/target-10.c: New test.
	* testsuite/libgomp.c++/target-4.C: New test.

From-SVN: r221520
2015-03-19 20:12:43 +01:00
Ilya Verbin db397e2e5a varpool.c (varpool_node::get_create): Don't set 'offloadable' flag for the external decls.
gcc/
	* varpool.c (varpool_node::get_create): Don't set 'offloadable' flag for
	the external decls.
libgomp/
	* testsuite/libgomp.fortran/declare-target-1.f90: New test.
	* testsuite/libgomp.fortran/declare-target-2.f90: New file.

From-SVN: r221421
2015-03-13 13:30:26 +00:00
Sebastian Huber cd93945d03 libgomp: Add RTEMS support
libgomp/ChangeLog

	* configure.tgt (*-*-rtems*): Use local-exec TLS model.
	* configure.ac (*-*-rtems*): Assume Pthread is supported.
	(pthread.h): Check for this header file.
	* configure: Regenerate.

From-SVN: r221415
2015-03-13 10:57:07 +00:00
Tom de Vries 05deba9fe0 Use DO_PRAGMA in libgomp.oacc-c-c++-common/reduction-1.c
2015-02-25  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c-c++-common/reduction-1.c (DO_PRAGMA)
	(check_reduction_op, check_reduction_macro, max, min):
	Declare.
	(test_reductions_int, test_reductions_minmax, test_reductions_bool): New
	function.
	(main): Use new functions.

From-SVN: r220971
2015-02-25 15:38:38 +00:00
Ilya Tocar 196904d813 target.c (gomp_load_plugin_for_device): Use const char * instead of char * for variables holding dlerror return values.
libgomp/

* target.c (gomp_load_plugin_for_device): Use const char * instead of
char * for variables holding dlerror return values.
(DLSYM_OPT): Ditto.

From-SVN: r220789
2015-02-18 16:33:43 +03:00
Thomas Schwinge a2818955d7 libgomp: Make GOMP_PLUGIN_debug actually work...
libgomp/
	* libgomp-plugin.c (GOMP_PLUGIN_debug): Fix typo.

From-SVN: r220770
2015-02-17 19:24:07 +01:00
Thomas Schwinge 26f9331258 libgomp: Make nvptx helper routines self-contained.
libgomp/
	* oacc-ptx.h (GOACC_INTERNAL_PTX): Add GOACC_tid, GOACC_ntid,
	GOACC_ctaid, and GOACC_nctaid routines.

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

From-SVN: r220768
2015-02-17 19:05:24 +01:00
Jakub Jelinek fa01ffccc7 re PR middle-end/64824 (ICE in gimple verification)
PR c/64824
	* c-parser.c (c_parser_binary_expression): Fix OpenMP stack[sp].prec
	check in the POP macro.

	* testsuite/libgomp.c/atomic-18.c: New test.
	* testsuite/libgomp.c++/atomic-16.C: New test.

From-SVN: r220617
2015-02-11 14:40:31 +01:00
Jakub Jelinek 4886ec8e70 re PR middle-end/64824 (ICE in gimple verification)
PR c/64824
	PR c/64868
gcc/c/
	* c-parser.c (c_parser_omp_atomic): Handle RDIV_EXPR.
gcc/cp/
	* parser.c (cp_parser_omp_atomic): Handle RDIV_EXPR.
gcc/c-family/
	* c-omp.c (c_finish_omp_atomic): Use TRUNC_DIV_EXPR
	instead of RDIV_EXPR.  Use build_binary_op instead of
	build2_loc.
libgomp/
	* testsuite/libgomp.c/pr64824.c: New test.
	* testsuite/libgomp.c/pr64868.c: New test.
	* testsuite/libgomp.c++/pr64824.C: New test.
	* testsuite/libgomp.c++/pr64868.C: New test.

From-SVN: r220420
2015-02-04 23:32:36 +01:00
David Edelsohn 02d3e45e7a re PR libgomp/64635 (darwin produces libgomp-plugin-host_nonshm.1.dylib but tries to load libgomp-plugin-host_nonshm.so.1)
PR libgomp/64635
        * configure.tgt (*-*-aix*): Use standard posix plugin-suffix.h.
        Link with -lpthread.
        * config/aix/plugin-suffix.h: Delete.

From-SVN: r220341
2015-02-01 22:31:31 -05:00
Jack Howarth 2dde0c3197 re PR libgomp/64635 (darwin produces libgomp-plugin-host_nonshm.1.dylib but tries to load libgomp-plugin-host_nonshm.so.1)
2015-01-28  Jack Howarth  <howarth.at.gcc@gmail.com>

	PR libgomp/64635
	* configure.tgt (*-*-aix*): Use config_path "aix posix".
	(*-*-darwin*): Use config_path "bsd darwin posix".
	(*-*-hpux*): Use config_path "hpux posix".
	* target.c: Add include of plugin-suffix.h and use
	SONAME_SUFFIX macro.
	* config/aix/plugin-suffix.h: New file.
	* config/darwin/plugin-suffix.h: New file.
	* config/hpux/plugin-suffix.h: New file.
	* config/posix/plugin-suffix.h: New file.

From-SVN: r220220
2015-01-28 21:25:19 +00:00
Jack Howarth b5f7a6ca5c re PR libgomp/64635 (darwin produces libgomp-plugin-host_nonshm.1.dylib but tries to load libgomp-plugin-host_nonshm.so.1)
2015-01-28  Jack Howarth  <howarth.at.gcc@gmail.com>

	PR libgomp/64635
	* configure.tgt (*-*-aix*): Use config_path "aix posix".
	(*-*-darwin*): Use config_path "bsd darwin posix".
	(*-*-hpux*): Use config_path "hpux posix".
	* target.c: Add include of plugin-suffix.h and use
	SONAME_SUFFIX macro.
	* config/aix/plugin-suffix.h: New file.
	* config/darwin/plugin-suffix.h: New file.
	* config/hpux/plugin-suffix.h: New file.
	* config/posix/plugin-suffix.h: New file.

From-SVN: r220218
2015-01-28 21:23:14 +00:00
Jakub Jelinek b891044723 re PR middle-end/64734 (ICE at omp lowering)
PR middle-end/64734
	* omp-low.c (scan_sharing_clauses): Don't ignore
	OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION GOMP_MAP_POINTER clauses
	on target data/update constructs.

	* libgomp.c/pr64734.c: New test.

From-SVN: r220053
2015-01-23 19:19:50 +01:00
Tom de Vries a0c88d0629 Make fopenacc an LTO option
2015-01-23  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/64672
	* lto-opts.c (lto_write_options): Output non-explicit conservative
	-fno-openacc.
	* lto-wrapper.c (merge_and_complain): Handle merging -fopenacc.
	(append_compiler_options): Pass -fopenacc through.

	* c.opt (fopenacc): Mark as LTO option.

	* lang.opt (fopenacc): Mark as LTO option.

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

From-SVN: r220038
2015-01-23 12:54:16 +00:00
Tom de Vries 1506ae0e1e Make fopenmp an LTO option
2015-01-23  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/64707
	* lto-opts.c (lto_write_options): Output non-explicit conservative
	-fno-openmp.
	* lto-wrapper.c (merge_and_complain): Handle merging -fopenmp.
	(append_compiler_options): Pass -fopenmp through.

	* c.opt (fopenmp): Mark as LTO option.

	* lang.opt (fopenmp): Mark as LTO option.

	* testsuite/libgomp.c/target-9.c: Add -ftree-parallelize-loops=0 to
	dg-options.

From-SVN: r220037
2015-01-23 12:53:55 +00:00
Thomas Schwinge bed62c21fa [PR libgomp/64625] Remove __OFFLOAD_TABLE__ variable/formal parameter.
gcc/
	* omp-low.c (offload_symbol_decl): Remove variable.
	(get_offload_symbol_decl): Remove function.
	(expand_omp_target): For BUILT_IN_GOMP_TARGET,
	BUILT_IN_GOMP_TARGET_DATA, BUILT_IN_GOMP_TARGET_UPDATE pass NULL
	instead of &__OFFLOAD_TABLE__, for BUILT_IN_GOACC_DATA_START,
	BUILT_IN_GOACC_ENTER_EXIT_DATA, BUILT_IN_GOACC_PARALLEL,
	BUILT_IN_GOACC_UPDATE don't pass it at all.
	libgomp/
	* libgomp_g.h (GOACC_data_start, GOACC_enter_exit_data)
	(GOACC_parallel, GOACC_update): Remove const_void *offload_table
	formal parameter.  Update all users.
	* target.c (GOMP_target, GOMP_target_data, GOMP_target_update):
	Document unused formal parameter.

From-SVN: r219837
2015-01-19 13:05:43 +01:00
Thomas Schwinge 128b26dceb [PR libgomp/64625] Remove __OFFLOAD_TABLE__ variable/formal parameter.
gcc/
	* omp-low.c (offload_symbol_decl): Remove variable.
	(get_offload_symbol_decl): Remove function.
	(expand_omp_target): For BUILT_IN_GOMP_TARGET,
	BUILT_IN_GOMP_TARGET_DATA, BUILT_IN_GOMP_TARGET_UPDATE pass NULL
	instead of &__OFFLOAD_TABLE__, for BUILT_IN_GOACC_DATA_START,
	BUILT_IN_GOACC_ENTER_EXIT_DATA, BUILT_IN_GOACC_PARALLEL,
	BUILT_IN_GOACC_UPDATE don't pass it at all.
	libgomp/
	* libgomp_g.h (GOACC_data_start, GOACC_enter_exit_data)
	(GOACC_parallel, GOACC_update): Remove const_void *offload_table
	formal parameter.  Update all users.
	* target.c (GOMP_target, GOMP_target_data, GOMP_target_update):
	Document unused formal parameter.

From-SVN: r219836
2015-01-19 13:03:35 +01:00
Thomas Schwinge 6e36114cdf libgomp: Don't use <alloca.h>.
libgomp/
	* oacc-parallel.c: Don't include <alloca.h>.
	(GOACC_parallel): Use gomp_alloca instead of alloca.

From-SVN: r219771
2015-01-16 21:05:21 +01:00
Gerald Pfeifer 973e980879 * target.c (num_devices): Guard with PLUGIN_SUPPORT.
From-SVN: r219742
2015-01-16 14:27:55 +00:00
Thomas Schwinge 41dbbb3789 Merge current set of OpenACC changes from gomp-4_0-branch.
contrib/
	* gcc_update (files_and_dependencies): Update rules for new
	libgomp/plugin/Makefrag.am and libgomp/plugin/configfrag.ac files.
	gcc/
	* builtin-types.def (BT_FN_VOID_INT_INT_VAR)
	(BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR)
	(BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR):
	New function types.
	* builtins.c: Include "gomp-constants.h".
	(expand_builtin_acc_on_device): New function.
	(expand_builtin, is_inexpensive_builtin): Handle
	BUILT_IN_ACC_ON_DEVICE.
	* builtins.def (DEF_GOACC_BUILTIN, DEF_GOACC_BUILTIN_COMPILER):
	New macros.
	* cgraph.c (cgraph_node::create): Consider flag_openacc next to
	flag_openmp.
	* config.gcc <nvptx-*> (tm_file): Add nvptx/offload.h.
	<*-intelmic-* | *-intelmicemul-*> (tm_file): Add
	i386/intelmic-offload.h.
	* gcc.c (LINK_COMMAND_SPEC, GOMP_SELF_SPECS): For -fopenacc, link
	to libgomp and its dependencies.
	* config/arc/arc.h (LINK_COMMAND_SPEC): Likewise.
	* config/darwin.h (LINK_COMMAND_SPEC_A): Likewise.
	* config/i386/mingw32.h (GOMP_SELF_SPECS): Likewise.
	* config/ia64/hpux.h (LIB_SPEC): Likewise.
	* config/pa/pa-hpux11.h (LIB_SPEC): Likewise.
	* config/pa/pa64-hpux.h (LIB_SPEC): Likewise.
	* doc/generic.texi: Update for OpenACC changes.
	* doc/gimple.texi: Likewise.
	* doc/invoke.texi: Likewise.
	* doc/sourcebuild.texi: Likewise.
	* gimple-pretty-print.c (dump_gimple_omp_for): Handle
	GF_OMP_FOR_KIND_OACC_LOOP.
	(dump_gimple_omp_target): Handle GF_OMP_TARGET_KIND_OACC_KERNELS,
	GF_OMP_TARGET_KIND_OACC_PARALLEL, GF_OMP_TARGET_KIND_OACC_DATA,
	GF_OMP_TARGET_KIND_OACC_UPDATE,
	GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA.
	Dump more data.
	* gimple.c: Update comments for OpenACC changes.
	* gimple.def: Likewise.
	* gimple.h: Likewise.
	(enum gf_mask): Add GF_OMP_FOR_KIND_OACC_LOOP,
	GF_OMP_TARGET_KIND_OACC_PARALLEL, GF_OMP_TARGET_KIND_OACC_KERNELS,
	GF_OMP_TARGET_KIND_OACC_DATA, GF_OMP_TARGET_KIND_OACC_UPDATE,
	GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA.
	(gimple_omp_for_cond, gimple_omp_for_set_cond): Sort in the
	appropriate place.
	(is_gimple_omp_oacc, is_gimple_omp_offloaded): New functions.
	* gimplify.c: Include "gomp-constants.h".
	Update comments for OpenACC changes.
	(is_gimple_stmt): Handle OACC_PARALLEL, OACC_KERNELS, OACC_DATA,
	OACC_HOST_DATA, OACC_DECLARE, OACC_UPDATE, OACC_ENTER_DATA,
	OACC_EXIT_DATA, OACC_CACHE, OACC_LOOP.
	(gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Handle
	OMP_CLAUSE__CACHE_, OMP_CLAUSE_ASYNC, OMP_CLAUSE_WAIT,
	OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_WORKERS,
	OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_GANG, OMP_CLAUSE_WORKER,
	OMP_CLAUSE_VECTOR, OMP_CLAUSE_DEVICE_RESIDENT,
	OMP_CLAUSE_USE_DEVICE, OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_AUTO,
	OMP_CLAUSE_SEQ.
	(gimplify_adjust_omp_clauses_1, gimplify_adjust_omp_clauses): Use
	GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.  Use
	OMP_CLAUSE_SET_MAP_KIND.
	(gimplify_oacc_cache): New function.
	(gimplify_omp_for): Handle OACC_LOOP.
	(gimplify_omp_workshare): Handle OACC_KERNELS, OACC_PARALLEL,
	OACC_DATA.
	(gimplify_omp_target_update): Handle OACC_ENTER_DATA,
	OACC_EXIT_DATA, OACC_UPDATE.
	(gimplify_expr): Handle OACC_LOOP, OACC_CACHE, OACC_HOST_DATA,
	OACC_DECLARE, OACC_KERNELS, OACC_PARALLEL, OACC_DATA,
	OACC_ENTER_DATA, OACC_EXIT_DATA, OACC_UPDATE.
	(gimplify_body): Consider flag_openacc next to flag_openmp.
	* lto-streamer-out.c: Include "gomp-constants.h".
	* omp-builtins.def (BUILT_IN_ACC_GET_DEVICE_TYPE)
	(BUILT_IN_GOACC_DATA_START, BUILT_IN_GOACC_DATA_END)
	(BUILT_IN_GOACC_ENTER_EXIT_DATA, BUILT_IN_GOACC_PARALLEL)
	(BUILT_IN_GOACC_UPDATE, BUILT_IN_GOACC_WAIT)
	(BUILT_IN_GOACC_GET_THREAD_NUM, BUILT_IN_GOACC_GET_NUM_THREADS)
	(BUILT_IN_ACC_ON_DEVICE): New builtins.
	* omp-low.c: Include "gomp-constants.h".
	Update comments for OpenACC changes.
	(struct omp_context): Add reduction_map, gwv_below, gwv_this
	members.
	(extract_omp_for_data, use_pointer_for_field, install_var_field)
	(new_omp_context, delete_omp_context, scan_sharing_clauses)
	(create_omp_child_function, scan_omp_for, scan_omp_target)
	(check_omp_nesting_restrictions, lower_reduction_clauses)
	(build_omp_regions_1, diagnose_sb_0, make_gimple_omp_edges):
	Update for OpenACC changes.
	(scan_sharing_clauses): Handle OMP_CLAUSE_NUM_GANGS:
	OMP_CLAUSE_NUM_WORKERS: OMP_CLAUSE_VECTOR_LENGTH,
	OMP_CLAUSE_ASYNC, OMP_CLAUSE_WAIT, OMP_CLAUSE_GANG,
	OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR, OMP_CLAUSE_DEVICE_RESIDENT,
	OMP_CLAUSE_USE_DEVICE, OMP_CLAUSE__CACHE_, OMP_CLAUSE_INDEPENDENT,
	OMP_CLAUSE_AUTO, OMP_CLAUSE_SEQ.  Use GOMP_MAP_* instead of
	OMP_CLAUSE_MAP_*.
	(expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
	Handle GF_OMP_FOR_KIND_OACC_LOOP.
	(expand_omp_target, lower_omp_target): Handle
	GF_OMP_TARGET_KIND_OACC_PARALLEL, GF_OMP_TARGET_KIND_OACC_KERNELS,
	GF_OMP_TARGET_KIND_OACC_UPDATE,
	GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA,
	GF_OMP_TARGET_KIND_OACC_DATA.
	(pass_expand_omp::execute, execute_lower_omp)
	(pass_diagnose_omp_blocks::gate): Consider flag_openacc next to
	flag_openmp.
	(offload_symbol_decl): New variable.
	(oacc_get_reduction_array_id, oacc_max_threads)
	(get_offload_symbol_decl, get_base_type, lookup_oacc_reduction)
	(maybe_lookup_oacc_reduction, enclosing_target_ctx)
	(oacc_loop_or_target_p, oacc_lower_reduction_var_helper)
	(oacc_gimple_assign, oacc_initialize_reduction_data)
	(oacc_finalize_reduction_data, oacc_process_reduction_data): New
	functions.
	(is_targetreg_ctx): Remove function.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE__CACHE_,
	OMP_CLAUSE_DEVICE_RESIDENT, OMP_CLAUSE_USE_DEVICE,
	OMP_CLAUSE_GANG, OMP_CLAUSE_ASYNC, OMP_CLAUSE_WAIT,
	OMP_CLAUSE_AUTO, OMP_CLAUSE_SEQ, OMP_CLAUSE_INDEPENDENT,
	OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR, OMP_CLAUSE_NUM_GANGS,
	OMP_CLAUSE_NUM_WORKERS, OMP_CLAUSE_VECTOR_LENGTH.
	* tree.c (omp_clause_code_name, walk_tree_1): Update accordingly.
	* tree.h (OMP_CLAUSE_GANG_EXPR, OMP_CLAUSE_GANG_STATIC_EXPR)
	(OMP_CLAUSE_ASYNC_EXPR, OMP_CLAUSE_WAIT_EXPR)
	(OMP_CLAUSE_VECTOR_EXPR, OMP_CLAUSE_WORKER_EXPR)
	(OMP_CLAUSE_NUM_GANGS_EXPR, OMP_CLAUSE_NUM_WORKERS_EXPR)
	(OMP_CLAUSE_VECTOR_LENGTH_EXPR): New macros.
	* tree-core.h: Update comments for OpenACC changes.
	(enum omp_clause_map_kind): Remove.
	(struct tree_omp_clause): Change type of map_kind member from enum
	omp_clause_map_kind to unsigned char.
	* tree-inline.c: Update comments for OpenACC changes.
	* tree-nested.c: Likewise.  Include "gomp-constants.h".
	(convert_nonlocal_reference_stmt, convert_local_reference_stmt)
	(convert_tramp_reference_stmt, convert_gimple_call): Update for
	OpenACC changes.  Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.  Use
	OMP_CLAUSE_SET_MAP_KIND.
	* tree-pretty-print.c: Include "gomp-constants.h".
	(dump_omp_clause): Handle OMP_CLAUSE_DEVICE_RESIDENT,
	OMP_CLAUSE_USE_DEVICE, OMP_CLAUSE__CACHE_, OMP_CLAUSE_GANG,
	OMP_CLAUSE_ASYNC, OMP_CLAUSE_AUTO, OMP_CLAUSE_SEQ,
	OMP_CLAUSE_WAIT, OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR,
	OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_WORKERS,
	OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_INDEPENDENT.  Use GOMP_MAP_*
	instead of OMP_CLAUSE_MAP_*.
	(dump_generic_node): Handle OACC_PARALLEL, OACC_KERNELS,
	OACC_DATA, OACC_HOST_DATA, OACC_DECLARE, OACC_UPDATE,
	OACC_ENTER_DATA, OACC_EXIT_DATA, OACC_CACHE, OACC_LOOP.
	* tree-streamer-in.c: Include "gomp-constants.h".
	(unpack_ts_omp_clause_value_fields) Use GOMP_MAP_* instead of
	OMP_CLAUSE_MAP_*.  Use OMP_CLAUSE_SET_MAP_KIND.
	* tree-streamer-out.c: Include "gomp-constants.h".
	(pack_ts_omp_clause_value_fields): Use GOMP_MAP_* instead of
	OMP_CLAUSE_MAP_*.
	* tree.def (OACC_PARALLEL, OACC_KERNELS, OACC_DATA)
	(OACC_HOST_DATA, OACC_LOOP, OACC_CACHE, OACC_DECLARE)
	(OACC_ENTER_DATA, OACC_EXIT_DATA, OACC_UPDATE): New tree codes.
	* tree.c (omp_clause_num_ops): Update accordingly.
	* tree.h (OMP_BODY, OMP_CLAUSES, OMP_LOOP_CHECK, OMP_CLAUSE_SIZE):
	Likewise.
	(OACC_PARALLEL_BODY, OACC_PARALLEL_CLAUSES, OACC_KERNELS_BODY)
	(OACC_KERNELS_CLAUSES, OACC_DATA_BODY, OACC_DATA_CLAUSES)
	(OACC_HOST_DATA_BODY, OACC_HOST_DATA_CLAUSES, OACC_CACHE_CLAUSES)
	(OACC_DECLARE_CLAUSES, OACC_ENTER_DATA_CLAUSES)
	(OACC_EXIT_DATA_CLAUSES, OACC_UPDATE_CLAUSES)
	(OACC_KERNELS_COMBINED, OACC_PARALLEL_COMBINED): New macros.
	* tree.h (OMP_CLAUSE_MAP_KIND): Cast it to enum gomp_map_kind.
	(OMP_CLAUSE_SET_MAP_KIND): New macro.
	* varpool.c (varpool_node::get_create): Consider flag_openacc next
	to flag_openmp.
	* config/i386/intelmic-offload.h: New file.
	* config/nvptx/offload.h: Likewise.
	gcc/ada/
	* gcc-interface/utils.c (DEF_FUNCTION_TYPE_VAR_8)
	(DEF_FUNCTION_TYPE_VAR_12): New macros.
	gcc/c-family/
	* c.opt (fopenacc): New option.
	* c-cppbuiltin.c (c_cpp_builtins): Conditionally define _OPENACC.
	* c-common.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
	New macros.
	* c-common.h (c_finish_oacc_wait): New prototype.
	* c-omp.c: Include "omp-low.h" and "gomp-constants.h".
	(c_finish_oacc_wait): New function.
	* c-pragma.c (oacc_pragmas): New variable.
	(c_pp_lookup_pragma, init_pragma): Handle it.
	* c-pragma.h (enum pragma_kind): Add PRAGMA_OACC_CACHE,
	PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA, PRAGMA_OACC_EXIT_DATA,
	PRAGMA_OACC_KERNELS, PRAGMA_OACC_LOOP, PRAGMA_OACC_PARALLEL,
	PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
	(enum pragma_omp_clause): Add PRAGMA_OACC_CLAUSE_ASYNC,
	PRAGMA_OACC_CLAUSE_AUTO, PRAGMA_OACC_CLAUSE_COLLAPSE,
	PRAGMA_OACC_CLAUSE_COPY, PRAGMA_OACC_CLAUSE_COPYIN,
	PRAGMA_OACC_CLAUSE_COPYOUT, PRAGMA_OACC_CLAUSE_CREATE,
	PRAGMA_OACC_CLAUSE_DELETE, PRAGMA_OACC_CLAUSE_DEVICE,
	PRAGMA_OACC_CLAUSE_DEVICEPTR, PRAGMA_OACC_CLAUSE_FIRSTPRIVATE,
	PRAGMA_OACC_CLAUSE_GANG, PRAGMA_OACC_CLAUSE_HOST,
	PRAGMA_OACC_CLAUSE_IF, PRAGMA_OACC_CLAUSE_NUM_GANGS,
	PRAGMA_OACC_CLAUSE_NUM_WORKERS, PRAGMA_OACC_CLAUSE_PRESENT,
	PRAGMA_OACC_CLAUSE_PRESENT_OR_COPY,
	PRAGMA_OACC_CLAUSE_PRESENT_OR_COPYIN,
	PRAGMA_OACC_CLAUSE_PRESENT_OR_COPYOUT,
	PRAGMA_OACC_CLAUSE_PRESENT_OR_CREATE, PRAGMA_OACC_CLAUSE_PRIVATE,
	PRAGMA_OACC_CLAUSE_REDUCTION, PRAGMA_OACC_CLAUSE_SELF,
	PRAGMA_OACC_CLAUSE_SEQ, PRAGMA_OACC_CLAUSE_VECTOR,
	PRAGMA_OACC_CLAUSE_VECTOR_LENGTH, PRAGMA_OACC_CLAUSE_WAIT,
	PRAGMA_OACC_CLAUSE_WORKER.
	gcc/c/
	* c-parser.c: Include "gomp-constants.h".
	(c_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
	omp_clause_map_kind.  Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
	Use OMP_CLAUSE_SET_MAP_KIND.
	(c_parser_pragma): Handle PRAGMA_OACC_ENTER_DATA,
	PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_UPDATE.
	(c_parser_omp_construct): Handle PRAGMA_OACC_CACHE,
	PRAGMA_OACC_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_LOOP,
	PRAGMA_OACC_PARALLEL, PRAGMA_OACC_WAIT.
	(c_parser_omp_clause_name): Handle "auto", "async", "copy",
	"copyout", "create", "delete", "deviceptr", "gang", "host",
	"num_gangs", "num_workers", "present", "present_or_copy", "pcopy",
	"present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
	"present_or_create", "pcreate", "seq", "self", "vector",
	"vector_length", "wait", "worker".
	(OACC_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
	(OACC_ENTER_DATA_CLAUSE_MASK, OACC_EXIT_DATA_CLAUSE_MASK)
	(OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
	(OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
	(c_parser_omp_variable_list): Handle OMP_CLAUSE__CACHE_.
	(c_parser_oacc_wait_list, c_parser_oacc_data_clause)
	(c_parser_oacc_data_clause_deviceptr)
	(c_parser_omp_clause_num_gangs, c_parser_omp_clause_num_workers)
	(c_parser_oacc_clause_async, c_parser_oacc_clause_wait)
	(c_parser_omp_clause_vector_length, c_parser_oacc_all_clauses)
	(c_parser_oacc_cache, c_parser_oacc_data, c_parser_oacc_kernels)
	(c_parser_oacc_enter_exit_data, c_parser_oacc_loop)
	(c_parser_oacc_parallel, c_parser_oacc_update)
	(c_parser_oacc_wait): New functions.
	* c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels)
	(c_finish_oacc_data): New prototypes.
	* c-typeck.c: Include "gomp-constants.h".
	(handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR.  Use
	GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.  Use
	OMP_CLAUSE_SET_MAP_KIND.
	(c_finish_oacc_parallel, c_finish_oacc_kernels)
	(c_finish_oacc_data): New functions.
	(c_finish_omp_clauses): Handle OMP_CLAUSE__CACHE_,
	OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_WORKERS,
	OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_ASYNC, OMP_CLAUSE_WAIT,
	OMP_CLAUSE_AUTO, OMP_CLAUSE_SEQ, OMP_CLAUSE_GANG,
	OMP_CLAUSE_WORKER, OMP_CLAUSE_VECTOR, and OMP_CLAUSE_MAP's
	GOMP_MAP_FORCE_DEVICEPTR.
	gcc/cp/
	* parser.c: Include "gomp-constants.h".
	(cp_parser_omp_clause_map): Use enum gomp_map_kind instead of enum
	omp_clause_map_kind.  Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
	Use OMP_CLAUSE_SET_MAP_KIND.
	(cp_parser_omp_construct, cp_parser_pragma): Handle
	PRAGMA_OACC_CACHE, PRAGMA_OACC_DATA, PRAGMA_OACC_ENTER_DATA,
	PRAGMA_OACC_EXIT_DATA, PRAGMA_OACC_KERNELS, PRAGMA_OACC_PARALLEL,
	PRAGMA_OACC_LOOP, PRAGMA_OACC_UPDATE, PRAGMA_OACC_WAIT.
	(cp_parser_omp_clause_name): Handle "async", "copy", "copyout",
	"create", "delete", "deviceptr", "host", "num_gangs",
	"num_workers", "present", "present_or_copy", "pcopy",
	"present_or_copyin", "pcopyin", "present_or_copyout", "pcopyout",
	"present_or_create", "pcreate", "vector_length", "wait".
	(OACC_DATA_CLAUSE_MASK, OACC_ENTER_DATA_CLAUSE_MASK)
	(OACC_EXIT_DATA_CLAUSE_MASK, OACC_KERNELS_CLAUSE_MASK)
	(OACC_LOOP_CLAUSE_MASK, OACC_PARALLEL_CLAUSE_MASK)
	(OACC_UPDATE_CLAUSE_MASK, OACC_WAIT_CLAUSE_MASK): New macros.
	(cp_parser_omp_var_list_no_open): Handle OMP_CLAUSE__CACHE_.
	(cp_parser_oacc_data_clause, cp_parser_oacc_data_clause_deviceptr)
	(cp_parser_oacc_clause_vector_length, cp_parser_oacc_wait_list)
	(cp_parser_oacc_clause_wait, cp_parser_omp_clause_num_gangs)
	(cp_parser_omp_clause_num_workers, cp_parser_oacc_clause_async)
	(cp_parser_oacc_all_clauses, cp_parser_oacc_cache)
	(cp_parser_oacc_data, cp_parser_oacc_enter_exit_data)
	(cp_parser_oacc_kernels, cp_parser_oacc_loop)
	(cp_parser_oacc_parallel, cp_parser_oacc_update)
	(cp_parser_oacc_wait): New functions.
	* cp-tree.h (finish_oacc_data, finish_oacc_kernels)
	(finish_oacc_parallel): New prototypes.
	* semantics.c: Include "gomp-constants.h".
	(handle_omp_array_sections): Handle GOMP_MAP_FORCE_DEVICEPTR.  Use
	GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.  Use
	OMP_CLAUSE_SET_MAP_KIND.
	(finish_omp_clauses): Handle OMP_CLAUSE_ASYNC,
	OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE__CACHE_.
	Use GOMP_MAP_* instead of OMP_CLAUSE_MAP_*.
	(finish_oacc_data, finish_oacc_kernels, finish_oacc_parallel): New
	functions.
	gcc/fortran/
	* lang.opt (fopenacc): New option.
	* cpp.c (cpp_define_builtins): Conditionally define _OPENACC.
	* dump-parse-tree.c (show_omp_node): Split part of it into...
	(show_omp_clauses): ... this new function.
	(show_omp_node, show_code_node): Handle EXEC_OACC_PARALLEL_LOOP,
	EXEC_OACC_PARALLEL, EXEC_OACC_KERNELS_LOOP, EXEC_OACC_KERNELS,
	EXEC_OACC_DATA, EXEC_OACC_HOST_DATA, EXEC_OACC_LOOP,
	EXEC_OACC_UPDATE, EXEC_OACC_WAIT, EXEC_OACC_CACHE,
	EXEC_OACC_ENTER_DATA, EXEC_OACC_EXIT_DATA.
	(show_namespace): Update for OpenACC.
	* f95-lang.c (DEF_FUNCTION_TYPE_VAR_2, DEF_FUNCTION_TYPE_VAR_8)
	(DEF_FUNCTION_TYPE_VAR_12, DEF_GOACC_BUILTIN)
	(DEF_GOACC_BUILTIN_COMPILER): New macros.
	* types.def (BT_FN_VOID_INT_INT_VAR)
	(BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR)
	(BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR):
	New function types.
	* gfortran.h (gfc_statement): Add ST_OACC_PARALLEL_LOOP,
	ST_OACC_END_PARALLEL_LOOP, ST_OACC_PARALLEL, ST_OACC_END_PARALLEL,
	ST_OACC_KERNELS, ST_OACC_END_KERNELS, ST_OACC_DATA,
	ST_OACC_END_DATA, ST_OACC_HOST_DATA, ST_OACC_END_HOST_DATA,
	ST_OACC_LOOP, ST_OACC_END_LOOP, ST_OACC_DECLARE, ST_OACC_UPDATE,
	ST_OACC_WAIT, ST_OACC_CACHE, ST_OACC_KERNELS_LOOP,
	ST_OACC_END_KERNELS_LOOP, ST_OACC_ENTER_DATA, ST_OACC_EXIT_DATA,
	ST_OACC_ROUTINE.
	(struct gfc_expr_list): New data type.
	(gfc_get_expr_list): New macro.
	(gfc_omp_map_op): Add OMP_MAP_FORCE_ALLOC, OMP_MAP_FORCE_DEALLOC,
	OMP_MAP_FORCE_TO, OMP_MAP_FORCE_FROM, OMP_MAP_FORCE_TOFROM,
	OMP_MAP_FORCE_PRESENT, OMP_MAP_FORCE_DEVICEPTR.
	(OMP_LIST_FIRST, OMP_LIST_DEVICE_RESIDENT, OMP_LIST_USE_DEVICE)
	(OMP_LIST_CACHE): New enumerators.
	(struct gfc_omp_clauses): Add async_expr, gang_expr, worker_expr,
	vector_expr, num_gangs_expr, num_workers_expr, vector_length_expr,
	wait_list, tile_list, async, gang, worker, vector, seq,
	independent, wait, par_auto, gang_static, and loc members.
	(struct gfc_namespace): Add oacc_declare_clauses member.
	(gfc_exec_op): Add EXEC_OACC_KERNELS_LOOP,
	EXEC_OACC_PARALLEL_LOOP, EXEC_OACC_PARALLEL, EXEC_OACC_KERNELS,
	EXEC_OACC_DATA, EXEC_OACC_HOST_DATA, EXEC_OACC_LOOP,
	EXEC_OACC_UPDATE, EXEC_OACC_WAIT, EXEC_OACC_CACHE,
	EXEC_OACC_ENTER_DATA, EXEC_OACC_EXIT_DATA.
	(gfc_free_expr_list, gfc_resolve_oacc_directive)
	(gfc_resolve_oacc_declare, gfc_resolve_oacc_parallel_loop_blocks)
	(gfc_resolve_oacc_blocks): New prototypes.
	* match.c (match_exit_cycle): Handle EXEC_OACC_LOOP and
	EXEC_OACC_PARALLEL_LOOP.
	* match.h (gfc_match_oacc_cache, gfc_match_oacc_wait)
	(gfc_match_oacc_update, gfc_match_oacc_declare)
	(gfc_match_oacc_loop, gfc_match_oacc_host_data)
	(gfc_match_oacc_data, gfc_match_oacc_kernels)
	(gfc_match_oacc_kernels_loop, gfc_match_oacc_parallel)
	(gfc_match_oacc_parallel_loop, gfc_match_oacc_enter_data)
	(gfc_match_oacc_exit_data, gfc_match_oacc_routine): New
	prototypes.
	* openmp.c: Include "diagnostic.h" and "gomp-constants.h".
	(gfc_free_omp_clauses): Update for members added to struct
	gfc_omp_clauses.
	(gfc_match_omp_clauses): Change mask paramter to uint64_t.  Add
	openacc parameter.
	(resolve_omp_clauses): Add openacc parameter.  Update for OpenACC.
	(struct fortran_omp_context): Add is_openmp member.
	(gfc_resolve_omp_parallel_blocks): Initialize it.
	(gfc_resolve_do_iterator): Update for OpenACC.
	(gfc_resolve_omp_directive): Call
	resolve_omp_directive_inside_oacc_region.
	(OMP_CLAUSE_PRIVATE, OMP_CLAUSE_FIRSTPRIVATE)
	(OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_COPYPRIVATE)
	(OMP_CLAUSE_SHARED, OMP_CLAUSE_COPYIN, OMP_CLAUSE_REDUCTION)
	(OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE)
	(OMP_CLAUSE_DEFAULT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_COLLAPSE)
	(OMP_CLAUSE_UNTIED, OMP_CLAUSE_FINAL, OMP_CLAUSE_MERGEABLE)
	(OMP_CLAUSE_ALIGNED, OMP_CLAUSE_DEPEND, OMP_CLAUSE_INBRANCH)
	(OMP_CLAUSE_LINEAR, OMP_CLAUSE_NOTINBRANCH, OMP_CLAUSE_PROC_BIND)
	(OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_UNIFORM)
	(OMP_CLAUSE_DEVICE, OMP_CLAUSE_MAP, OMP_CLAUSE_TO)
	(OMP_CLAUSE_FROM, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_THREAD_LIMIT)
	(OMP_CLAUSE_DIST_SCHEDULE): Use uint64_t.
	(OMP_CLAUSE_ASYNC, OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_WORKERS)
	(OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_COPY, OMP_CLAUSE_COPYOUT)
	(OMP_CLAUSE_CREATE, OMP_CLAUSE_PRESENT)
	(OMP_CLAUSE_PRESENT_OR_COPY, OMP_CLAUSE_PRESENT_OR_COPYIN)
	(OMP_CLAUSE_PRESENT_OR_COPYOUT, OMP_CLAUSE_PRESENT_OR_CREATE)
	(OMP_CLAUSE_DEVICEPTR, OMP_CLAUSE_GANG, OMP_CLAUSE_WORKER)
	(OMP_CLAUSE_VECTOR, OMP_CLAUSE_SEQ, OMP_CLAUSE_INDEPENDENT)
	(OMP_CLAUSE_USE_DEVICE, OMP_CLAUSE_DEVICE_RESIDENT)
	(OMP_CLAUSE_HOST_SELF, OMP_CLAUSE_OACC_DEVICE, OMP_CLAUSE_WAIT)
	(OMP_CLAUSE_DELETE, OMP_CLAUSE_AUTO, OMP_CLAUSE_TILE): New macros.
	(gfc_match_omp_clauses): Handle those.
	(OACC_PARALLEL_CLAUSES, OACC_KERNELS_CLAUSES, OACC_DATA_CLAUSES)
	(OACC_LOOP_CLAUSES, OACC_PARALLEL_LOOP_CLAUSES)
	(OACC_KERNELS_LOOP_CLAUSES, OACC_HOST_DATA_CLAUSES)
	(OACC_DECLARE_CLAUSES, OACC_UPDATE_CLAUSES)
	(OACC_ENTER_DATA_CLAUSES, OACC_EXIT_DATA_CLAUSES)
	(OACC_WAIT_CLAUSES): New macros.
	(gfc_free_expr_list, match_oacc_expr_list, match_oacc_clause_gang)
	(gfc_match_omp_map_clause, gfc_match_oacc_parallel_loop)
	(gfc_match_oacc_parallel, gfc_match_oacc_kernels_loop)
	(gfc_match_oacc_kernels, gfc_match_oacc_data)
	(gfc_match_oacc_host_data, gfc_match_oacc_loop)
	(gfc_match_oacc_declare, gfc_match_oacc_update)
	(gfc_match_oacc_enter_data, gfc_match_oacc_exit_data)
	(gfc_match_oacc_wait, gfc_match_oacc_cache)
	(gfc_match_oacc_routine, oacc_is_loop)
	(resolve_oacc_scalar_int_expr, resolve_oacc_positive_int_expr)
	(check_symbol_not_pointer, check_array_not_assumed)
	(resolve_oacc_data_clauses, resolve_oacc_deviceptr_clause)
	(oacc_compatible_clauses, oacc_is_parallel, oacc_is_kernels)
	(omp_code_to_statement, oacc_code_to_statement)
	(resolve_oacc_directive_inside_omp_region)
	(resolve_omp_directive_inside_oacc_region)
	(resolve_oacc_nested_loops, resolve_oacc_params_in_parallel)
	(resolve_oacc_loop_blocks, gfc_resolve_oacc_blocks)
	(resolve_oacc_loop, resolve_oacc_cache, gfc_resolve_oacc_declare)
	(gfc_resolve_oacc_directive): New functions.
	* parse.c (next_free): Update for OpenACC.  Move some code into...
	(verify_token_free): ... this new function.
	(next_fixed): Update for OpenACC.  Move some code into...
	(verify_token_fixed): ... this new function.
	(case_executable): Add ST_OACC_UPDATE, ST_OACC_WAIT,
	ST_OACC_CACHE, ST_OACC_ENTER_DATA, and ST_OACC_EXIT_DATA.
	(case_exec_markers): Add ST_OACC_PARALLEL_LOOP, ST_OACC_PARALLEL,
	ST_OACC_KERNELS, ST_OACC_DATA, ST_OACC_HOST_DATA, ST_OACC_LOOP,
	ST_OACC_KERNELS_LOOP.
	(case_decl): Add ST_OACC_ROUTINE.
	(push_state, parse_critical_block, parse_progunit): Update for
	OpenACC.
	(gfc_ascii_statement): Handle ST_OACC_PARALLEL_LOOP,
	ST_OACC_END_PARALLEL_LOOP, ST_OACC_PARALLEL, ST_OACC_END_PARALLEL,
	ST_OACC_KERNELS, ST_OACC_END_KERNELS, ST_OACC_KERNELS_LOOP,
	ST_OACC_END_KERNELS_LOOP, ST_OACC_DATA, ST_OACC_END_DATA,
	ST_OACC_HOST_DATA, ST_OACC_END_HOST_DATA, ST_OACC_LOOP,
	ST_OACC_END_LOOP, ST_OACC_DECLARE, ST_OACC_UPDATE, ST_OACC_WAIT,
	ST_OACC_CACHE, ST_OACC_ENTER_DATA, ST_OACC_EXIT_DATA,
	ST_OACC_ROUTINE.
	(verify_st_order, parse_spec): Handle ST_OACC_DECLARE.
	(parse_executable): Handle ST_OACC_PARALLEL_LOOP,
	ST_OACC_KERNELS_LOOP, ST_OACC_LOOP, ST_OACC_PARALLEL,
	ST_OACC_KERNELS, ST_OACC_DATA, ST_OACC_HOST_DATA.
	(decode_oacc_directive, parse_oacc_structured_block)
	(parse_oacc_loop, is_oacc): New functions.
	* parse.h (struct gfc_state_data): Add oacc_declare_clauses
	member.
	(is_oacc): New prototype.
	* resolve.c (gfc_resolve_blocks, gfc_resolve_code): Handle
	EXEC_OACC_PARALLEL_LOOP, EXEC_OACC_PARALLEL,
	EXEC_OACC_KERNELS_LOOP, EXEC_OACC_KERNELS, EXEC_OACC_DATA,
	EXEC_OACC_HOST_DATA, EXEC_OACC_LOOP, EXEC_OACC_UPDATE,
	EXEC_OACC_WAIT, EXEC_OACC_CACHE, EXEC_OACC_ENTER_DATA,
	EXEC_OACC_EXIT_DATA.
	(resolve_codes): Call gfc_resolve_oacc_declare.
	* scanner.c (openacc_flag, openacc_locus): New variables.
	(skip_free_comments): Update for OpenACC.  Move some code into...
	(skip_omp_attribute): ... this new function.
	(skip_oacc_attribute): New function.
	(skip_fixed_comments, gfc_next_char_literal): Update for OpenACC.
	* st.c (gfc_free_statement): Handle EXEC_OACC_PARALLEL_LOOP,
	EXEC_OACC_PARALLEL, EXEC_OACC_KERNELS_LOOP, EXEC_OACC_KERNELS,
	EXEC_OACC_DATA, EXEC_OACC_HOST_DATA, EXEC_OACC_LOOP,
	EXEC_OACC_UPDATE, EXEC_OACC_WAIT, EXEC_OACC_CACHE,
	EXEC_OACC_ENTER_DATA, EXEC_OACC_EXIT_DATA.
	* trans-decl.c (gfc_generate_function_code): Update for OpenACC.
	* trans-openmp.c: Include "gomp-constants.h".
	(gfc_omp_finish_clause, gfc_trans_omp_clauses): Use GOMP_MAP_*
	instead of OMP_CLAUSE_MAP_*.  Use OMP_CLAUSE_SET_MAP_KIND.
	(gfc_trans_omp_clauses): Handle OMP_LIST_USE_DEVICE,
	OMP_LIST_DEVICE_RESIDENT, OMP_LIST_CACHE, and OMP_MAP_FORCE_ALLOC,
	OMP_MAP_FORCE_DEALLOC, OMP_MAP_FORCE_TO, OMP_MAP_FORCE_FROM,
	OMP_MAP_FORCE_TOFROM, OMP_MAP_FORCE_PRESENT,
	OMP_MAP_FORCE_DEVICEPTR, and gfc_omp_clauses' async, seq,
	independent, wait_list, num_gangs_expr, num_workers_expr,
	vector_length_expr, vector, vector_expr, worker, worker_expr,
	gang, gang_expr members.
	(gfc_trans_omp_do): Handle EXEC_OACC_LOOP.
	(gfc_convert_expr_to_tree, gfc_trans_oacc_construct)
	(gfc_trans_oacc_executable_directive)
	(gfc_trans_oacc_wait_directive, gfc_trans_oacc_combined_directive)
	(gfc_trans_oacc_declare, gfc_trans_oacc_directive): New functions.
	* trans-stmt.c (gfc_trans_block_construct): Update for OpenACC.
	* trans-stmt.h (gfc_trans_oacc_directive, gfc_trans_oacc_declare):
	New prototypes.
	* trans.c (tranc_code): Handle EXEC_OACC_CACHE, EXEC_OACC_WAIT,
	EXEC_OACC_UPDATE, EXEC_OACC_LOOP, EXEC_OACC_HOST_DATA,
	EXEC_OACC_DATA, EXEC_OACC_KERNELS, EXEC_OACC_KERNELS_LOOP,
	EXEC_OACC_PARALLEL, EXEC_OACC_PARALLEL_LOOP, EXEC_OACC_ENTER_DATA,
	EXEC_OACC_EXIT_DATA.
	* gfortran.texi: Update for OpenACC.
	* intrinsic.texi: Likewise.
	* invoke.texi: Likewise.
	gcc/lto/
	* lto-lang.c (DEF_FUNCTION_TYPE_VAR_8, DEF_FUNCTION_TYPE_VAR_12):
	New macros.
	* lto.c: Include "gomp-constants.h".
	gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_fopenacc): New
	procedure.
	* g++.dg/goacc-gomp/goacc-gomp.exp: New file.
	* g++.dg/goacc/goacc.exp: Likewise.
	* gcc.dg/goacc-gomp/goacc-gomp.exp: Likewise.
	* gcc.dg/goacc/goacc.exp: Likewise.
	* gfortran.dg/goacc/goacc.exp: Likewise.
	* c-c++-common/cpp/openacc-define-1.c: New file.
	* c-c++-common/cpp/openacc-define-2.c: Likewise.
	* c-c++-common/cpp/openacc-define-3.c: Likewise.
	* c-c++-common/goacc-gomp/nesting-1.c: Likewise.
	* c-c++-common/goacc-gomp/nesting-fail-1.c: Likewise.
	* c-c++-common/goacc/acc_on_device-2-off.c: Likewise.
	* c-c++-common/goacc/acc_on_device-2.c: Likewise.
	* c-c++-common/goacc/asyncwait-1.c: Likewise.
	* c-c++-common/goacc/cache-1.c: Likewise.
	* c-c++-common/goacc/clauses-fail.c: Likewise.
	* c-c++-common/goacc/collapse-1.c: Likewise.
	* c-c++-common/goacc/data-1.c: Likewise.
	* c-c++-common/goacc/data-2.c: Likewise.
	* c-c++-common/goacc/data-clause-duplicate-1.c: Likewise.
	* c-c++-common/goacc/deviceptr-1.c: Likewise.
	* c-c++-common/goacc/deviceptr-2.c: Likewise.
	* c-c++-common/goacc/deviceptr-3.c: Likewise.
	* c-c++-common/goacc/if-clause-1.c: Likewise.
	* c-c++-common/goacc/if-clause-2.c: Likewise.
	* c-c++-common/goacc/kernels-1.c: Likewise.
	* c-c++-common/goacc/loop-1.c: Likewise.
	* c-c++-common/goacc/loop-private-1.c: Likewise.
	* c-c++-common/goacc/nesting-1.c: Likewise.
	* c-c++-common/goacc/nesting-data-1.c: Likewise.
	* c-c++-common/goacc/nesting-fail-1.c: Likewise.
	* c-c++-common/goacc/parallel-1.c: Likewise.
	* c-c++-common/goacc/pcopy.c: Likewise.
	* c-c++-common/goacc/pcopyin.c: Likewise.
	* c-c++-common/goacc/pcopyout.c: Likewise.
	* c-c++-common/goacc/pcreate.c: Likewise.
	* c-c++-common/goacc/pragma_context.c: Likewise.
	* c-c++-common/goacc/present-1.c: Likewise.
	* c-c++-common/goacc/reduction-1.c: Likewise.
	* c-c++-common/goacc/reduction-2.c: Likewise.
	* c-c++-common/goacc/reduction-3.c: Likewise.
	* c-c++-common/goacc/reduction-4.c: Likewise.
	* c-c++-common/goacc/sb-1.c: Likewise.
	* c-c++-common/goacc/sb-2.c: Likewise.
	* c-c++-common/goacc/sb-3.c: Likewise.
	* c-c++-common/goacc/update-1.c: Likewise.
	* gcc.dg/goacc/acc_on_device-1.c: Likewise.
	* gfortran.dg/goacc/acc_on_device-1.f95: Likewise.
	* gfortran.dg/goacc/acc_on_device-2-off.f95: Likewise.
	* gfortran.dg/goacc/acc_on_device-2.f95: Likewise.
	* gfortran.dg/goacc/assumed.f95: Likewise.
	* gfortran.dg/goacc/asyncwait-1.f95: Likewise.
	* gfortran.dg/goacc/asyncwait-2.f95: Likewise.
	* gfortran.dg/goacc/asyncwait-3.f95: Likewise.
	* gfortran.dg/goacc/asyncwait-4.f95: Likewise.
	* gfortran.dg/goacc/branch.f95: Likewise.
	* gfortran.dg/goacc/cache-1.f95: Likewise.
	* gfortran.dg/goacc/coarray.f95: Likewise.
	* gfortran.dg/goacc/continuation-free-form.f95: Likewise.
	* gfortran.dg/goacc/cray.f95: Likewise.
	* gfortran.dg/goacc/critical.f95: Likewise.
	* gfortran.dg/goacc/data-clauses.f95: Likewise.
	* gfortran.dg/goacc/data-tree.f95: Likewise.
	* gfortran.dg/goacc/declare-1.f95: Likewise.
	* gfortran.dg/goacc/enter-exit-data.f95: Likewise.
	* gfortran.dg/goacc/fixed-1.f: Likewise.
	* gfortran.dg/goacc/fixed-2.f: Likewise.
	* gfortran.dg/goacc/fixed-3.f: Likewise.
	* gfortran.dg/goacc/fixed-4.f: Likewise.
	* gfortran.dg/goacc/host_data-tree.f95: Likewise.
	* gfortran.dg/goacc/if.f95: Likewise.
	* gfortran.dg/goacc/kernels-tree.f95: Likewise.
	* gfortran.dg/goacc/list.f95: Likewise.
	* gfortran.dg/goacc/literal.f95: Likewise.
	* gfortran.dg/goacc/loop-1.f95: Likewise.
	* gfortran.dg/goacc/loop-2.f95: Likewise.
	* gfortran.dg/goacc/loop-3.f95: Likewise.
	* gfortran.dg/goacc/loop-tree-1.f90: Likewise.
	* gfortran.dg/goacc/omp.f95: Likewise.
	* gfortran.dg/goacc/parallel-kernels-clauses.f95: Likewise.
	* gfortran.dg/goacc/parallel-kernels-regions.f95: Likewise.
	* gfortran.dg/goacc/parallel-tree.f95: Likewise.
	* gfortran.dg/goacc/parameter.f95: Likewise.
	* gfortran.dg/goacc/private-1.f95: Likewise.
	* gfortran.dg/goacc/private-2.f95: Likewise.
	* gfortran.dg/goacc/private-3.f95: Likewise.
	* gfortran.dg/goacc/pure-elemental-procedures.f95: Likewise.
	* gfortran.dg/goacc/reduction-2.f95: Likewise.
	* gfortran.dg/goacc/reduction.f95: Likewise.
	* gfortran.dg/goacc/routine-1.f90: Likewise.
	* gfortran.dg/goacc/routine-2.f90: Likewise.
	* gfortran.dg/goacc/sentinel-free-form.f95: Likewise.
	* gfortran.dg/goacc/several-directives.f95: Likewise.
	* gfortran.dg/goacc/sie.f95: Likewise.
	* gfortran.dg/goacc/subarrays.f95: Likewise.
	* gfortran.dg/gomp/map-1.f90: Likewise.
	* gfortran.dg/openacc-define-1.f90: Likewise.
	* gfortran.dg/openacc-define-2.f90: Likewise.
	* gfortran.dg/openacc-define-3.f90: Likewise.
	* g++.dg/gomp/block-1.C: Update for changed compiler output.
	* g++.dg/gomp/block-2.C: Likewise.
	* g++.dg/gomp/block-3.C: Likewise.
	* g++.dg/gomp/block-5.C: Likewise.
	* g++.dg/gomp/target-1.C: Likewise.
	* g++.dg/gomp/target-2.C: Likewise.
	* g++.dg/gomp/taskgroup-1.C: Likewise.
	* g++.dg/gomp/teams-1.C: Likewise.
	* gcc.dg/cilk-plus/jump-openmp.c: Likewise.
	* gcc.dg/cilk-plus/jump.c: Likewise.
	* gcc.dg/gomp/block-1.c: Likewise.
	* gcc.dg/gomp/block-10.c: Likewise.
	* gcc.dg/gomp/block-2.c: Likewise.
	* gcc.dg/gomp/block-3.c: Likewise.
	* gcc.dg/gomp/block-4.c: Likewise.
	* gcc.dg/gomp/block-5.c: Likewise.
	* gcc.dg/gomp/block-6.c: Likewise.
	* gcc.dg/gomp/block-7.c: Likewise.
	* gcc.dg/gomp/block-8.c: Likewise.
	* gcc.dg/gomp/block-9.c: Likewise.
	* gcc.dg/gomp/target-1.c: Likewise.
	* gcc.dg/gomp/target-2.c: Likewise.
	* gcc.dg/gomp/taskgroup-1.c: Likewise.
	* gcc.dg/gomp/teams-1.c: Likewise.
	include/
	* gomp-constants.h: New file.
	libgomp/
	* Makefile.am (search_path): Add $(top_srcdir)/../include.
	(libgomp_la_SOURCES): Add splay-tree.c, libgomp-plugin.c,
	oacc-parallel.c, oacc-host.c, oacc-init.c, oacc-mem.c,
	oacc-async.c, oacc-plugin.c, oacc-cuda.c.
	[USE_FORTRAN] (libgomp_la_SOURCES): Add openacc.f90.
	Include $(top_srcdir)/plugin/Makefrag.am.
	(nodist_libsubinclude_HEADERS): Add openacc.h.
	[USE_FORTRAN] (nodist_finclude_HEADERS): Add openacc_lib.h,
	openacc.f90, openacc.mod, openacc_kinds.mod.
	(omp_lib.mod): Generalize into...
	(%.mod): ... this new rule.
	(openacc_kinds.mod, openacc.mod): New rules.
	* plugin/configfrag.ac: New file.
	* configure.ac: Move plugin/offloading support into it.  Include
	it.  Instantiate testsuite/libgomp-test-support.pt.exp.
	* plugin/Makefrag.am: New file.
	* testsuite/Makefile.am (OFFLOAD_TARGETS)
	(OFFLOAD_ADDITIONAL_OPTIONS, OFFLOAD_ADDITIONAL_LIB_PATHS): Don't
	export.
	(libgomp-test-support.exp): New rule.
	(all-local): Depend on it.
	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* config.h.in: Likewise.
	* configure: Likewise.
	* configure.tgt: Harden shell syntax.
	* env.c: Include "oacc-int.h".
	(parse_acc_device_type): New function.
	(gomp_debug_var, goacc_device_type, goacc_device_num): New
	variables.
	(initialize_env): Initialize those.  Call
	goacc_runtime_initialize.
	* error.c (gomp_vdebug, gomp_debug, gomp_vfatal): New functions.
	(gomp_fatal): Call gomp_vfatal.
	* libgomp.h: Include "libgomp-plugin.h" and <stdarg.h>.
	(gomp_debug_var, goacc_device_type, goacc_device_num, gomp_vdebug)
	(gomp_debug, gomp_verror, gomp_vfatal, gomp_init_targets_once)
	(splay_tree_node, splay_tree, splay_tree_key)
	(struct target_mem_desc, struct splay_tree_key_s)
	(struct gomp_memory_mapping, struct acc_dispatch_t)
	(struct gomp_device_descr, gomp_acc_insert_pointer)
	(gomp_acc_remove_pointer, target_mem_desc, gomp_copy_from_async)
	(gomp_unmap_vars, gomp_init_device, gomp_init_tables)
	(gomp_free_memmap, gomp_fini_device): New declarations.
	(gomp_vdebug, gomp_debug): New macros.
	Include "splay-tree.h".
	* libgomp.map (OACC_2.0): New symbol version.  Use for
	acc_get_num_devices, acc_get_num_devices_h_, acc_set_device_type,
	acc_set_device_type_h_, acc_get_device_type,
	acc_get_device_type_h_, acc_set_device_num, acc_set_device_num_h_,
	acc_get_device_num, acc_get_device_num_h_, acc_async_test,
	acc_async_test_h_, acc_async_test_all, acc_async_test_all_h_,
	acc_wait, acc_wait_h_, acc_wait_async, acc_wait_async_h_,
	acc_wait_all, acc_wait_all_h_, acc_wait_all_async,
	acc_wait_all_async_h_, acc_init, acc_init_h_, acc_shutdown,
	acc_shutdown_h_, acc_on_device, acc_on_device_h_, acc_malloc,
	acc_free, acc_copyin, acc_copyin_32_h_, acc_copyin_64_h_,
	acc_copyin_array_h_, acc_present_or_copyin,
	acc_present_or_copyin_32_h_, acc_present_or_copyin_64_h_,
	acc_present_or_copyin_array_h_, acc_create, acc_create_32_h_,
	acc_create_64_h_, acc_create_array_h_, acc_present_or_create,
	acc_present_or_create_32_h_, acc_present_or_create_64_h_,
	acc_present_or_create_array_h_, acc_copyout, acc_copyout_32_h_,
	acc_copyout_64_h_, acc_copyout_array_h_, acc_delete,
	acc_delete_32_h_, acc_delete_64_h_, acc_delete_array_h_,
	acc_update_device, acc_update_device_32_h_,
	acc_update_device_64_h_, acc_update_device_array_h_,
	acc_update_self, acc_update_self_32_h_, acc_update_self_64_h_,
	acc_update_self_array_h_, acc_map_data, acc_unmap_data,
	acc_deviceptr, acc_hostptr, acc_is_present, acc_is_present_32_h_,
	acc_is_present_64_h_, acc_is_present_array_h_,
	acc_memcpy_to_device, acc_memcpy_from_device,
	acc_get_current_cuda_device, acc_get_current_cuda_context,
	acc_get_cuda_stream, acc_set_cuda_stream.
	(GOACC_2.0): New symbol version.  Use for GOACC_data_end,
	GOACC_data_start, GOACC_enter_exit_data, GOACC_parallel,
	GOACC_update, GOACC_wait, GOACC_get_thread_num,
	GOACC_get_num_threads.
	(GOMP_PLUGIN_1.0): New symbol version.  Use for
	GOMP_PLUGIN_malloc, GOMP_PLUGIN_malloc_cleared,
	GOMP_PLUGIN_realloc, GOMP_PLUGIN_debug, GOMP_PLUGIN_error,
	GOMP_PLUGIN_fatal, GOMP_PLUGIN_async_unmap_vars,
	GOMP_PLUGIN_acc_thread.
	* libgomp.texi: Update for OpenACC changes, and GOMP_DEBUG
	environment variable.
	* libgomp_g.h (GOACC_data_start, GOACC_data_end)
	(GOACC_enter_exit_data, GOACC_parallel, GOACC_update, GOACC_wait)
	(GOACC_get_num_threads, GOACC_get_thread_num): New declarations.
	* splay-tree.h (splay_tree_lookup, splay_tree_insert)
	(splay_tree_remove): New declarations.
	(rotate_left, rotate_right, splay_tree_splay, splay_tree_insert)
	(splay_tree_remove, splay_tree_lookup): Move into...
	* splay-tree.c: ... this new file.
	* target.c: Include "oacc-plugin.h", "oacc-int.h", <assert.h>.
	(splay_tree_node, splay_tree, splay_tree_key)
	(struct target_mem_desc, struct splay_tree_key_s)
	(struct gomp_device_descr): Don't declare.
	(num_devices_openmp): New variable.
	(gomp_get_num_devices ): Use it.
	(gomp_init_targets_once): New function.
	(gomp_get_num_devices ): Use it.
	(get_kind, gomp_copy_from_async, gomp_free_memmap)
	(gomp_fini_device, gomp_register_image_for_device): New functions.
	(gomp_map_vars): Add devaddrs parameter.
	(gomp_update): Add mm parameter.
	(gomp_init_device): Move most of it into...
	(gomp_init_tables): ... this new function.
	(gomp_register_images_for_device): Remove function.
	(splay_compare, gomp_map_vars, gomp_unmap_vars, gomp_init_device):
	Make them hidden instead of static.
	(gomp_map_vars_existing, gomp_map_vars, gomp_unmap_vars)
	(gomp_update, gomp_init_device, GOMP_target, GOMP_target_data)
	(GOMP_target_end_data, GOMP_target_update)
	(gomp_load_plugin_for_device, gomp_target_init): Update for
	OpenACC changes.
	* oacc-async.c: New file.
	* oacc-cuda.c: Likewise.
	* oacc-host.c: Likewise.
	* oacc-init.c: Likewise.
	* oacc-int.h: Likewise.
	* oacc-mem.c: Likewise.
	* oacc-parallel.c: Likewise.
	* oacc-plugin.c: Likewise.
	* oacc-plugin.h: Likewise.
	* oacc-ptx.h: Likewise.
	* openacc.f90: Likewise.
	* openacc.h: Likewise.
	* openacc_lib.h: Likewise.
	* plugin/plugin-host.c: Likewise.
	* plugin/plugin-nvptx.c: Likewise.
	* libgomp-plugin.c: Likewise.
	* libgomp-plugin.h: Likewise.
	* libgomp_target.h: Remove file after merging content into the
	former file.  Update all users.
	* testsuite/lib/libgomp.exp: Load libgomp-test-support.exp.
	(offload_targets_s, offload_targets_s_openacc): New variables.
	(check_effective_target_openacc_nvidia_accel_present)
	(check_effective_target_openacc_nvidia_accel_selected): New
	procedures.
	(libgomp_init): Update for OpenACC changes.
	* testsuite/libgomp-test-support.exp.in: New file.
	* testsuite/libgomp.oacc-c++/c++.exp: Likewise.
	* testsuite/libgomp.oacc-c/c.exp: Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/abort-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/abort-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/abort-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/abort-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_on_device-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/cache-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/clauses-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/clauses-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/collapse-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/collapse-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/collapse-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/collapse-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/context-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/context-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/context-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/context-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-1.c: Likewise.
	* 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/deviceptr-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/if-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-empty.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-10.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-11.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-12.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-13.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-14.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-15.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-16.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-17.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-18.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-19.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-20.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-21.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-22.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-23.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-24.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-25.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-26.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-27.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-28.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-29.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-30.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-31.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-32.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-33.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-34.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-35.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-36.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-37.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-38.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-39.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-40.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-41.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-43.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-44.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-45.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-46.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-47.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-48.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-49.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-5.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-50.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-51.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-52.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-53.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-54.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-55.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-56.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-57.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-58.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-59.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-6.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-60.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-61.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-62.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-63.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-64.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-65.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-66.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-67.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-68.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-69.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-7.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-70.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-71.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-72.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-73.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-74.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-75.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-76.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-77.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-78.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-79.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-80.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-81.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-82.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-83.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-84.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-85.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-86.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-87.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-88.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-89.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-9.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-90.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-91.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-92.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/nested-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/nested-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/offset-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-empty.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/pointer-align-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/present-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/present-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/subr.h: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/subr.ptx: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/timer.h: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/update-1-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/update-1.c: 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/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/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/data-already-1.f: Likewise.
	* 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-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-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/openacc_version-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/openacc_version-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/pointer-align-1.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/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/subarrays-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/subarrays-2.f90: Likewise.
	liboffloadmic/
	* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_get_name)
	(GOMP_OFFLOAD_get_caps, GOMP_OFFLOAD_fini_device): New functions.

Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com>
Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
Co-Authored-By: Dmitry Bocharnikov <dmitry.b@samsung.com>
Co-Authored-By: Evgeny Gavrin <e.gavrin@samsung.com>
Co-Authored-By: Ilmir Usmanov <i.usmanov@samsung.com>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
Co-Authored-By: James Norris <jnorris@codesourcery.com>
Co-Authored-By: Julian Brown <julian@codesourcery.com>
Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
Co-Authored-By: Tobias Burnus <burnus@net-b.de>
Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r219682
2015-01-15 21:11:12 +01:00
Thomas Schwinge f1f3453e11 libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library.
libgomp/
	* configure.ac: Rename libgomp from "GNU OpenMP Runtime Library"
	to "GNU Offloading and Multi Processing Runtime Library".  Change
	all users.
	* configure: Regenerate.
	* libgomp.texi: Update.
	gcc/
	* doc/install.texi: Update for libgomp being renamed from "GNU
	OpenMP Runtime Library" to "GNU Offloading and Multi Processing
	Runtime Library".
	* doc/sourcebuild.texi: Likewise.
	gcc/fortran/
	* gfortran.texi: Update for libgomp being renamed from "GNU OpenMP
	Runtime Library" to "GNU Offloading and Multi Processing Runtime
	Library".
	* intrinsic.texi: Likewise.
	libstdc++-v3/
	* doc/xml/manual/parallel_mode.xml: Update for libgomp being
	renamed from "GNU OpenMP Runtime Library" to "GNU Offloading and
	Multi Processing Runtime Library".

Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
Co-Authored-By: Julian Brown <julian@codesourcery.com>

From-SVN: r219425
2015-01-10 20:10:37 +01:00
Thomas Schwinge b335ef4e99 libgomp: Fix 32-bit x86 Intel MIC offloading testing.
[...]
    spawn [...]/build-gcc/gcc/xgcc -B[...]/build-gcc/gcc/ [...]/source-gcc/libgomp/testsuite/libgomp.c/examples-4/e.50.1.c -B[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp/ -B[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp/.libs -I[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp -I[...]/source-gcc/libgomp/testsuite/.. -march=i486 -fmessage-length=0 -fno-diagnostics-show-caret -fdiagnostics-color=never -B[...]/install/offload-x86_64-intelmicemul-linux-gnu/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0 -B[...]/install/offload-x86_64-intelmicemul-linux-gnu/bin -fopenmp -O2 -L[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp/.libs -lm -m32 -o ./e.50.1.exe
    PASS: libgomp.c/examples-4/e.50.1.c (test for excess errors)
    Setting LD_LIBRARY_PATH to .:[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp/../liboffloadmic/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp/../liboffloadmic/plugin/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp/../libstdc++-v3/src/.libs:[...]/install/offload-x86_64-intelmicemul-linux-gnu/lib64:[...]/install/offload-x86_64-intelmicemul-linux-gnu/lib:[...]/build-gcc/gcc:[...]/build-gcc/gcc/32:.:[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp/../liboffloadmic/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp/../liboffloadmic/plugin/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/32/libgomp/../libstdc++-v3/src/.libs:[...]/install/offload-x86_64-intelmicemul-linux-gnu/lib64:[...]/install/offload-x86_64-intelmicemul-linux-gnu/lib:[...]/build-gcc/gcc:[...]/build-gcc/gcc/32:[...]/build-gcc/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/libsanitizer/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/libvtv/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/libcilkrts/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/liboffloadmic/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/libssp/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/libgomp/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/libitm/.libs:[...]/build-gcc/x86_64-unknown-linux-gnu/libatomic/.libs:[...]/build-gcc/./gcc:[...]/build-gcc/./prev-gcc
    spawn [open ...]
    /tmp/offload_WCXKRZ/offload_target_main: error while loading shared libraries: liboffloadmic_target.so.5: wrong ELF class: ELFCLASS64
    WARNING: program timed out.
    FAIL: libgomp.c/examples-4/e.50.1.c execution test
    [...]

    $ find -name liboffloadmic_target.so.5
    ./install/offload-x86_64-intelmicemul-linux-gnu/lib64/liboffloadmic_target.so.5
    ./install/offload-x86_64-intelmicemul-linux-gnu/lib32/liboffloadmic_target.so.5
    ./build-gcc-offload-x86_64-intelmicemul-linux-gnu/x86_64-intelmicemul-linux-gnu/32/liboffloadmic/.libs/liboffloadmic_target.so.5
    ./build-gcc-offload-x86_64-intelmicemul-linux-gnu/x86_64-intelmicemul-linux-gnu/liboffloadmic/.libs/liboffloadmic_target.so.5

This is a "standard" GCC configuration: x86_64-intelmicemul-linux-gnu with
(default) multilibs enabled.

	libgomp/
	* configure.ac [tgt_dir] (offload_additional_lib_paths): Also add
	"$tgt_dir/lib32".
	* configure: Regenerate.

From-SVN: r219349
2015-01-08 17:01:37 +01:00
Thomas Schwinge f9a0eca40d libgomp: Fix "intelmic" offloading in build-tree testing.
libgomp/
	* testsuite/lib/libgomp.exp (libgomp_init): Correctly match
	"intelmic" in $offload_targets.

From-SVN: r219348
2015-01-08 17:01:24 +01:00
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Jakub Jelinek b67cd4e331 gcc.c (process_command): Update copyright notice dates.
gcc/
	* gcc.c (process_command): Update copyright notice dates.
	* gcov-dump.c: Ditto.
	* gcov.c: 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/go/
	* gccgo.texi: Bump @copyrights-go year.
gcc/java/
	* jcf-dump.c (version): Update copyright notice dates.
libgomp/
	* libgomp.texi: Bump @copying's copyright year.
libquadmath/
	* libquadmath.texi: Bump @copying's copyright year.
libitm/
	* libitm.texi: Bump @copying's copyright year.
gcc/ada/
	* gnat_ugn.texi: Bump @copying's copyright year.
libjava/
	* classpath/gnu/java/rmi/registry/RegistryImpl.java (version): Update
	copyright notice dates.
	* classpath/tools/gnu/classpath/tools/orbd/Main.java (run): Ditto.
	* gnu/gcj/convert/Convert.java (version): Update copyright notice
	dates.
	* gnu/gcj/tools/gcj_dbtool/Main.java (main): Ditto.

From-SVN: r219187
2015-01-05 13:05:46 +01:00
Kyrylo Tkachov 3b41b58357 [libgomp][testsuite] Explicitly include target-utils.exp (fix libgomp testsuite ERROR)
* testsuite/lib/libgomp.exp: Load target-utils.exp.
	Move load of target-supportes.exp earlier.

From-SVN: r218662
2014-12-12 10:31:44 +00:00
Ilya Verbin 2354caecd9 Force output of vars with "omp declare target" attribute in gcc/varpool.c
gcc/
	* varpool.c (varpool_node::get_create): Force output of vars with
	"omp declare target" attribute.
libgomp/
	* testsuite/libgomp.c/target-9.c: New test.

From-SVN: r218607
2014-12-10 20:52:10 +00:00
Varvara Rainchik f50eecba13 config.h.in: Regenerate.
libgomp/
        * config.h.in: Regenerate.
        * configure: Regenerate.
        * configure.ac: Add GCC_CHECK_EMUTLS.
        * libgomp.h: Add check for USE_EMUTLS: this case
        is equal to HAVE_TLS.
        * team.c: Likewise.

From-SVN: r218576
2014-12-10 13:42:20 +00:00
Uros Bizjak 68bc92704f configure.tgt (x86_64): Tune -m32 multilib to generic.
libitm/ChangeLog:

	* configure.tgt (x86_64): Tune -m32 multilib to generic.

libgomp/ChangeLog:

	* configure.tgt (x86_64-*-linux*): Tune -m32 multilib to generic.

From-SVN: r218315
2014-12-03 14:58:07 +01:00
Andrey Turetskiy 476ff78736 omp-low.c (lower_omp_critical): Mark critical sections inside target functions as offloadable.
gcc/
	* omp-low.c (lower_omp_critical): Mark critical sections
	inside target functions as offloadable.
libgomp/
	* testsuite/libgomp.c/target-critical-1.c: New test.

Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com>

From-SVN: r218158
2014-11-28 13:59:49 +00:00
Jakub Jelinek 31a30e6234 e.53.4.c: Add -DITESTITERS=20 to dg-options unless expensive testing is on.
* testsuite/libgomp.c/examples-4/e.53.4.c: Add -DITESTITERS=20
	to dg-options unless expensive testing is on.  
	(TESTITERS): Define to N if not defined.
	(main): Use TESTITERS instead of N.
	* testsuite/libgomp.c/examples-4/e.55.1.c: Define CHUNKSZ from
	dg-additional-options depending on whether expensive testing is on.
	* testsuite/libgomp.fortran/examples-4/e.55.1.f90 (e_55_1_mod):
	Decrease N to 100000 and CHUNKSZ to 10000.

From-SVN: r218095
2014-11-26 20:36:36 +01:00
Jakub Jelinek 3f9e8f13a3 re PR fortran/63938 (OpenMP atomic update does not protect access to automatic array)
PR fortran/63938
	* trans-openmp.c (gfc_trans_omp_atomic): Make sure lhsaddr is
	simple enough for goa_lhs_expr_p.

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

From-SVN: r218031
2014-11-25 00:08:26 +01:00
Steve Ellcey c8451a46ea futex.h (SYS_futex): Define if not already done.
2014-11-21  Steve Ellcey  <sellcey@imgtec.com>

	* config/linux/mips/futex.h (SYS_futex): Define if not already done.

From-SVN: r217952
2014-11-21 23:25:51 +00:00
H.J. Lu a699d67255 Always use PIC option with -shared in libtool
Libtool needs to pass PIC option -shared when creating shared object to
link regular object files with slim-lto archive.

	PR bootstrap/63784
	* libtool.m4: Add $pic_flag with -shared.

boehm-gc/

	PR bootstrap/63784
	* configure: Regenerated.

gcc/

	PR bootstrap/63784
	* configure: Regenerated.

libatomic/

	PR bootstrap/63784
	* configure: Regenerated.

libbacktrace/

	PR bootstrap/63784
	* configure: Regenerated.

libcc1/

	PR bootstrap/63784
	* configure: Regenerated.

libcilkrts/

	PR bootstrap/63784
	* configure: Regenerated.

libffi/

	PR bootstrap/63784
	* configure: Regenerated.

libgfortran/

	PR bootstrap/63784
	* configure: Regenerated.

libgomp/

	PR bootstrap/63784
	* configure: Regenerated.

libitm/

	PR bootstrap/63784
	* configure: Regenerated.

libjava/

	PR bootstrap/63784
	* configure: Regenerated.

libjava/classpath/

	PR bootstrap/63784
	* configure: Regenerated.

libobjc/

	PR bootstrap/63784
	* configure: Regenerated.

libquadmath/

	PR bootstrap/63784
	* configure: Regenerated.

libsanitizer/

	PR bootstrap/63784
	* configure: Regenerated.

libssp/

	PR bootstrap/63784
	* configure: Regenerated.

libstdc++-v3/

	PR bootstrap/63784
	* configure: Regenerated.

libvtv/

	PR bootstrap/63784
	* configure: Regenerated.

lto-plugin/

	PR bootstrap/63784
	* configure: Regenerated.

From-SVN: r217937
2014-11-21 08:49:17 -08:00
Uros Bizjak 4a19f719d6 e.53.5.c: Require vect_simd_clones effective target.
* testsuite/libgomp.c/examples-4/e.53.5.c: Require
	vect_simd_clones effective target.
	* testsuite/libgomp.fortran/examples-4/e.53.5.f90: Ditto.

From-SVN: r217760
2014-11-19 11:30:29 +01:00
Jakub Jelinek b1bf6c522f e.54.2.c (main): Use N / 8 instead of 32 as block_size.
* libgomp.c/examples-4/e.54.2.c (main): Use N / 8 instead
	of 32 as block_size.
	* libgomp.fortran/examples-4/e.54.2.f90 (e_54_1): Use n / 8
	instead of 32 as block_size.

From-SVN: r217579
2014-11-14 18:19:55 +01:00
Andrey Turetskiy d64ae6140f [PATCH 4/4] OpenMP 4.0 offloading to Intel MIC: non-fallback testing.
libgomp/
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Set up offload_additional_options,
	offload_additional_lib_paths and offload_targets.
	* testsuite/Makefile.am: Export environment variables: OFFLOAD_TARGETS,
	OFFLOAD_ADDITIONAL_OPTIONS, OFFLOAD_ADDITIONAL_LIB_PATHS.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/lib/libgomp.exp (libgomp_init): Append
	offload_additional_lib_paths to LD_LIBRARY_PATH.  Append
	offload_additional_options to ALWAYS_CFLAGS.  Append liboffloadmic
	build directory to LD_LIBRARY_PATH for intelmic offload targets.

Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com>

From-SVN: r217500
2014-11-13 14:07:09 +00:00
Andrey Turetskiy 122d7303a0 [PATCH 7/7] OpenMP 4.0 offloading infrastructure: testsuite.
libgomp/
	* testsuite/lib/libgomp.exp
	(check_effective_target_offload_device): New.
	* testsuite/libgomp.c++/c++.exp: Include tests from subdirectories.
	* testsuite/libgomp.c++/examples-4/e.51.5.C: New test.
	* testsuite/libgomp.c++/examples-4/e.53.2.C: Ditto.
	* testsuite/libgomp.c/examples-4/e.50.1.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.50.2.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.50.3.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.50.4.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.50.5.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.51.1.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.51.2.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.51.3.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.51.4.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.51.6.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.51.7.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.52.1.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.52.2.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.53.1.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.53.3.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.53.4.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.53.5.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.54.2.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.54.3.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.54.4.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.54.5.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.54.6.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.55.1.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.55.2.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.56.3.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.56.4.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.57.1.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.57.2.c: Ditto.
	* testsuite/libgomp.c/examples-4/e.57.3.c: Ditto.
	* testsuite/libgomp.c/target-7.c: Fix test.
	* testsuite/libgomp.fortran/examples-4/e.50.1.f90: New test.
	* testsuite/libgomp.fortran/examples-4/e.50.2.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.50.3.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.50.4.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.50.5.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.51.1.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.51.2.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.51.3.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.51.4.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.51.5.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.51.6.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.51.7.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.52.1.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.52.2.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.53.1.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.53.2.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.53.3.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.53.4.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.53.5.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.54.2.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.54.3.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.54.4.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.54.5.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.54.6.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.55.1.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.55.2.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.56.3.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.56.4.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.57.1.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.57.2.f90: Ditto.
	* testsuite/libgomp.fortran/examples-4/e.57.3.f90: Ditto.

Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com>
Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com>
Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com>

From-SVN: r217494
2014-11-13 13:56:22 +00:00
Jakub Jelinek 1df3f84256 [PATCH 5/7] OpenMP 4.0 offloading infrastructure: libgomp.
libgomp/
	* libgomp.map (GOMP_4.0.1): New symbol version.
	Add GOMP_offload_register.
	* libgomp_target.h: New file.
	* splay-tree.h: New file.
	* target.c: Include config.h, libgomp_target.h, dlfcn.h, splay-tree.h.
	(gomp_target_init): New forward declaration.
	(gomp_is_initialized): New static variable.
	(splay_tree_node, splay_tree, splay_tree_key): New typedefs.
	(struct target_mem_desc, struct splay_tree_key_s, offload_image_descr):
	New structures.
	(offload_images, num_offload_images, devices, num_devices): New static
	variables.
	(splay_compare): New static function.
	(struct gomp_device_descr): New structure.
	(gomp_get_num_devices): Call gomp_target_init.
	(resolve_device, gomp_map_vars_existing, gomp_map_vars, gomp_unmap_tgt)
	(gomp_unmap_vars, gomp_update, gomp_init_device): New static functions.
	(GOMP_offload_register): New function.
	(GOMP_target): Arrange for host callback to be performed in a separate
	initial thread and contention group, inheriting ICVs from
	gomp_global_icv etc.  Call gomp_map_vars and gomp_unmap_vars.
	Add device initialization and lookup for target function in splay tree.
	(GOMP_target_data): Add device initialization and call gomp_map_vars.
	(GOMP_target_end_data): Call gomp_unmap_vars.
	(GOMP_target_update): Add device initialization and call gomp_update.
	(gomp_load_plugin_for_device, gomp_register_images_for_device)
	(gomp_target_init): New static functions.

Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com>
Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com>
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>

From-SVN: r217492
2014-11-13 13:49:47 +00:00
Bernd Schmidt 85c64bbee9 [PATCH 1/7] OpenMP 4.0 offloading infrastructure: configure and make
* configure: Regenerate.
	* configure.ac (--enable-as-accelerator-for)
	(--enable-offload-targets): New configure options.
gcc/
	* Makefile.in (real_target_noncanonical, accel_dir_suffix)
	(enable_as_accelerator): New variables substituted by configure.
	(libsubdir, libexecsubdir, unlibsubdir): Tweak for the possibility of
	being configured as an offload compiler.
	(DRIVER_DEFINES): Pass new defines DEFAULT_REAL_TARGET_MACHINE and
	ACCEL_DIR_SUFFIX.
	(install-cpp, install-common, install_driver, install-gcc-ar): Do not
	install for the offload compiler.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (real_target_noncanonical, accel_dir_suffix)
	(enable_as_accelerator): Compute new variables.
	(ACCEL_COMPILER): Define if the compiler is built as the accel compiler.
	(OFFLOAD_TARGETS): List of target names suitable for offloading.
	(ENABLE_OFFLOADING): Define if list of offload targets is not empty.
gcc/cp/
	* Make-lang.in (c++.install-common): Do not install for the offload
	compiler.
gcc/doc/
	* install.texi (Options specification): Document
	--enable-as-accelerator-for and --enable-offload-targets.
gcc/fortran/
	* Make-lang.in (fortran.install-common): Do not install for the offload
	compiler.
libgcc/
	* Makefile.in (crtoffloadbegin$(objext)): New rule.
	(crtoffloadend$(objext)): Likewise.
	* configure: Regenerate.
	* configure.ac (accel_dir_suffix): Compute new variable.
	(extra_parts): Add crtoffloadbegin.o and crtoffloadend.o
	if enable_offload_targets is not empty.
	* offloadstuff.c: New file.
libgomp/
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Check for libdl, required for plugin support.
	(PLUGIN_SUPPORT): Define if plugins are supported.
	(enable_offload_targets): Support Intel MIC targets.
	(OFFLOAD_TARGETS): List of target names suitable for offloading.
lto-plugin/
	* Makefile.am (libexecsubdir): Tweak for the possibility of being
	configured for offload compiler.
	(accel_dir_suffix, real_target_noncanonical): New variables substituted
	by configure.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (accel_dir_suffix, real_target_noncanonical): Compute new
	variables.


Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com>
Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com>
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>

From-SVN: r217485
2014-11-13 13:28:56 +00:00
Francois-Xavier Coudert ebf6d33b73 re PR target/63610 (Fixing the libtool bug for Yosemite (darwin14))
toplevel:
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* libtool.m4: Fix globbing of darwin versions.

boehm-gc/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

gcc/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libatomic/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libbacktrace/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libcc1/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libcilkrts/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libffi/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libgfortran/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libgomp/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libitm/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libobjc/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libquadmath/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libsanitizer/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libssp/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libstdc++-v3/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libvtv/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

lto-plugin/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libjava/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

libjava/classpath/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

zlib/
2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

	PR target/63610
	* configure: Regenerate.

From-SVN: r217366
2014-11-11 20:25:18 +00:00
Rainer Orth 8c7686294e Fix gnu11 fallout on Solaris 10+
libobjc:
	* thr.c (_XOPEN_SOURCE): Define as 600.

	libiberty:
	* sigsetmask.c (_POSIX_SOURCE): Remove.

	libgomp:
	* config/posix/lock.c (_XOPEN_SOURCE) Define as 600.

From-SVN: r217117
2014-11-05 09:52:42 +00:00
Marek Polacek c1d62412c3 affinity-1.c: Include <sys/wait.h>.
* testsuite/libgomp.c/affinity-1.c: Include <sys/wait.h>.
	* testsuite/libgomp.c/nqueens-1.c: Include <stdlib.h>.
	* testsuite/libgomp.c/thread-limit-1.c: Include <omp.h>
	* testsuite/libgomp.c/thread-limit-2.c: Likewise.

From-SVN: r215927
2014-10-06 11:54:24 +00:00
Marek Polacek 44a0c6cbeb affinity-1.c: Fix implicit declarations.
* testsuite/libgomp.c/affinity-1.c: Fix implicit declarations.
	* testsuite/libgomp.c/nqueens-1.c: Likewise.
	* testsuite/libgomp.c/pr26943-3.c: Likewise.
	* testsuite/libgomp.c/pr26943-4.c: Likewise.
	* testsuite/libgomp.c/pr36802-2.c: Likewise.
	* testsuite/libgomp.c/pr36802-3.c: Likewise.
	* testsuite/libgomp.c/thread-limit-1.c: Likewise.
	* testsuite/libgomp.c/thread-limit-2.c: Likewise.
	* testsuite/libgomp.c/appendix-a/a.15.1.c: Include <omp.h>.
	* testsuite/libgomp.c/omp-loop02.c: Fix defaulting to int.
	* testsuite/libgomp.c/omp-parallel-for.c: Likewise.
	* testsuite/libgomp.c/omp-parallel-if.c: Likewise.
	* testsuite/libgomp.c/omp-single-1.c: Likewise.
	* testsuite/libgomp.c/omp-single-2.c: Likewise.
	* testsuite/libgomp.c/omp_matvec.c: Likewise.
	* testsuite/libgomp.c/omp_workshare3.c: Likewise.
	* testsuite/libgomp.c/omp_workshare4.c: Likewise.
	* testsuite/libgomp.c/shared-1.c: Fix defaulting to int.  Fix implicit
	declarations.

From-SVN: r215922
2014-10-06 10:20:45 +00:00
Jakub Jelinek 5771c3915b re PR libgomp/61200 (internal compiler error: Segmentation fault, assert & openmp)
PR libgomp/61200
	* omp-low.c (taskreg_contexts): New variable.
	(scan_omp_parallel): Push newly created context into taskreg_contexts
	vector and move record layout code to finish_taskreg_scan.
	(scan_omp_task): Likewise.
	(finish_taskreg_scan): New function.
	(execute_lower_omp): Call finish_taskreg_scan on all taskreg_contexts
	vector elements and release it.

	* c-c++-common/gomp/pr61200.c: New test.

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

From-SVN: r215835
2014-10-03 09:29:42 +02:00
Jakub Jelinek bce16b887f re PR c++/63248 (Crash when OpenMP target's array section handling is used with templates)
PR c++/63248
	* semantics.c (finish_omp_clauses): Don't call cp_omp_mappable_type
	on type of type dependent expressions, and don't call it if
	handle_omp_array_sections has kept TREE_LIST because something
	was type dependent.
	* pt.c (tsubst_expr) <case OMP_TARGET, case OMP_TARGET_DATA>:
	Use keep_next_level, begin_omp_structured_block and
	finish_omp_structured_block instead of push_stmt_list and
	pop_stmt_list.
libgomp/
	* testsuite/libgomp.c++/pr63248.C: New test.

From-SVN: r215359
2014-09-18 18:43:28 +02:00
Jakub Jelinek 3696163cb4 task.c (GOMP_taskgroup_end): If taskgroup->num_children is not zero...
* task.c (GOMP_taskgroup_end): If taskgroup->num_children
	is not zero, but taskgroup->children is NULL and there are
	any task->children, schedule those instead of waiting.
	* testsuite/libgomp.c/depend-6.c: New test.
	* testsuite/libgomp.c/depend-7.c: New test.
	* testsuite/libgomp.c/depend-8.c: New test.
	* testsuite/libgomp.c/depend-9.c: New test.
	* testsuite/libgomp.c/depend-10.c: New test.

From-SVN: r213592
2014-08-04 17:45:50 +02:00
Jakub Jelinek 0494285ab0 libgomp.h (struct gomp_task_depend_entry): Add redundant_out field.
* libgomp.h (struct gomp_task_depend_entry): Add redundant_out field.
	(struct gomp_taskwait): New type.
	(struct gomp_task): Add taskwait and parent_depends_on, remove
	in_taskwait and taskwait_sem fields.
	(gomp_finish_task): Don't destroy taskwait_sem.
	* task.c (gomp_init_task): Don't init in_taskwait, instead init
	taskwait and parent_depends_on.
	(GOMP_task): For if (0) tasks with depend clause that depend on
	earlier tasks don't defer them, instead call
	gomp_task_maybe_wait_for_dependencies to wait for the dependencies.
	Initialize redundant_out field, for redundant out entries just
	move them at the end of linked list instead of removing them
	completely, and set redundant_out flag instead of redundant.
	(gomp_task_run_pre): Update last_parent_depends_on if scheduling
	that task.
	(gomp_task_run_post_handle_dependers): If parent is in
	gomp_task_maybe_wait_for_dependencies and newly runnable task
	is not parent_depends_on, queue it in parent->children linked
	list after all runnable tasks with parent_depends_on set.
	Adjust for addition of taskwait indirection.
	(gomp_task_run_post_remove_parent): If parent is in
	gomp_task_maybe_wait_for_dependencies and task to be removed
	is parent_depends_on, decrement n_depend and if needed awake
	parent.  Adjust for addition of taskwait indirection.
	(GOMP_taskwait): Adjust for addition of taskwait indirection.
	(gomp_task_maybe_wait_for_dependencies): New function.
	* testsuite/libgomp.c/depend-5.c: New test.

From-SVN: r213408
2014-08-01 10:05:13 +02:00
Tobias Burnus 60ab4b449c pr34020.f90: Make compile with TS 18508/Fortran 2015
2014-07-13  Tobias Burnus  <burnus@net-b.de>

        * testsuite/libgomp.fortran/pr34020.f90: Make compile
        with TS 18508/Fortran 2015

From-SVN: r212490
2014-07-13 08:40:16 +02:00
Marek Polacek 773ec47fe6 re PR c/6940 (taking sizeof array parameter should trigger a warning)
PR c/6940
	* doc/invoke.texi: Document -Wsizeof-array-argument.
c-family/
	* c.opt (Wsizeof-array-argument): New option.
c/
	* c-decl.c (grokdeclarator): Set C_ARRAY_PARAMETER.
	* c-tree.h (C_ARRAY_PARAMETER): Define.
	* c-typeck.c (c_expr_sizeof_expr): Warn when using sizeof on an array
	function parameter.
cp/
	* cp-tree.h (DECL_ARRAY_PARAMETER_P): Define.
	* decl.c (grokdeclarator): Set DECL_ARRAY_PARAMETER_P.
	* typeck.c (cxx_sizeof_expr): Warn when using sizeof on an array
	function parameter.
testsuite/
	* c-c++-common/Wsizeof-pointer-memaccess1.c: Use
	-Wno-sizeof-array-argument.
	* c-c++-common/Wsizeof-pointer-memaccess2.c: Likewise.
	* g++.dg/warn/Wsizeof-pointer-memaccess-1.C: Likewise.
	* gcc.dg/Wsizeof-pointer-memaccess1.c: Likewise.
	* g++.dg/torture/Wsizeof-pointer-memaccess1.C: Likewise.
	* g++.dg/torture/Wsizeof-pointer-memaccess2.C: Likewise.
	* gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Likewise.
	* c-c++-common/sizeof-array-argument.c: New test.
	* gcc.dg/vla-5.c: Add dg-warnings.
../libgomp/	* testsuite/libgomp.c/appendix-a/a.29.1.c (f): Add dg-warnings.

From-SVN: r212312
2014-07-06 19:00:10 +00:00
Thomas Schwinge a03bd0056c Normalize interface for all *-dg-runtest.
gcc/testsuite/
	* lib/g++-dg.exp (g++-dg-runtest): Change interface to match
	dg-runtest's.  Adapt all callers.
	* lib/gcc-dg.exp (gcc-dg-runtest): Likewise.
	* lib/gfortran-dg.exp (gfortran-dg-runtest): Likewise.
	* lib/go-dg.exp (go-dg-runtest): Likewise.
	* lib/obj-c++-dg.exp (obj-c++-dg-runtest): Likewise.
	* lib/objc-dg.exp (objc-dg-runtest): Likewise.
	libffi/
	* testsuite/lib/libffi.exp (libffi-dg-runtest): Change interface
	match to dg-runtest's.

From-SVN: r212278
2014-07-04 07:28:17 +02:00
Jakub Jelinek f707da16f7 libgomp.exp (libgomp_target_compile): If $source matches regex $lang_source_re, add $lang_include_flags to options.
* testsuite/lib/libgomp.exp (libgomp_target_compile): If $source
	matches regex $lang_source_re, add $lang_include_flags to options.
	* testsuite/libgomp.c/c.exp: Unset lang_include_flags.
	* testsuite/libgomp.c++/c++.exp: Likewise.
	* testsuite/libgomp.fortran/fortran.exp: Likewise.  Set lang_source_re
	and lang_include_flags instead of adding -fintrinsic-modules-path= to
	ALWAYS_CFLAGS.
	* testsuite/libgomp.graphite/graphite.exp: Unset lang_include_flags.

From-SVN: r212268
2014-07-03 20:45:35 +02:00
Thomas Schwinge 07b6c04483 Explain gfortran-dg-runtest usage in libgomp Fortran testing.
libgomp/
	* testsuite/libgomp.fortran/fortran.exp: Explain
	gfortran-dg-runtest usage.

From-SVN: r212266
2014-07-03 17:23:43 +02:00
Jakub Jelinek da6f124d8a langhooks-def.h (LANG_HOOKS_OMP_CLAUSE_LINEAR_CTOR): Define.
* langhooks-def.h (LANG_HOOKS_OMP_CLAUSE_LINEAR_CTOR): Define.
	(LANG_HOOKS_DECLS): Add it.
	* gimplify.c (gimplify_omp_for): Make sure OMP_CLAUSE_LINEAR_STEP
	has correct type.
	* tree.h (OMP_CLAUSE_LINEAR_ARRAY): Define.
	* langhooks.h (struct lang_hooks_for_decls): Add
	omp_clause_linear_ctor hook.
	* omp-low.c (lower_rec_input_clauses): Set max_vf even if
	OMP_CLAUSE_LINEAR_ARRAY is set.  Don't fold_convert
	OMP_CLAUSE_LINEAR_STEP.  For OMP_CLAUSE_LINEAR_ARRAY in
	combined simd loop use omp_clause_linear_ctor hook.
gcc/c/
	* c-typeck.c (c_finish_omp_clauses): Make sure
	OMP_CLAUSE_LINEAR_STEP has correct type.
gcc/cp/
	* semantics.c (finish_omp_clauses): Make sure
	OMP_CLAUSE_LINEAR_STEP has correct type.
gcc/fortran/
	* trans.h (gfc_omp_clause_linear_ctor): New prototype.
	* trans-openmp.c (gfc_omp_linear_clause_add_loop,
	gfc_omp_clause_linear_ctor): New functions.
	(gfc_trans_omp_clauses): Make sure OMP_CLAUSE_LINEAR_STEP has
	correct type.  Set OMP_CLAUSE_LINEAR_ARRAY flag if needed.
	* f95-lang.c (LANG_HOOKS_OMP_CLAUSE_LINEAR_CTOR): Redefine.
libgomp/
	* testsuite/libgomp.fortran/simd5.f90: New test.
	* testsuite/libgomp.fortran/simd6.f90: New test.
	* testsuite/libgomp.fortran/simd7.f90: New test.

From-SVN: r211971
2014-06-25 11:16:12 +02:00
Jakub Jelinek 56ad0e3820 gimplify.c (gimplify_omp_for): For #pragma omp for simd iterator not mentioned in clauses use private clause if...
* gimplify.c (gimplify_omp_for): For #pragma omp for simd iterator
	not mentioned in clauses use private clause if the iterator is
	declared in #pragma omp for simd, and when adding lastprivate
	instead, add it to the outer #pragma omp for too.  Diagnose
	if the variable is private in outer context.  For simd collapse > 1
	loops, replace all iterators with temporaries.
	* omp-low.c (lower_rec_input_clauses): Handle LINEAR clause the
	same even in collapse > 1 loops.
gcc/c/
	* c-parser.c (c_parser_omp_for_loop): For
	#pragma omp parallel for simd move lastprivate clause from parallel
	to for rather than simd.
gcc/cp/
	* parser.c (cp_parser_omp_for_loop): For
	#pragma omp parallel for simd move lastprivate clause from parallel
	to for rather than simd.
libgomp/
	* testsuite/libgomp.c/for-2.c: Define SC to static for
	#pragma omp for simd testing.
	* testsuite/libgomp.c/for-2.h (SC): Define if not defined.
	(N(f5), N(f6), N(f7), N(f8), N(f10), N(f12), N(f14)): Use
	SC macro.
	* testsuite/libgomp.c/simd-14.c: New test.
	* testsuite/libgomp.c/simd-15.c: New test.
	* testsuite/libgomp.c/simd-16.c: New test.
	* testsuite/libgomp.c/simd-17.c: New test.
	* testsuite/libgomp.c++/for-10.C: Define SC to static for
	#pragma omp for simd testing.
	* testsuite/libgomp.c++/simd10.C: New test.
	* testsuite/libgomp.c++/simd11.C: New test.
	* testsuite/libgomp.c++/simd12.C: New test.
	* testsuite/libgomp.c++/simd13.C: New test.

From-SVN: r211930
2014-06-24 09:53:52 +02:00
Jakub Jelinek b46ebd6c7b gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_MAP, [...]): Make sure OMP_CLAUSE_SIZE is non-NULL.
* gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_MAP,
	OMP_CLAUSE_TO, OMP_CLAUSE_FROM): Make sure OMP_CLAUSE_SIZE is
	non-NULL.
	<case OMP_CLAUSE_ALIGNED>: Gimplify OMP_CLAUSE_ALIGNED_ALIGNMENT.
	(gimplify_adjust_omp_clauses_1): Make sure OMP_CLAUSE_SIZE is
	non-NULL.
	(gimplify_adjust_omp_clauses): Likewise.
	* omp-low.c (lower_rec_simd_input_clauses,
	lower_rec_input_clauses, expand_omp_simd): Handle non-constant
	safelen the same as safelen(1).
	* tree-nested.c (convert_nonlocal_omp_clauses,
	convert_local_omp_clauses): Handle OMP_CLAUSE_ALIGNED.  For
	OMP_CLAUSE_{MAP,TO,FROM} if not decl use walk_tree.
	(convert_nonlocal_reference_stmt, convert_local_reference_stmt):
	Fixup handling of GIMPLE_OMP_TARGET.
	(convert_tramp_reference_stmt, convert_gimple_call): Handle
	GIMPLE_OMP_TARGET.
gcc/fortran/
	* dump-parse-tree.c (show_omp_namelist): Use n->udr->udr instead
	of n->udr.
	* f95-lang.c (gfc_init_builtin_functions): Initialize
	BUILT_IN_ASSUME_ALIGNED.
	* gfortran.h (gfc_omp_namelist): Change udr field type to
	struct gfc_omp_namelist_udr.
	(gfc_omp_namelist_udr): New type.
	(gfc_get_omp_namelist_udr): Define.
	(gfc_resolve_code): New prototype.
	* match.c (gfc_free_omp_namelist): Free name->udr.
	* module.c (intrinsics): Add INTRINSIC_USER.
	(fix_mio_expr): Likewise.
	(mio_expr): Handle INSTRINSIC_USER and non-resolved EXPR_FUNCTION.
	* openmp.c (gfc_match_omp_clauses): Adjust initialization of n->udr.
	(gfc_match_omp_declare_reduction): Treat len=: the same as len=*.
	Set attr.flavor on omp_{out,in,priv,orig} artificial variables.
	(struct resolve_omp_udr_callback_data): New type.
	(resolve_omp_udr_callback, resolve_omp_udr_callback2,
	resolve_omp_udr_clause): New functions.
	(resolve_omp_clauses): Adjust for n->udr changes, resolve UDR clauses
	here.
	(omp_udr_callback): Don't check for implicitly declared functions
	here.
	(gfc_resolve_omp_udr): Don't call gfc_resolve.  Don't check for
	implicitly declared subroutines here.
	* resolve.c (resolve_function): If value.function.isym is non-NULL,
	consider it already resolved.
	(resolve_code): Renamed to ...
	(gfc_resolve_code): ... this.  No longer static.
	(gfc_resolve_blocks, generate_component_assignments, resolve_codes):
	Adjust callers.
	* trans-openmp.c (gfc_omp_privatize_by_reference): Don't privatize
	by reference type (C_PTR) variables.
	(gfc_omp_finish_clause): Make sure OMP_CLAUSE_SIZE is non-NULL.
	(gfc_trans_omp_udr_expr): Remove.
	(gfc_trans_omp_array_reduction_or_udr): Adjust for n->udr changes.
	Don't call gfc_trans_omp_udr_expr, even for sym->attr.dimension
	expand it as assignment or subroutine call.  Don't initialize
	value.function.isym.
gcc/testsuite/
	* gfortran.dg/gomp/udr2.f90 (f7, f9): Add !$omp parallel with
	reduction clause.
	* gfortran.dg/gomp/udr4.f90 (f4): Likewise.
	Remove Label is never defined expected error.
	* gfortran.dg/gomp/udr8.f90: New test.
libgomp/
	* testsuite/libgomp.fortran/aligned1.f03: New test.
	* testsuite/libgomp.fortran/nestedfn5.f90: New test.
	* testsuite/libgomp.fortran/target7.f90: Surround loop spawning
	tasks with !$omp parallel !$omp single.
	* testsuite/libgomp.fortran/target8.f90: New test.
	* testsuite/libgomp.fortran/udr4.f90 (foo UDR, bar UDR): Adjust
	not to use trim in the combiner, instead call elemental function.
	(fn): New elemental function.
	* testsuite/libgomp.fortran/udr6.f90 (do_add, dp_add, dp_init):
	Make elemental.
	* testsuite/libgomp.fortran/udr7.f90 (omp_priv, omp_orig, omp_out,
	omp_in): Likewise.
	* testsuite/libgomp.fortran/udr12.f90: New test.
	* testsuite/libgomp.fortran/udr13.f90: New test.
	* testsuite/libgomp.fortran/udr14.f90: New test.
	* testsuite/libgomp.fortran/udr15.f90: New test.

From-SVN: r211929
2014-06-24 09:45:22 +02:00
Jakub Jelinek f014c65363 gimplify.c (omp_notice_variable): If n is non-NULL and no flags change in ORT_TARGET region, don't jump to do_outer.
* gimplify.c (omp_notice_variable): If n is non-NULL
	and no flags change in ORT_TARGET region, don't jump to
	do_outer.
	(struct gimplify_adjust_omp_clauses_data): New type.
	(gimplify_adjust_omp_clauses_1): Adjust for data being
	a struct gimplify_adjust_omp_clauses_data pointer instead
	of tree *.  Pass pre_p as a new argument to
	lang_hooks.decls.omp_finish_clause hook.
	(gimplify_adjust_omp_clauses): Add pre_p argument, adjust
	splay_tree_foreach to pass both list_p and pre_p.
	(gimplify_omp_parallel, gimplify_omp_task, gimplify_omp_for,
	gimplify_omp_workshare, gimplify_omp_target_update): Adjust
	gimplify_adjust_omp_clauses callers.
	* langhooks.c (lhd_omp_finish_clause): New function.
	* langhooks-def.h (lhd_omp_finish_clause): New prototype.
	(LANG_HOOKS_OMP_FINISH_CLAUSE): Define to lhd_omp_finish_clause.
	* langhooks.h (struct lang_hooks_for_decls): Add a new
	gimple_seq * argument to omp_finish_clause hook.
	* omp-low.c (scan_sharing_clauses): Call scan_omp_op on
	non-DECL_P OMP_CLAUSE_DECL if ctx->outer.
	(scan_omp_parallel, lower_omp_for): When adding
	_LOOPTEMP_ clause var, add it to outer ctx's decl_map
	as identity.
	* tree-core.h (OMP_CLAUSE_MAP_TO_PSET): New map kind.
	* tree-nested.c (convert_nonlocal_omp_clauses,
	convert_local_omp_clauses): Handle various OpenMP 4.0 clauses.
	* tree-pretty-print.c (dump_omp_clause): Handle
	OMP_CLAUSE_MAP_TO_PSET.
gcc/cp/
	* cp-gimplify.c (cxx_omp_finish_clause): Add a gimple_seq *
	argument.
	* cp-tree.h (cxx_omp_finish_clause): Adjust prototype.
gcc/fortran/
	* cpp.c (cpp_define_builtins): Change _OPENMP macro to
	201307.
	* dump-parse-tree.c (show_omp_namelist): Add list_type
	argument.  Adjust for rop being u.reduction_op now,
	handle depend_op or map_op.
	(show_omp_node): Adjust callers.  Print some new
	OpenMP 4.0 clauses, adjust for OMP_LIST_DEPEND_{IN,OUT}
	becoming a single OMP_LIST_DEPEND.
	* f95-lang.c (gfc_handle_omp_declare_target_attribute): New
	function.
	(gfc_attribute_table): New variable.
	(LANG_HOOKS_OMP_FINISH_CLAUSE, LANG_HOOKS_ATTRIBUTE_TABLE): Redefine.
	* frontend-passes.c (gfc_code_walker): Handle new OpenMP target
	EXEC_OMP_* codes and new clauses.
	* gfortran.h (gfc_statement): Add ST_OMP_TARGET, ST_OMP_END_TARGET,
	ST_OMP_TARGET_DATA, ST_OMP_END_TARGET_DATA, ST_OMP_TARGET_UPDATE,
	ST_OMP_DECLARE_TARGET, ST_OMP_TEAMS, ST_OMP_END_TEAMS,
	ST_OMP_DISTRIBUTE, ST_OMP_END_DISTRIBUTE, ST_OMP_DISTRIBUTE_SIMD,
	ST_OMP_END_DISTRIBUTE_SIMD, ST_OMP_DISTRIBUTE_PARALLEL_DO,
	ST_OMP_END_DISTRIBUTE_PARALLEL_DO, ST_OMP_DISTRIBUTE_PARALLEL_DO_SIMD,
	ST_OMP_END_DISTRIBUTE_PARALLEL_DO_SIMD, ST_OMP_TARGET_TEAMS,
	ST_OMP_END_TARGET_TEAMS, ST_OMP_TEAMS_DISTRIBUTE,
	ST_OMP_END_TEAMS_DISTRIBUTE, ST_OMP_TEAMS_DISTRIBUTE_SIMD,
	ST_OMP_END_TEAMS_DISTRIBUTE_SIMD, ST_OMP_TARGET_TEAMS_DISTRIBUTE,
	ST_OMP_END_TARGET_TEAMS_DISTRIBUTE,
	ST_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD,
	ST_OMP_END_TARGET_TEAMS_DISTRIBUTE_SIMD,
	ST_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO,
	ST_OMP_END_TEAMS_DISTRIBUTE_PARALLEL_DO,
	ST_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO,
	ST_OMP_END_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO,
	ST_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD,
	ST_OMP_END_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD,
	ST_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD and
	ST_OMP_END_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD.
	(symbol_attribute): Add omp_declare_target field.
	(gfc_omp_depend_op, gfc_omp_map_op): New enums.
	(gfc_omp_namelist): Replace rop field with union
	containing reduction_op, depend_op and map_op.
	(OMP_LIST_DEPEND_IN, OMP_LIST_DEPEND_OUT): Remove.
	(OMP_LIST_DEPEND, OMP_LIST_MAP, OMP_LIST_TO, OMP_LIST_FROM): New.
	(gfc_omp_clauses): Add num_teams, device, thread_limit,
	dist_sched_kind, dist_chunk_size fields.
	(gfc_common_head): Add omp_declare_target field.
	(gfc_exec_op): Add EXEC_OMP_TARGET, EXEC_OMP_TARGET_DATA,
	EXEC_OMP_TEAMS, EXEC_OMP_DISTRIBUTE, EXEC_OMP_DISTRIBUTE_SIMD,
	EXEC_OMP_DISTRIBUTE_PARALLEL_DO, EXEC_OMP_DISTRIBUTE_PARALLEL_DO_SIMD,
	EXEC_OMP_TARGET_TEAMS, EXEC_OMP_TEAMS_DISTRIBUTE,
	EXEC_OMP_TEAMS_DISTRIBUTE_SIMD, EXEC_OMP_TARGET_TEAMS_DISTRIBUTE,
	EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD,
	EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO,
	EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO,
	EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD,
	EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD and
	EXEC_OMP_TARGET_UPDATE.
	(gfc_add_omp_declare_target): New prototype.
	* match.h (gfc_match_omp_declare_target, gfc_match_omp_distribute,
	gfc_match_omp_distribute_parallel_do,
	gfc_match_omp_distribute_parallel_do_simd,
	gfc_match_omp_distribute_simd, gfc_match_omp_target,
	gfc_match_omp_target_data, gfc_match_omp_target_teams,
	gfc_match_omp_target_teams_distribute,
	gfc_match_omp_target_teams_distribute_parallel_do,
	gfc_match_omp_target_teams_distribute_parallel_do_simd,
	gfc_match_omp_target_teams_distribute_simd,
	gfc_match_omp_target_update, gfc_match_omp_teams,
	gfc_match_omp_teams_distribute,
	gfc_match_omp_teams_distribute_parallel_do,
	gfc_match_omp_teams_distribute_parallel_do_simd,
	gfc_match_omp_teams_distribute_simd): New prototypes.
	* module.c (ab_attribute): Add AB_OMP_DECLARE_TARGET.
	(attr_bits): Likewise.
	(mio_symbol_attribute): Handle omp_declare_target attribute.
	(gfc_free_omp_clauses): Free num_teams, device, thread_limit
	and dist_chunk_size expressions.
	(OMP_CLAUSE_PRIVATE, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE,
	OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_COPYIN,
	OMP_CLAUSE_REDUCTION, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS,
	OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_ORDERED,
	OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_UNTIED, OMP_CLAUSE_FINAL,
	OMP_CLAUSE_MERGEABLE, OMP_CLAUSE_ALIGNED, OMP_CLAUSE_DEPEND,
	OMP_CLAUSE_INBRANCH, OMP_CLAUSE_LINEAR, OMP_CLAUSE_NOTINBRANCH,
	OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SIMDLEN,
	OMP_CLAUSE_UNIFORM): Use 1U instead of 1.
	(OMP_CLAUSE_DEVICE, OMP_CLAUSE_MAP, OMP_CLAUSE_TO, OMP_CLAUSE_FROM,
	OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_THREAD_LIMIT,
	OMP_CLAUSE_DIST_SCHEDULE): Define.
	(gfc_match_omp_clauses): Change mask parameter to unsigned int.
	Adjust for rop becoming u.reduction_op.  Disallow inbranch with
	notinbranch.  For depend clause, always create OMP_LIST_DEPEND
	and fill in u.depend_op.  Handle num_teams, device, map,
	to, from, thread_limit and dist_schedule clauses.
	(OMP_DECLARE_SIMD_CLAUSES): Or in OMP_CLAUSE_INBRANCH and
	OMP_CLAUSE_NOTINBRANCH.
	(OMP_TARGET_CLAUSES, OMP_TARGET_DATA_CLAUSES,
	OMP_TARGET_UPDATE_CLAUSES, OMP_TEAMS_CLAUSES,
	OMP_DISTRIBUTE_CLAUSES): Define.
	(match_omp): New function.
	(gfc_match_omp_do, gfc_match_omp_do_simd, gfc_match_omp_parallel,
	gfc_match_omp_parallel_do, gfc_match_omp_parallel_do_simd,
	gfc_match_omp_parallel_sections, gfc_match_omp_parallel_workshare,
	gfc_match_omp_sections, gfc_match_omp_simd, gfc_match_omp_single,
	gfc_match_omp_task): Rewritten using match_omp.
	(gfc_match_omp_threadprivate, gfc_match_omp_declare_reduction):
	Diagnose if the directives are followed by unexpected junk.
	(gfc_match_omp_distribute, gfc_match_omp_distribute_parallel_do,
	gfc_match_omp_distribute_parallel_do_simd,
	gfc_match_omp_distrbute_simd, gfc_match_omp_declare_target,
	gfc_match_omp_target, gfc_match_omp_target_data,
	gfc_match_omp_target_teams, gfc_match_omp_target_teams_distribute,
	gfc_match_omp_target_teams_distribute_parallel_do,
	gfc_match_omp_target_teams_distribute_parallel_do_simd,
	gfc_match_omp_target_teams_distrbute_simd, gfc_match_omp_target_update,
	gfc_match_omp_teams, gfc_match_omp_teams_distribute,
	gfc_match_omp_teams_distribute_parallel_do,
	gfc_match_omp_teams_distribute_parallel_do_simd,
	gfc_match_omp_teams_distrbute_simd): New functions.
	* openmp.c (resolve_omp_clauses): Adjust for
	OMP_LIST_DEPEND_{IN,OUT} being changed to OMP_LIST_DEPEND.  Handle
	OMP_LIST_MAP, OMP_LIST_FROM, OMP_LIST_TO, num_teams, device,
	dist_chunk_size and thread_limit.
	(gfc_resolve_omp_parallel_blocks): Only put sharing clauses into
	ctx.sharing_clauses.  Call gfc_resolve_omp_do_blocks for various
	new EXEC_OMP_* codes.
	(resolve_omp_do): Handle various new EXEC_OMP_* codes.
	(gfc_resolve_omp_directive): Likewise.
	(gfc_resolve_omp_declare_simd): Add missing space to diagnostics.
	* parse.c (decode_omp_directive): Handle parsing of OpenMP 4.0
	offloading related directives.
	(case_executable): Add ST_OMP_TARGET_UPDATE.
	(case_exec_markers): Add ST_OMP_TARGET*, ST_OMP_TEAMS*,
	ST_OMP_DISTRIBUTE*.
	(case_decl): Add ST_OMP_DECLARE_TARGET.
	(gfc_ascii_statement): Handle new ST_OMP_* codes.
	(parse_omp_do): Handle various new ST_OMP_* codes.
	(parse_executable): Likewise.
	* resolve.c (gfc_resolve_blocks): Handle various new EXEC_OMP_*
	codes.
	(resolve_code): Likewise.
	(resolve_symbol): Change that !$OMP DECLARE TARGET variables
	are saved.
	* st.c (gfc_free_statement): Handle various new EXEC_OMP_* codes.
	* symbol.c (check_conflict): Check omp_declare_target conflicts.
	(gfc_add_omp_declare_target): New function.
	(gfc_copy_attr): Copy omp_declare_target.
	* trans.c (trans_code): Handle various new EXEC_OMP_* codes.
	* trans-common.c (build_common_decl): Add "omp declare target"
	attribute if needed.
	* trans-decl.c (add_attributes_to_decl): Likewise.
	* trans.h (gfc_omp_finish_clause): New prototype.
	* trans-openmp.c (gfc_omp_finish_clause): New function.
	(gfc_trans_omp_reduction_list): Adjust for rop being renamed
	to u.reduction_op.
	(gfc_trans_omp_clauses): Adjust for OMP_LIST_DEPEND_{IN,OUT}
	change to OMP_LIST_DEPEND and fix up depend handling.
	Handle OMP_LIST_MAP, OMP_LIST_TO, OMP_LIST_FROM, num_teams,
	thread_limit, device, dist_chunk_size and dist_sched_kind.
	(gfc_trans_omp_do): Handle EXEC_OMP_DISTRIBUTE.
	(GFC_OMP_SPLIT_DISTRIBUTE, GFC_OMP_SPLIT_TEAMS,
	GFC_OMP_SPLIT_TARGET, GFC_OMP_SPLIT_NUM, GFC_OMP_MASK_DISTRIBUTE,
	GFC_OMP_MASK_TEAMS, GFC_OMP_MASK_TARGET, GFC_OMP_MASK_NUM): New.
	(gfc_split_omp_clauses): Handle splitting of clauses for new
	EXEC_OMP_* codes.
	(gfc_trans_omp_do_simd): Add pblock argument, adjust for being
	callable for combined constructs.
	(gfc_trans_omp_parallel_do, gfc_trans_omp_parallel_do_simd): Likewise.
	(gfc_trans_omp_distribute, gfc_trans_omp_teams,
	gfc_trans_omp_target, gfc_trans_omp_target_data,
	gfc_trans_omp_target_update): New functions.
	(gfc_trans_omp_directive): Adjust gfc_trans_omp_* callers, handle
	new EXEC_OMP_* codes.
gcc/testsuite/
	* gfortran.dg/gomp/declare-simd-1.f90: New test.
	* gfortran.dg/gomp/depend-1.f90: New test.
	* gfortran.dg/gomp/target1.f90: New test.
	* gfortran.dg/gomp/target2.f90: New test.
	* gfortran.dg/gomp/target3.f90: New test.
	* gfortran.dg/gomp/udr4.f90: Adjust expected diagnostics.
	* gfortran.dg/openmp-define-3.f90: Expect _OPENMP 201307 instead of
	201107.
libgomp/
	* omp_lib.f90.in (openmp_version): Set to 201307.
	* omp_lib.h.in (openmp_version): Likewise.
	* testsuite/libgomp.c/target-8.c: New test.
	* testsuite/libgomp.fortran/declare-simd-1.f90: Add notinbranch
	and inbranch clauses.
	* testsuite/libgomp.fortran/depend-3.f90: New test.
	* testsuite/libgomp.fortran/openmp_version-1.f: Adjust for new
	openmp_version.
	* testsuite/libgomp.fortran/openmp_version-2.f90: Likewise.
	* testsuite/libgomp.fortran/target1.f90: New test.
	* testsuite/libgomp.fortran/target2.f90: New test.
	* testsuite/libgomp.fortran/target3.f90: New test.
	* testsuite/libgomp.fortran/target4.f90: New test.
	* testsuite/libgomp.fortran/target5.f90: New test.
	* testsuite/libgomp.fortran/target6.f90: New test.
	* testsuite/libgomp.fortran/target7.f90: New test.

From-SVN: r211768
2014-06-18 09:16:12 +02:00
Jakub Jelinek 92d28cbb59 re PR fortran/60928 (gfortran issue with allocatable components and OpenMP)
PR fortran/60928
	* omp-low.c (lower_rec_input_clauses) <case OMP_CLAUSE_LASTPRIVATE>:
	Set lastprivate_firstprivate even if omp_private_outer_ref
	langhook returns true.
	<case OMP_CLAUSE_REDUCTION>: When calling omp_clause_default_ctor
	langhook, call unshare_expr on new_var and call
	build_outer_var_ref to get the last argument.
gcc/c-family/
	* c-pragma.c (omp_pragmas_simd): Move PRAGMA_OMP_TASK...
	(omp_pragmas): ... back here.
gcc/fortran/
	* f95-lang.c (gfc_init_builtin_functions): Handle -fopenmp-simd
	like -fopenmp.
	* openmp.c (resolve_omp_clauses): Remove allocatable components
	diagnostics.  Add associate-name and intent(in) pointer
	diagnostics for various clauses, diagnose procedure pointers in
	reduction clause.
	* parse.c (match_word_omp_simd): New function.
	(matchs, matcho): New macros.
	(decode_omp_directive): Change match macros to either matchs
	or matcho.  Handle -fopenmp-simd.
	(next_free, next_fixed): Handle -fopenmp-simd like -fopenmp.
	* scanner.c (skip_free_comments, skip_fixed_comments, include_line):
	Likewise.
	* trans-array.c (get_full_array_size): Rename to...
	(gfc_full_array_size): ... this.  No longer static.
	(duplicate_allocatable): Adjust caller.  Add NO_MEMCPY argument
	and handle it.
	(gfc_duplicate_allocatable, gfc_copy_allocatable_data): Adjust
	duplicate_allocatable callers.
	(gfc_duplicate_allocatable_nocopy): New function.
	(structure_alloc_comps): Adjust g*_full_array_size and
	duplicate_allocatable caller.
	* trans-array.h (gfc_full_array_size,
	gfc_duplicate_allocatable_nocopy): New prototypes.
	* trans-common.c (create_common): Call gfc_finish_decl_attrs.
	* trans-decl.c (gfc_finish_decl_attrs): New function.
	(gfc_finish_var_decl, create_function_arglist,
	gfc_get_fake_result_decl): Call it.
	(gfc_allocate_lang_decl): If DECL_LANG_SPECIFIC is already allocated,
	don't allocate it again.
	(gfc_get_symbol_decl): Set GFC_DECL_ASSOCIATE_VAR_P on
	associate-names.
	* trans.h (gfc_finish_decl_attrs): New prototype.
	(struct lang_decl): Add scalar_allocatable and scalar_pointer
	bitfields.
	(GFC_DECL_SCALAR_ALLOCATABLE, GFC_DECL_SCALAR_POINTER,
	GFC_DECL_GET_SCALAR_ALLOCATABLE, GFC_DECL_GET_SCALAR_POINTER,
	GFC_DECL_ASSOCIATE_VAR_P): Define.
	(GFC_POINTER_TYPE_P): Remove.
	* trans-openmp.c (gfc_omp_privatize_by_reference): Don't check
	GFC_POINTER_TYPE_P, instead test GFC_DECL_GET_SCALAR_ALLOCATABLE,
	GFC_DECL_GET_SCALAR_POINTER or GFC_DECL_CRAY_POINTEE on decl.
	(gfc_omp_predetermined_sharing): Associate-names are predetermined.
	(enum walk_alloc_comps): New.
	(gfc_has_alloc_comps, gfc_omp_unshare_expr_r, gfc_omp_unshare_expr,
	gfc_walk_alloc_comps): New functions.
	(gfc_omp_private_outer_ref): Return true for scalar allocatables or
	decls with allocatable components.
	(gfc_omp_clause_default_ctor, gfc_omp_clause_copy_ctor,
	gfc_omp_clause_assign_op, gfc_omp_clause_dtor): Fix up handling of
	allocatables, handle also OMP_CLAUSE_REDUCTION, handle scalar
	allocatables and decls with allocatable components.
	(gfc_trans_omp_array_reduction_or_udr): Don't handle allocatable
	arrays here.
	(gfc_trans_omp_reduction_list): Call
	gfc_trans_omp_array_reduction_or_udr even for allocatable scalars.
	(gfc_trans_omp_do_simd): If -fno-openmp, just expand it as OMP_SIMD.
	(gfc_trans_omp_parallel_do_simd): Likewise.
	* trans-types.c (gfc_sym_type): Don't set GFC_POINTER_TYPE_P.
	(gfc_get_derived_type): Call gfc_finish_decl_attrs.
gcc/testsuite/
	* gfortran.dg/gomp/allocatable_components_1.f90: Remove dg-error
	directives.
	* gfortran.dg/gomp/associate1.f90: New test.
	* gfortran.dg/gomp/intentin1.f90: New test.
	* gfortran.dg/gomp/openmp-simd-1.f90: New test.
	* gfortran.dg/gomp/openmp-simd-2.f90: New test.
	* gfortran.dg/gomp/openmp-simd-3.f90: New test.
	* gfortran.dg/gomp/proc_ptr_2.f90: New test.
libgomp/
	* testsuite/libgomp.fortran/allocatable9.f90: New test.
	* testsuite/libgomp.fortran/allocatable10.f90: New test.
	* testsuite/libgomp.fortran/allocatable11.f90: New test.
	* testsuite/libgomp.fortran/allocatable12.f90: New test.
	* testsuite/libgomp.fortran/alloc-comp-1.f90: New test.
	* testsuite/libgomp.fortran/alloc-comp-2.f90: New test.
	* testsuite/libgomp.fortran/alloc-comp-3.f90: New test.
	* testsuite/libgomp.fortran/associate1.f90: New test.
	* testsuite/libgomp.fortran/associate2.f90: New test.
	* testsuite/libgomp.fortran/procptr1.f90: New test.

From-SVN: r211397
2014-06-10 08:05:22 +02:00
Jakub Jelinek 5f23671d3f dump-parse-tree.c (show_omp_namelist): Dump reduction id in each list item.
gcc/fortran/
	* dump-parse-tree.c (show_omp_namelist): Dump reduction
	id in each list item.
	(show_omp_node): Only handle OMP_LIST_REDUCTION, not
	OMP_LIST_REDUCTION_FIRST .. OMP_LIST_REDUCTION_LAST.  Don't
	dump reduction id here.
	* frontend-passes.c (dummy_code_callback): Renamed to...
	(gfc_dummy_code_callback): ... this.  No longer static.
	(optimize_reduction): Use gfc_dummy_code_callback instead of
	dummy_code_callback.
	* gfortran.h (gfc_statement): Add ST_OMP_DECLARE_REDUCTION.
	(symbol_attribute): Add omp_udr_artificial_var bitfield.
	(gfc_omp_reduction_op): New enum.
	(gfc_omp_namelist): Add rop and udr fields.
	(OMP_LIST_PLUS, OMP_LIST_REDUCTION_FIRST, OMP_LIST_MULT,
	OMP_LIST_SUB, OMP_LIST_AND, OMP_LIST_OR, OMP_LIST_EQV,
	OMP_LIST_NEQV, OMP_LIST_MAX, OMP_LIST_MIN, OMP_LIST_IAND,
	OMP_LIST_IOR, OMP_LIST_IEOR, OMP_LIST_REDUCTION_LAST): Removed.
	(OMP_LIST_REDUCTION): New.
	(gfc_omp_udr): New type.
	(gfc_get_omp_udr): Define.
	(gfc_symtree): Add n.omp_udr field.
	(gfc_namespace): Add omp_udr_root field, add omp_udr_ns bitfield.
	(gfc_free_omp_udr, gfc_omp_udr_find, gfc_resolve_omp_udrs,
	gfc_dummy_code_callback): New prototypes.
	* match.h (gfc_match_omp_declare_reduction): New prototype.
	* module.c (MOD_VERSION): Increase to 13.
	(omp_declare_reduction_stmt): New array.
	(mio_omp_udr_expr, write_omp_udr, write_omp_udrs, load_omp_udrs):
	New functions.
	(read_module): Read OpenMP user defined reductions.
	(write_module): Write OpenMP user defined reductions.
	* openmp.c: Include arith.h.
	(gfc_free_omp_udr, gfc_find_omp_udr): New functions.
	(gfc_match_omp_clauses): Handle user defined reductions.
	Store reduction kind into gfc_omp_namelist instead of using
	several OMP_LIST_* entries.
	(match_udr_expr, gfc_omp_udr_predef, gfc_omp_udr_find,
	gfc_match_omp_declare_reduction): New functions.
	(resolve_omp_clauses): Adjust for reduction clauses being only
	in OMP_LIST_REDUCTION list.  Diagnose missing UDRs.
	(struct omp_udr_callback_data): New type.
	(omp_udr_callback, gfc_resolve_omp_udr, gfc_resolve_omp_udrs): New
	functions.
	* parse.c (decode_omp_directive): Handle !$omp declare reduction.
	(case_decl): Add ST_OMP_DECLARE_REDUCTION.
	(gfc_ascii_statement): Print ST_OMP_DECLARE_REDUCTION.
	* resolve.c (resolve_fl_variable): Allow len=: or len=* on
	sym->attr.omp_udr_artificial_var symbols.
	(resolve_types): Call gfc_resolve_omp_udrs.
	* symbol.c (gfc_get_uop): If gfc_current_ns->omp_udr_ns,
	use parent ns instead of gfc_current_ns.
	(gfc_get_sym_tree): Don't insert symbols into
	namespaces with omp_udr_ns set.
	(free_omp_udr_tree): New function.
	(gfc_free_namespace): Call it.
	* trans-openmp.c (struct omp_udr_find_orig_data): New type.
	(omp_udr_find_orig, gfc_trans_omp_udr_expr): New functions.
	(gfc_trans_omp_array_reduction): Renamed to...
	(gfc_trans_omp_array_reduction_or_udr): ... this.  Remove SYM
	argument, instead pass gfc_omp_namelist pointer N.  Handle
	user defined reductions.
	(gfc_trans_omp_reduction_list): Remove REDUCTION_CODE argument.
	Handle user defined reductions and reduction ops in gfc_omp_namelist.
	(gfc_trans_omp_clauses): Adjust for just a single OMP_LIST_REDUCTION
	list.
	(gfc_split_omp_clauses): Likewise.
gcc/testsuite/
	* gfortran.dg/gomp/allocatable_components_1.f90: Adjust for
	reduction clause diagnostic changes.
	* gfortran.dg/gomp/appendix-a/a.31.3.f90: Likewise.
	* gfortran.dg/gomp/reduction1.f90: Likewise.
	* gfortran.dg/gomp/reduction3.f90: Likewise.
	* gfortran.dg/gomp/udr1.f90: New test.
	* gfortran.dg/gomp/udr2.f90: New test.
	* gfortran.dg/gomp/udr3.f90: New test.
	* gfortran.dg/gomp/udr4.f90: New test.
	* gfortran.dg/gomp/udr5.f90: New test.
	* gfortran.dg/gomp/udr6.f90: New test.
	* gfortran.dg/gomp/udr7.f90: New test.
libgomp/
	* testsuite/libgomp.fortran/simd1.f90: New test.
	* testsuite/libgomp.fortran/udr1.f90: New test.
	* testsuite/libgomp.fortran/udr2.f90: New test.
	* testsuite/libgomp.fortran/udr3.f90: New test.
	* testsuite/libgomp.fortran/udr4.f90: New test.
	* testsuite/libgomp.fortran/udr5.f90: New test.
	* testsuite/libgomp.fortran/udr6.f90: New test.
	* testsuite/libgomp.fortran/udr7.f90: New test.
	* testsuite/libgomp.fortran/udr8.f90: New test.
	* testsuite/libgomp.fortran/udr9.f90: New test.
	* testsuite/libgomp.fortran/udr10.f90: New test.
	* testsuite/libgomp.fortran/udr11.f90: New test.

From-SVN: r211303
2014-06-06 09:24:38 +02:00
Uros Bizjak 0389fbb55b declare-simd-1.f90: Require vect_simd_clones effective target.
* testsuite/libgomp.fortran/declare-simd-1.f90: Require
	vect_simd_clones effective target.
	* testsuite/libgomp.fortran/declare-simd-2.f90: Ditto.

From-SVN: r210961
2014-05-27 11:14:53 +02:00
Jakub Jelinek decaaec811 re PR middle-end/61252 (Invalid code produced for omp simd reduction(min:var) where var is reference)
PR middle-end/61252
	* omp-low.c (handle_simd_reference): New function.
	(lower_rec_input_clauses): Use it.  Defer adding reference
	initialization even for reduction without placeholder if in simd,
	handle it properly later on.

	* testsuite/libgomp.c++/simd-9.C: New test.

From-SVN: r210679
2014-05-21 10:04:03 +02:00
Uros Bizjak 7283246061 libgomp.texi (Runitme Library Routines): Remove multiple @menu.
* libgomp.texi (Runitme Library Routines): Remove multiple @menu.
	(Environment Variables) Move OMP_PROC_BIND and OMP_STACKSIZE node
	texts according to their @menu entry positions.

From-SVN: r210580
2014-05-18 12:29:30 +02:00
Jakub Jelinek dd2fc5256e tree.h (OMP_CLAUSE_LINEAR_STMT): Define.
* tree.h (OMP_CLAUSE_LINEAR_STMT): Define.
	* tree.c (omp_clause_num_ops): Increase OMP_CLAUSE_LINEAR
	number of operands to 3.
	(walk_tree_1): Walk all operands of OMP_CLAUSE_LINEAR.
	* tree-nested.c (convert_nonlocal_omp_clauses,
	convert_local_omp_clauses): Handle OMP_CLAUSE_DEPEND.
	* gimplify.c (gimplify_scan_omp_clauses): Handle
	OMP_CLAUSE_LINEAR_STMT.
	* omp-low.c (lower_rec_input_clauses): Fix typo.
	(maybe_add_implicit_barrier_cancel, lower_omp_1): Add
	cast between Fortran boolean_type_node and C _Bool if
	needed.
gcc/fortran/
	* gfortran.h (gfc_statement): Add ST_OMP_CANCEL,
	ST_OMP_CANCELLATION_POINT, ST_OMP_TASKGROUP, ST_OMP_END_TASKGROUP,
	ST_OMP_SIMD, ST_OMP_END_SIMD, ST_OMP_DO_SIMD, ST_OMP_END_DO_SIMD,
	ST_OMP_PARALLEL_DO_SIMD, ST_OMP_END_PARALLEL_DO_SIMD and
	ST_OMP_DECLARE_SIMD.
	(gfc_omp_namelist): New typedef.
	(gfc_get_omp_namelist): Define.
	(OMP_LIST_UNIFORM, OMP_LIST_ALIGNED, OMP_LIST_LINEAR,
	OMP_LIST_DEPEND_IN, OMP_LIST_DEPEND_OUT): New clause list kinds.
	(gfc_omp_proc_bind_kind, gfc_omp_cancel_kind): New enums.
	(gfc_omp_clauses): Change type of lists to gfc_omp_namelist *.
	Add inbranch, notinbranch, cancel, proc_bind, safelen_expr and
	simdlen_expr fields.
	(gfc_omp_declare_simd): New typedef.
	(gfc_get_omp_declare_simd): Define.
	(gfc_namespace): Add omp_declare_simd field.
	(gfc_exec_op): Add EXEC_OMP_CANCEL, EXEC_OMP_CANCELLATION_POINT,
	EXEC_OMP_TASKGROUP, EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD and
	EXEC_OMP_PARALLEL_DO_SIMD.
	(gfc_omp_atomic_op): Add GFC_OMP_ATOMIC_MASK, GFC_OMP_ATOMIC_SEQ_CST
	and GFC_OMP_ATOMIC_SWAP.
	(gfc_code): Change type of omp_namelist field to gfc_omp_namelist *.
	(gfc_free_omp_namelist, gfc_free_omp_declare_simd,
	gfc_free_omp_declare_simd_list, gfc_resolve_omp_declare_simd): New
	prototypes.
	* trans-stmt.h (gfc_trans_omp_declare_simd): New prototype.
	* symbol.c (gfc_free_namespace): Call gfc_free_omp_declare_simd.
	* openmp.c (gfc_free_omp_clauses): Free safelen_expr and
	simdlen_expr.  Use gfc_free_omp_namelist instead of
	gfc_free_namelist.
	(gfc_free_omp_declare_simd, gfc_free_omp_declare_simd_list): New
	functions.
	(gfc_match_omp_variable_list): Add end_colon, headp and
	allow_sections arguments.  Handle parsing of array sections.
	Use *omp_namelist* instead of *namelist* data structure and
	functions/macros.  Allow termination at : character.
	(OMP_CLAUSE_ALIGNED, OMP_CLAUSE_DEPEND, OMP_CLAUSE_INBRANCH,
	OMP_CLAUSE_LINEAR, OMP_CLAUSE_NOTINBRANCH, OMP_CLAUSE_PROC_BIND,
	OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_UNIFORM): Define.
	(gfc_match_omp_clauses): Change first and needs_space variables
	into arguments with default values.  Parse inbranch, notinbranch,
	proc_bind, safelen, simdlen, uniform, linear, aligned and
	depend clauses.
	(OMP_PARALLEL_CLAUSES): Add OMP_CLAUSE_PROC_BIND.
	(OMP_DECLARE_SIMD_CLAUSES, OMP_SIMD_CLAUSES): Define.
	(OMP_TASK_CLAUSES): Add OMP_CLAUSE_DEPEND.
	(gfc_match_omp_do_simd): New function.
	(gfc_match_omp_flush): Use *omp_namelist* instead of *namelist*
	data structure and functions/macros.
	(gfc_match_omp_simd, gfc_match_omp_declare_simd,
	gfc_match_omp_parallel_do_simd): New functions.
	(gfc_match_omp_atomic): Handle seq_cst clause.  Handle atomic swap.
	(gfc_match_omp_taskgroup, gfc_match_omp_cancel_kind,
	gfc_match_omp_cancel, gfc_match_omp_cancellation_point): New
	functions.
	(resolve_omp_clauses): Add where, omp_clauses and ns arguments.
	Use *omp_namelist* instead of *namelist* data structure and
	functions/macros.  Resolve uniform, aligned, linear, depend,
	safelen and simdlen clauses.
	(resolve_omp_atomic): Adjust for GFC_OMP_ATOMIC_{MASK,SEQ_CST,SWAP}
	addition, recognize atomic swap.
	(gfc_resolve_omp_parallel_blocks): Use gfc_omp_namelist instead
	of gfc_namelist.  Handle EXEC_OMP_PARALLEL_DO_SIMD the same as
	EXEC_OMP_PARALLEL_DO.
	(gfc_resolve_do_iterator): Use *omp_namelist* instead of *namelist*
	data structure and functions/macros.
	(resolve_omp_do): Likewise.  Handle EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD.
	(gfc_resolve_omp_directive): Handle EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD and EXEC_OMP_CANCEL.  Adjust
	resolve_omp_clauses caller.
	(gfc_resolve_omp_declare_simd): New function.
	* parse.c (decode_omp_directive): Parse cancellation point, cancel,
	declare simd, end do simd, end simd, end parallel do simd,
	end taskgroup, parallel do simd, simd and taskgroup directives.
	(case_executable): Add ST_OMP_CANCEL and ST_OMP_CANCELLATION_POINT.
	(case_exec_markers): Add ST_OMP_TASKGROUP, case ST_OMP_SIMD,
	ST_OMP_DO_SIMD and ST_OMP_PARALLEL_DO_SIMD.
	(case_decl): Add ST_OMP_DECLARE_SIMD.
	(gfc_ascii_statement): Handle ST_OMP_CANCEL,
	ST_OMP_CANCELLATION_POINT, ST_OMP_TASKGROUP, ST_OMP_END_TASKGROUP,
	ST_OMP_SIMD, ST_OMP_END_SIMD, ST_OMP_DO_SIMD, ST_OMP_END_DO_SIMD,
	ST_OMP_PARALLEL_DO_SIMD, ST_OMP_END_PARALLEL_DO_SIMD and
	ST_OMP_DECLARE_SIMD.
	(parse_omp_do): Handle ST_OMP_SIMD, ST_OMP_DO_SIMD and
	ST_OMP_PARALLEL_DO_SIMD.
	(parse_omp_atomic): Adjust for GFC_OMP_ATOMIC_* additions.
	(parse_omp_structured_block): Handle ST_OMP_TASKGROUP and
	ST_OMP_PARALLEL_DO_SIMD.
	(parse_executable): Handle ST_OMP_SIMD, ST_OMP_DO_SIMD,
	ST_OMP_PARALLEL_DO_SIMD and ST_OMP_TASKGROUP.
	* trans-decl.c (gfc_get_extern_function_decl,
	gfc_create_function_decl): Call gfc_trans_omp_declare_simd if
	needed.
	* frontend-passes.c (gfc_code_walker): Handle EXEC_OMP_SIMD,
	EXEC_OMP_DO_SIMD and EXEC_OMP_PARALLEL_DO_SIMD.  Walk
	safelen_expr and simdlen_expr.  Walk expressions in gfc_omp_namelist
	of depend, aligned and linear clauses.
	* match.c (match_exit_cycle): Handle EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD
	and EXEC_OMP_PARALLEL_DO_SIMD.
	(gfc_free_omp_namelist): New function.
	* dump-parse-tree.c (show_namelist): Removed.
	(show_omp_namelist): New function.
	(show_omp_node): Handle OpenMP 4.0 additions.
	(show_code_node): Handle EXEC_OMP_CANCEL, EXEC_OMP_CANCELLATION_POINT,
	EXEC_OMP_DO_SIMD, EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and
	EXEC_OMP_TASKGROUP.
	* match.h (gfc_match_omp_cancel, gfc_match_omp_cancellation_point,
	gfc_match_omp_declare_simd, gfc_match_omp_do_simd,
	gfc_match_omp_parallel_do_simd, gfc_match_omp_simd,
	gfc_match_omp_taskgroup): New prototypes.
	* trans-openmp.c (gfc_trans_omp_variable): Add declare_simd
	argument, handle it.  Allow current_function_decl to be NULL.
	(gfc_trans_omp_variable_list): Add declare_simd argument, pass
	it through to gfc_trans_omp_variable and disregard whether
	sym is referenced if declare_simd is true.  Work on gfc_omp_namelist
	instead of gfc_namelist.
	(gfc_trans_omp_reduction_list): Work on gfc_omp_namelist instead of
	gfc_namelist.  Adjust gfc_trans_omp_variable caller.
	(gfc_trans_omp_clauses): Add declare_simd argument, pass it through
	to gfc_trans_omp_variable{,_list} callers.  Work on gfc_omp_namelist
	instead of gfc_namelist.  Handle inbranch, notinbranch, safelen,
	simdlen, depend, uniform, linear, proc_bind and aligned clauses.
	Handle cancel kind.
	(gfc_trans_omp_atomic): Handle seq_cst clause, handle atomic swap,
	adjust for GFC_OMP_ATOMIC_* changes.
	(gfc_trans_omp_cancel, gfc_trans_omp_cancellation_point): New
	functions.
	(gfc_trans_omp_do): Add op argument, handle simd translation into
	generic.
	(GFC_OMP_SPLIT_SIMD, GFC_OMP_SPLIT_DO, GFC_OMP_SPLIT_PARALLEL,
	GFC_OMP_SPLIT_NUM, GFC_OMP_MASK_SIMD, GFC_OMP_MASK_DO,
	GFC_OMP_MASK_PARALLEL): New.
	(gfc_split_omp_clauses, gfc_trans_omp_do_simd): New functions.
	(gfc_trans_omp_parallel_do): Rework to use gfc_split_omp_clauses.
	(gfc_trans_omp_parallel_do_simd, gfc_trans_omp_taskgroup): New
	functions.
	(gfc_trans_omp_directive): Handle EXEC_OMP_CANCEL,
	EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
	Adjust gfc_trans_omp_do caller.
	(gfc_trans_omp_declare_simd): New function.
	* st.c (gfc_free_statement): Handle EXEC_OMP_CANCEL,
	EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
	For EXEC_OMP_FLUSH call gfc_free_omp_namelist instead of
	gfc_free_namelist.
	* module.c (omp_declare_simd_clauses): New variable.
	(mio_omp_declare_simd): New function.
	(mio_symbol): Call it.
	* trans.c (trans_code): Handle EXEC_OMP_CANCEL,
	EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
	* resolve.c (gfc_resolve_blocks): Handle EXEC_OMP_DO_SIMD,  
	EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
	(resolve_code): Handle EXEC_OMP_CANCEL,
	EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
	(resolve_types): Call gfc_resolve_omp_declare_simd.
gcc/testsuite/
	* gfortran.dg/gomp/affinity-1.f90: New test.
libgomp/
	* testsuite/libgomp.fortran/cancel-do-1.f90: New test.
	* testsuite/libgomp.fortran/cancel-do-2.f90: New test.
	* testsuite/libgomp.fortran/cancel-parallel-1.f90: New test.
	* testsuite/libgomp.fortran/cancel-parallel-3.f90: New test.
	* testsuite/libgomp.fortran/cancel-sections-1.f90: New test.
	* testsuite/libgomp.fortran/cancel-taskgroup-2.f90: New test.
	* testsuite/libgomp.fortran/declare-simd-1.f90: New test.
	* testsuite/libgomp.fortran/declare-simd-2.f90: New test.
	* testsuite/libgomp.fortran/declare-simd-3.f90: New test.
	* testsuite/libgomp.fortran/depend-1.f90: New test.
	* testsuite/libgomp.fortran/depend-2.f90: New test.
	* testsuite/libgomp.fortran/omp_atomic5.f90: New test.
	* testsuite/libgomp.fortran/simd1.f90: New test.
	* testsuite/libgomp.fortran/simd2.f90: New test.
	* testsuite/libgomp.fortran/simd3.f90: New test.
	* testsuite/libgomp.fortran/simd4.f90: New test.
	* testsuite/libgomp.fortran/taskgroup1.f90: New test.

From-SVN: r210313
2014-05-11 22:26:36 +02:00
Jakub Jelinek 95782571f3 gimplify.c (gimplify_adjust_omp_clauses_1): Handle GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE.
* gimplify.c (gimplify_adjust_omp_clauses_1): Handle
	GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE.
	(gimplify_adjust_omp_clauses): Simd region is never
	directly nested in combined parallel.  Instead, for linear
	with copyin/copyout, if in combined for simd loop, make decl
	firstprivate/lastprivate on OMP_FOR.
	* omp-low.c (expand_omp_for_generic, expand_omp_for_static_nochunk,
	expand_omp_for_static_chunk): When setting endvar, also set
	fd->loop.v to the same value.
libgomp/
	* testsuite/libgomp.c/simd-10.c: New test.
	* testsuite/libgomp.c/simd-11.c: New test.
	* testsuite/libgomp.c/simd-12.c: New test.
	* testsuite/libgomp.c/simd-13.c: New test.

From-SVN: r210009
2014-05-02 19:43:40 +02:00