mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-27 05:44:15 +08:00
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
This commit is contained in:
parent
1a6e82b8c0
commit
d9a6bd32ad
375
gcc/ChangeLog
375
gcc/ChangeLog
@ -1,3 +1,378 @@
|
||||
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.
|
||||
|
||||
2015-10-13 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
* config/i386/i386.c (classify_argument): Use CEIL where applicable.
|
||||
|
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
||||
2015-10-09 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gcc-interface/Make-lang.in: Make sure that GNAT1_OBJS and not just
|
||||
|
@ -5369,6 +5369,12 @@ enum c_builtin_type
|
||||
ARG6, ARG7) NAME,
|
||||
#define DEF_FUNCTION_TYPE_8(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8) NAME,
|
||||
#define DEF_FUNCTION_TYPE_9(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9) NAME,
|
||||
#define DEF_FUNCTION_TYPE_10(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10) NAME,
|
||||
#define DEF_FUNCTION_TYPE_11(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME,
|
||||
@ -5392,6 +5398,9 @@ enum c_builtin_type
|
||||
#undef DEF_FUNCTION_TYPE_6
|
||||
#undef DEF_FUNCTION_TYPE_7
|
||||
#undef DEF_FUNCTION_TYPE_8
|
||||
#undef DEF_FUNCTION_TYPE_9
|
||||
#undef DEF_FUNCTION_TYPE_10
|
||||
#undef DEF_FUNCTION_TYPE_11
|
||||
#undef DEF_FUNCTION_TYPE_VAR_0
|
||||
#undef DEF_FUNCTION_TYPE_VAR_1
|
||||
#undef DEF_FUNCTION_TYPE_VAR_2
|
||||
@ -5493,6 +5502,18 @@ install_builtin_function_types (void)
|
||||
ARG6, ARG7, ARG8) \
|
||||
def_fn_type (ENUM, RETURN, 0, 8, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8);
|
||||
#define DEF_FUNCTION_TYPE_9(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9) \
|
||||
def_fn_type (ENUM, RETURN, 0, 9, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8, ARG9);
|
||||
#define DEF_FUNCTION_TYPE_10(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5,\
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10) \
|
||||
def_fn_type (ENUM, RETURN, 0, 10, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8, ARG9, ARG10);
|
||||
#define DEF_FUNCTION_TYPE_11(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5,\
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) \
|
||||
def_fn_type (ENUM, RETURN, 0, 11, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8, ARG9, ARG10, ARG11);
|
||||
#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
|
||||
def_fn_type (ENUM, RETURN, 1, 0);
|
||||
#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
|
||||
@ -5526,6 +5547,9 @@ install_builtin_function_types (void)
|
||||
#undef DEF_FUNCTION_TYPE_6
|
||||
#undef DEF_FUNCTION_TYPE_7
|
||||
#undef DEF_FUNCTION_TYPE_8
|
||||
#undef DEF_FUNCTION_TYPE_9
|
||||
#undef DEF_FUNCTION_TYPE_10
|
||||
#undef DEF_FUNCTION_TYPE_11
|
||||
#undef DEF_FUNCTION_TYPE_VAR_0
|
||||
#undef DEF_FUNCTION_TYPE_VAR_1
|
||||
#undef DEF_FUNCTION_TYPE_VAR_2
|
||||
|
@ -473,6 +473,11 @@ DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_VPTR_PTR_INT, BT_VOID, BT_SIZE,
|
||||
BT_VOLATILE_PTR, BT_PTR, BT_INT)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_VOID, BT_SIZE,
|
||||
BT_CONST_VOLATILE_PTR, BT_PTR, BT_INT)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR,
|
||||
BT_BOOL, BT_UINT, BT_PTR_LONG, BT_PTR_LONG, BT_PTR_LONG)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR,
|
||||
BT_BOOL, BT_UINT, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG,
|
||||
BT_PTR_ULONGLONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_5 (BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG,
|
||||
BT_INT, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING,
|
||||
@ -497,6 +502,12 @@ DEF_FUNCTION_TYPE_5 (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR,
|
||||
DEF_FUNCTION_TYPE_5 (BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT,
|
||||
BT_UINT)
|
||||
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR,
|
||||
BT_BOOL, BT_UINT, BT_PTR_LONG, BT_LONG, BT_PTR_LONG,
|
||||
BT_PTR_LONG)
|
||||
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR,
|
||||
BT_BOOL, BT_UINT, BT_PTR_ULONGLONG, BT_ULONGLONG,
|
||||
BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_6 (BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VALIST_ARG,
|
||||
BT_INT, BT_STRING, BT_SIZE, BT_INT, BT_SIZE,
|
||||
@ -524,8 +535,6 @@ DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I16_BOOL_INT_INT,
|
||||
BT_INT)
|
||||
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_SIZE_VPTR_PTR_PTR_INT_INT, BT_BOOL, BT_SIZE,
|
||||
BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT, BT_INT)
|
||||
DEF_FUNCTION_TYPE_6 (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
|
||||
BT_VOID, BT_INT, BT_PTR, BT_SIZE, BT_PTR, BT_PTR, BT_PTR)
|
||||
|
||||
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
|
||||
@ -534,17 +543,31 @@ DEF_FUNCTION_TYPE_7 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
|
||||
BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
|
||||
BT_ULONGLONG, BT_ULONGLONG,
|
||||
BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
|
||||
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
|
||||
BT_VOID, BT_INT, BT_PTR_FN_VOID_PTR, BT_PTR, BT_SIZE,
|
||||
BT_PTR, BT_PTR, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR,
|
||||
BT_VOID, BT_INT, BT_SIZE, BT_PTR, BT_PTR, BT_PTR, BT_UINT,
|
||||
BT_PTR)
|
||||
|
||||
DEF_FUNCTION_TYPE_8 (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR,
|
||||
BT_VOID, BT_INT, BT_PTR_FN_VOID_PTR, BT_SIZE, BT_PTR,
|
||||
BT_PTR, BT_PTR, BT_UINT, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_8 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
|
||||
BT_LONG, BT_LONG, BT_LONG, BT_LONG, BT_UINT)
|
||||
DEF_FUNCTION_TYPE_8 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR,
|
||||
|
||||
DEF_FUNCTION_TYPE_9 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR,
|
||||
BT_PTR_FN_VOID_PTR_PTR, BT_LONG, BT_LONG,
|
||||
BT_BOOL, BT_UINT, BT_PTR)
|
||||
BT_BOOL, BT_UINT, BT_PTR, BT_INT)
|
||||
|
||||
DEF_FUNCTION_TYPE_11 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR,
|
||||
BT_PTR_FN_VOID_PTR_PTR, BT_LONG, BT_LONG,
|
||||
BT_UINT, BT_LONG, BT_INT, BT_LONG, BT_LONG, BT_LONG)
|
||||
DEF_FUNCTION_TYPE_11 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR,
|
||||
BT_PTR_FN_VOID_PTR_PTR, BT_LONG, BT_LONG,
|
||||
BT_UINT, BT_LONG, BT_INT,
|
||||
BT_ULONGLONG, BT_ULONGLONG, BT_ULONGLONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_0 (BT_FN_VOID_VAR, BT_VOID)
|
||||
DEF_FUNCTION_TYPE_VAR_0 (BT_FN_INT_VAR, BT_INT)
|
||||
@ -559,6 +582,10 @@ DEF_FUNCTION_TYPE_VAR_1 (BT_FN_INT_CONST_STRING_VAR,
|
||||
BT_INT, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_VAR_1 (BT_FN_UINT32_UINT32_VAR,
|
||||
BT_UINT32, BT_UINT32)
|
||||
DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_LONG_VAR,
|
||||
BT_VOID, BT_LONG)
|
||||
DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_ULL_VAR,
|
||||
BT_VOID, BT_ULONGLONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_FILEPTR_CONST_STRING_VAR,
|
||||
BT_INT, BT_FILEPTR, BT_CONST_STRING)
|
||||
|
@ -1,3 +1,31 @@
|
||||
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}.
|
||||
|
||||
2015-10-05 Richard Sandiford <richard.sandiford@arm.com>
|
||||
|
||||
* c-lex.c (interpret_float): Use real_equal instead of
|
||||
|
@ -5548,6 +5548,12 @@ enum c_builtin_type
|
||||
ARG6, ARG7) NAME,
|
||||
#define DEF_FUNCTION_TYPE_8(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8) NAME,
|
||||
#define DEF_FUNCTION_TYPE_9(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9) NAME,
|
||||
#define DEF_FUNCTION_TYPE_10(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10) NAME,
|
||||
#define DEF_FUNCTION_TYPE_11(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME,
|
||||
@ -5571,6 +5577,9 @@ enum c_builtin_type
|
||||
#undef DEF_FUNCTION_TYPE_6
|
||||
#undef DEF_FUNCTION_TYPE_7
|
||||
#undef DEF_FUNCTION_TYPE_8
|
||||
#undef DEF_FUNCTION_TYPE_9
|
||||
#undef DEF_FUNCTION_TYPE_10
|
||||
#undef DEF_FUNCTION_TYPE_11
|
||||
#undef DEF_FUNCTION_TYPE_VAR_0
|
||||
#undef DEF_FUNCTION_TYPE_VAR_1
|
||||
#undef DEF_FUNCTION_TYPE_VAR_2
|
||||
@ -5659,6 +5668,18 @@ c_define_builtins (tree va_list_ref_type_node, tree va_list_arg_type_node)
|
||||
ARG6, ARG7, ARG8) \
|
||||
def_fn_type (ENUM, RETURN, 0, 8, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8);
|
||||
#define DEF_FUNCTION_TYPE_9(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9) \
|
||||
def_fn_type (ENUM, RETURN, 0, 9, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8, ARG9);
|
||||
#define DEF_FUNCTION_TYPE_10(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10) \
|
||||
def_fn_type (ENUM, RETURN, 0, 10, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8, ARG9, ARG10);
|
||||
#define DEF_FUNCTION_TYPE_11(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) \
|
||||
def_fn_type (ENUM, RETURN, 0, 11, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8, ARG9, ARG10, ARG11);
|
||||
#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
|
||||
def_fn_type (ENUM, RETURN, 1, 0);
|
||||
#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
|
||||
@ -5692,6 +5713,9 @@ c_define_builtins (tree va_list_ref_type_node, tree va_list_arg_type_node)
|
||||
#undef DEF_FUNCTION_TYPE_6
|
||||
#undef DEF_FUNCTION_TYPE_7
|
||||
#undef DEF_FUNCTION_TYPE_8
|
||||
#undef DEF_FUNCTION_TYPE_9
|
||||
#undef DEF_FUNCTION_TYPE_10
|
||||
#undef DEF_FUNCTION_TYPE_11
|
||||
#undef DEF_FUNCTION_TYPE_VAR_0
|
||||
#undef DEF_FUNCTION_TYPE_VAR_1
|
||||
#undef DEF_FUNCTION_TYPE_VAR_2
|
||||
|
@ -1252,13 +1252,14 @@ enum c_omp_clause_split
|
||||
C_OMP_CLAUSE_SPLIT_FOR,
|
||||
C_OMP_CLAUSE_SPLIT_SIMD,
|
||||
C_OMP_CLAUSE_SPLIT_COUNT,
|
||||
C_OMP_CLAUSE_SPLIT_SECTIONS = C_OMP_CLAUSE_SPLIT_FOR
|
||||
C_OMP_CLAUSE_SPLIT_SECTIONS = C_OMP_CLAUSE_SPLIT_FOR,
|
||||
C_OMP_CLAUSE_SPLIT_TASKLOOP = C_OMP_CLAUSE_SPLIT_FOR
|
||||
};
|
||||
|
||||
extern tree c_finish_omp_master (location_t, tree);
|
||||
extern tree c_finish_omp_taskgroup (location_t, tree);
|
||||
extern tree c_finish_omp_critical (location_t, tree, tree);
|
||||
extern tree c_finish_omp_ordered (location_t, tree);
|
||||
extern tree c_finish_omp_critical (location_t, tree, tree, tree);
|
||||
extern tree c_finish_omp_ordered (location_t, tree, tree);
|
||||
extern void c_finish_omp_barrier (location_t);
|
||||
extern tree c_finish_omp_atomic (location_t, enum tree_code, enum tree_code,
|
||||
tree, tree, tree, tree, tree, bool, bool);
|
||||
@ -1266,7 +1267,7 @@ extern void c_finish_omp_flush (location_t);
|
||||
extern void c_finish_omp_taskwait (location_t);
|
||||
extern void c_finish_omp_taskyield (location_t);
|
||||
extern tree c_finish_omp_for (location_t, enum tree_code, tree, tree, tree,
|
||||
tree, tree, tree);
|
||||
tree, tree, tree, tree);
|
||||
extern tree c_finish_oacc_wait (location_t, tree, tree);
|
||||
extern void c_omp_split_clauses (location_t, enum tree_code, omp_clause_mask,
|
||||
tree, tree *);
|
||||
|
@ -1223,7 +1223,7 @@ c_cpp_builtins (cpp_reader *pfile)
|
||||
cpp_define (pfile, "_OPENACC=201306");
|
||||
|
||||
if (flag_openmp)
|
||||
cpp_define (pfile, "_OPENMP=201307");
|
||||
cpp_define (pfile, "_OPENMP=201511");
|
||||
|
||||
for (i = 0; i < NUM_INT_N_ENTS; i ++)
|
||||
if (int_n_enabled_p[i])
|
||||
|
@ -100,12 +100,13 @@ c_finish_omp_taskgroup (location_t loc, tree stmt)
|
||||
if it was omitted. LOC is the location of the #pragma. */
|
||||
|
||||
tree
|
||||
c_finish_omp_critical (location_t loc, tree body, tree name)
|
||||
c_finish_omp_critical (location_t loc, tree body, tree name, tree clauses)
|
||||
{
|
||||
tree stmt = make_node (OMP_CRITICAL);
|
||||
TREE_TYPE (stmt) = void_type_node;
|
||||
OMP_CRITICAL_BODY (stmt) = body;
|
||||
OMP_CRITICAL_NAME (stmt) = name;
|
||||
OMP_CRITICAL_CLAUSES (stmt) = clauses;
|
||||
SET_EXPR_LOCATION (stmt, loc);
|
||||
return add_stmt (stmt);
|
||||
}
|
||||
@ -114,9 +115,12 @@ c_finish_omp_critical (location_t loc, tree body, tree name)
|
||||
that follows the pragma. LOC is the location of the #pragma. */
|
||||
|
||||
tree
|
||||
c_finish_omp_ordered (location_t loc, tree stmt)
|
||||
c_finish_omp_ordered (location_t loc, tree clauses, tree stmt)
|
||||
{
|
||||
tree t = build1 (OMP_ORDERED, void_type_node, stmt);
|
||||
tree t = make_node (OMP_ORDERED);
|
||||
TREE_TYPE (t) = void_type_node;
|
||||
OMP_ORDERED_BODY (t) = stmt;
|
||||
OMP_ORDERED_CLAUSES (t) = clauses;
|
||||
SET_EXPR_LOCATION (t, loc);
|
||||
return add_stmt (t);
|
||||
}
|
||||
@ -428,6 +432,10 @@ c_omp_for_incr_canonicalize_ptr (location_t loc, tree decl, tree incr)
|
||||
|
||||
/* Validate and generate OMP_FOR.
|
||||
DECLV is a vector of iteration variables, for each collapsed loop.
|
||||
|
||||
ORIG_DECLV, if non-NULL, is a vector with the original iteration
|
||||
variables (prior to any transformations, by say, C++ iterators).
|
||||
|
||||
INITV, CONDV and INCRV are vectors containing initialization
|
||||
expressions, controlling predicates and increment expressions.
|
||||
BODY is the body of the loop and PRE_BODY statements that go before
|
||||
@ -435,7 +443,8 @@ c_omp_for_incr_canonicalize_ptr (location_t loc, tree decl, tree incr)
|
||||
|
||||
tree
|
||||
c_finish_omp_for (location_t locus, enum tree_code code, tree declv,
|
||||
tree initv, tree condv, tree incrv, tree body, tree pre_body)
|
||||
tree orig_declv, tree initv, tree condv, tree incrv,
|
||||
tree body, tree pre_body)
|
||||
{
|
||||
location_t elocus;
|
||||
bool fail = false;
|
||||
@ -480,6 +489,7 @@ c_finish_omp_for (location_t locus, enum tree_code code, tree declv,
|
||||
init = integer_zero_node;
|
||||
fail = true;
|
||||
}
|
||||
DECL_INITIAL (decl) = NULL_TREE;
|
||||
|
||||
init = build_modify_expr (elocus, decl, NULL_TREE, NOP_EXPR,
|
||||
/* FIXME diagnostics: This should
|
||||
@ -673,33 +683,42 @@ c_finish_omp_for (location_t locus, enum tree_code code, tree declv,
|
||||
OMP_FOR_INCR (t) = incrv;
|
||||
OMP_FOR_BODY (t) = body;
|
||||
OMP_FOR_PRE_BODY (t) = pre_body;
|
||||
if (code == OMP_FOR)
|
||||
OMP_FOR_ORIG_DECLS (t) = orig_declv;
|
||||
|
||||
SET_EXPR_LOCATION (t, locus);
|
||||
return add_stmt (t);
|
||||
}
|
||||
}
|
||||
|
||||
/* Right now we have 14 different combined constructs, this
|
||||
/* Right now we have 21 different combined/composite constructs, this
|
||||
function attempts to split or duplicate clauses for combined
|
||||
constructs. CODE is the innermost construct in the combined construct,
|
||||
and MASK allows to determine which constructs are combined together,
|
||||
as every construct has at least one clause that no other construct
|
||||
has (except for OMP_SECTIONS, but that can be only combined with parallel).
|
||||
Combined constructs are:
|
||||
#pragma omp parallel for
|
||||
#pragma omp parallel sections
|
||||
#pragma omp parallel for simd
|
||||
#pragma omp for simd
|
||||
#pragma omp distribute simd
|
||||
Combined/composite constructs are:
|
||||
#pragma omp distribute parallel for
|
||||
#pragma omp distribute parallel for simd
|
||||
#pragma omp teams distribute
|
||||
#pragma omp teams distribute parallel for
|
||||
#pragma omp teams distribute parallel for simd
|
||||
#pragma omp distribute simd
|
||||
#pragma omp for simd
|
||||
#pragma omp parallel for
|
||||
#pragma omp parallel for simd
|
||||
#pragma omp parallel sections
|
||||
#pragma omp target parallel
|
||||
#pragma omp target parallel for
|
||||
#pragma omp target parallel for simd
|
||||
#pragma omp target teams
|
||||
#pragma omp target teams distribute
|
||||
#pragma omp target teams distribute parallel for
|
||||
#pragma omp target teams distribute parallel for simd */
|
||||
#pragma omp target teams distribute parallel for simd
|
||||
#pragma omp target teams distribute simd
|
||||
#pragma omp target simd
|
||||
#pragma omp taskloop simd
|
||||
#pragma omp teams distribute
|
||||
#pragma omp teams distribute parallel for
|
||||
#pragma omp teams distribute parallel for simd
|
||||
#pragma omp teams distribute simd */
|
||||
|
||||
void
|
||||
c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
@ -738,6 +757,8 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
/* First the clauses that are unique to some constructs. */
|
||||
case OMP_CLAUSE_DEVICE:
|
||||
case OMP_CLAUSE_MAP:
|
||||
case OMP_CLAUSE_IS_DEVICE_PTR:
|
||||
case OMP_CLAUSE_DEFAULTMAP:
|
||||
s = C_OMP_CLAUSE_SPLIT_TARGET;
|
||||
break;
|
||||
case OMP_CLAUSE_NUM_TEAMS:
|
||||
@ -753,25 +774,51 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
s = C_OMP_CLAUSE_SPLIT_PARALLEL;
|
||||
break;
|
||||
case OMP_CLAUSE_ORDERED:
|
||||
case OMP_CLAUSE_SCHEDULE:
|
||||
case OMP_CLAUSE_NOWAIT:
|
||||
s = C_OMP_CLAUSE_SPLIT_FOR;
|
||||
break;
|
||||
case OMP_CLAUSE_SCHEDULE:
|
||||
s = C_OMP_CLAUSE_SPLIT_FOR;
|
||||
if (code != OMP_SIMD)
|
||||
OMP_CLAUSE_SCHEDULE_SIMD (clauses) = 0;
|
||||
break;
|
||||
case OMP_CLAUSE_SAFELEN:
|
||||
case OMP_CLAUSE_LINEAR:
|
||||
case OMP_CLAUSE_SIMDLEN:
|
||||
case OMP_CLAUSE_ALIGNED:
|
||||
s = C_OMP_CLAUSE_SPLIT_SIMD;
|
||||
break;
|
||||
/* Duplicate this to all of distribute, for and simd. */
|
||||
case OMP_CLAUSE_GRAINSIZE:
|
||||
case OMP_CLAUSE_NUM_TASKS:
|
||||
case OMP_CLAUSE_FINAL:
|
||||
case OMP_CLAUSE_UNTIED:
|
||||
case OMP_CLAUSE_MERGEABLE:
|
||||
case OMP_CLAUSE_NOGROUP:
|
||||
case OMP_CLAUSE_PRIORITY:
|
||||
s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
|
||||
break;
|
||||
/* Duplicate this to all of taskloop, distribute, for and simd. */
|
||||
case OMP_CLAUSE_COLLAPSE:
|
||||
if (code == OMP_SIMD)
|
||||
{
|
||||
c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
|
||||
OMP_CLAUSE_COLLAPSE);
|
||||
OMP_CLAUSE_COLLAPSE_EXPR (c)
|
||||
= OMP_CLAUSE_COLLAPSE_EXPR (clauses);
|
||||
OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_SIMD];
|
||||
cclauses[C_OMP_CLAUSE_SPLIT_SIMD] = c;
|
||||
if ((mask & ((OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)
|
||||
| (OMP_CLAUSE_MASK_1
|
||||
<< PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)
|
||||
| (OMP_CLAUSE_MASK_1
|
||||
<< PRAGMA_OMP_CLAUSE_NOGROUP))) != 0)
|
||||
{
|
||||
c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
|
||||
OMP_CLAUSE_COLLAPSE);
|
||||
OMP_CLAUSE_COLLAPSE_EXPR (c)
|
||||
= OMP_CLAUSE_COLLAPSE_EXPR (clauses);
|
||||
OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_SIMD];
|
||||
cclauses[C_OMP_CLAUSE_SPLIT_SIMD] = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This must be #pragma omp target simd */
|
||||
s = C_OMP_CLAUSE_SPLIT_SIMD;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)) != 0)
|
||||
{
|
||||
@ -789,10 +836,13 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
else
|
||||
s = C_OMP_CLAUSE_SPLIT_FOR;
|
||||
}
|
||||
else if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP))
|
||||
!= 0)
|
||||
s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
|
||||
else
|
||||
s = C_OMP_CLAUSE_SPLIT_DISTRIBUTE;
|
||||
break;
|
||||
/* Private clause is supported on all constructs but target,
|
||||
/* Private clause is supported on all constructs,
|
||||
it is enough to put it on the innermost one. For
|
||||
#pragma omp {for,sections} put it on parallel though,
|
||||
as that's what we did for OpenMP 3.1. */
|
||||
@ -808,9 +858,28 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
}
|
||||
break;
|
||||
/* Firstprivate clause is supported on all constructs but
|
||||
target and simd. Put it on the outermost of those and
|
||||
duplicate on parallel. */
|
||||
simd. Put it on the outermost of those and duplicate on teams
|
||||
and parallel. */
|
||||
case OMP_CLAUSE_FIRSTPRIVATE:
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP))
|
||||
!= 0)
|
||||
{
|
||||
if (code == OMP_SIMD
|
||||
&& (mask & ((OMP_CLAUSE_MASK_1
|
||||
<< PRAGMA_OMP_CLAUSE_NUM_THREADS)
|
||||
| (OMP_CLAUSE_MASK_1
|
||||
<< PRAGMA_OMP_CLAUSE_NUM_TEAMS))) == 0)
|
||||
{
|
||||
/* This must be #pragma omp target simd. */
|
||||
s = C_OMP_CLAUSE_SPLIT_TARGET;
|
||||
break;
|
||||
}
|
||||
c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
|
||||
OMP_CLAUSE_FIRSTPRIVATE);
|
||||
OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
|
||||
OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TARGET];
|
||||
cclauses[C_OMP_CLAUSE_SPLIT_TARGET] = c;
|
||||
}
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_THREADS))
|
||||
!= 0)
|
||||
{
|
||||
@ -831,7 +900,9 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
}
|
||||
else
|
||||
/* This must be
|
||||
#pragma omp parallel{, for{, simd}, sections}. */
|
||||
#pragma omp parallel{, for{, simd}, sections}
|
||||
or
|
||||
#pragma omp target parallel. */
|
||||
s = C_OMP_CLAUSE_SPLIT_PARALLEL;
|
||||
}
|
||||
else if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_TEAMS))
|
||||
@ -851,7 +922,14 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
{
|
||||
/* This must be #pragma omp distribute simd. */
|
||||
gcc_assert (code == OMP_SIMD);
|
||||
s = C_OMP_CLAUSE_SPLIT_TEAMS;
|
||||
s = C_OMP_CLAUSE_SPLIT_DISTRIBUTE;
|
||||
}
|
||||
else if ((mask & (OMP_CLAUSE_MASK_1
|
||||
<< PRAGMA_OMP_CLAUSE_NOGROUP)) != 0)
|
||||
{
|
||||
/* This must be #pragma omp taskloop simd. */
|
||||
gcc_assert (code == OMP_SIMD);
|
||||
s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -889,17 +967,25 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
}
|
||||
s = C_OMP_CLAUSE_SPLIT_SIMD;
|
||||
break;
|
||||
/* Shared and default clauses are allowed on private and teams. */
|
||||
/* Shared and default clauses are allowed on parallel, teams and
|
||||
taskloop. */
|
||||
case OMP_CLAUSE_SHARED:
|
||||
case OMP_CLAUSE_DEFAULT:
|
||||
if (code == OMP_TEAMS)
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP))
|
||||
!= 0)
|
||||
{
|
||||
s = C_OMP_CLAUSE_SPLIT_TEAMS;
|
||||
s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
|
||||
break;
|
||||
}
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_TEAMS))
|
||||
!= 0)
|
||||
{
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_THREADS))
|
||||
== 0)
|
||||
{
|
||||
s = C_OMP_CLAUSE_SPLIT_TEAMS;
|
||||
break;
|
||||
}
|
||||
c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
|
||||
OMP_CLAUSE_CODE (clauses));
|
||||
if (OMP_CLAUSE_CODE (clauses) == OMP_CLAUSE_SHARED)
|
||||
@ -909,7 +995,6 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
= OMP_CLAUSE_DEFAULT_KIND (clauses);
|
||||
OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TEAMS];
|
||||
cclauses[C_OMP_CLAUSE_SPLIT_TEAMS] = c;
|
||||
|
||||
}
|
||||
s = C_OMP_CLAUSE_SPLIT_PARALLEL;
|
||||
break;
|
||||
@ -917,20 +1002,22 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
Duplicate it on all of them, but omit on for or sections if
|
||||
parallel is present. */
|
||||
case OMP_CLAUSE_REDUCTION:
|
||||
if (code == OMP_SIMD)
|
||||
{
|
||||
c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
|
||||
OMP_CLAUSE_REDUCTION);
|
||||
OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
|
||||
OMP_CLAUSE_REDUCTION_CODE (c)
|
||||
= OMP_CLAUSE_REDUCTION_CODE (clauses);
|
||||
OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)
|
||||
= OMP_CLAUSE_REDUCTION_PLACEHOLDER (clauses);
|
||||
OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_SIMD];
|
||||
cclauses[C_OMP_CLAUSE_SPLIT_SIMD] = c;
|
||||
}
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)) != 0)
|
||||
{
|
||||
if (code == OMP_SIMD)
|
||||
{
|
||||
c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
|
||||
OMP_CLAUSE_REDUCTION);
|
||||
OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
|
||||
OMP_CLAUSE_REDUCTION_CODE (c)
|
||||
= OMP_CLAUSE_REDUCTION_CODE (clauses);
|
||||
OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)
|
||||
= OMP_CLAUSE_REDUCTION_PLACEHOLDER (clauses);
|
||||
OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (c)
|
||||
= OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (clauses);
|
||||
OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_SIMD];
|
||||
cclauses[C_OMP_CLAUSE_SPLIT_SIMD] = c;
|
||||
}
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_TEAMS))
|
||||
!= 0)
|
||||
{
|
||||
@ -941,6 +1028,8 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
= OMP_CLAUSE_REDUCTION_CODE (clauses);
|
||||
OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)
|
||||
= OMP_CLAUSE_REDUCTION_PLACEHOLDER (clauses);
|
||||
OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (c)
|
||||
= OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (clauses);
|
||||
OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL];
|
||||
cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL] = c;
|
||||
s = C_OMP_CLAUSE_SPLIT_TEAMS;
|
||||
@ -951,25 +1040,83 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
|
||||
else
|
||||
s = C_OMP_CLAUSE_SPLIT_FOR;
|
||||
}
|
||||
else if (code == OMP_SECTIONS)
|
||||
else if (code == OMP_SECTIONS || code == OMP_PARALLEL)
|
||||
s = C_OMP_CLAUSE_SPLIT_PARALLEL;
|
||||
else if (code == OMP_SIMD)
|
||||
s = C_OMP_CLAUSE_SPLIT_SIMD;
|
||||
else
|
||||
s = C_OMP_CLAUSE_SPLIT_TEAMS;
|
||||
break;
|
||||
case OMP_CLAUSE_IF:
|
||||
/* FIXME: This is currently being discussed. */
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_THREADS))
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP))
|
||||
!= 0)
|
||||
s = C_OMP_CLAUSE_SPLIT_PARALLEL;
|
||||
s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
|
||||
else if ((mask & (OMP_CLAUSE_MASK_1
|
||||
<< PRAGMA_OMP_CLAUSE_NUM_THREADS)) != 0)
|
||||
{
|
||||
if ((mask & (OMP_CLAUSE_MASK_1
|
||||
<< PRAGMA_OMP_CLAUSE_MAP)) != 0)
|
||||
{
|
||||
if (OMP_CLAUSE_IF_MODIFIER (clauses) == OMP_PARALLEL)
|
||||
s = C_OMP_CLAUSE_SPLIT_PARALLEL;
|
||||
else if (OMP_CLAUSE_IF_MODIFIER (clauses) == OMP_TARGET)
|
||||
s = C_OMP_CLAUSE_SPLIT_TARGET;
|
||||
else if (OMP_CLAUSE_IF_MODIFIER (clauses) == ERROR_MARK)
|
||||
{
|
||||
c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
|
||||
OMP_CLAUSE_IF);
|
||||
OMP_CLAUSE_IF_MODIFIER (c)
|
||||
= OMP_CLAUSE_IF_MODIFIER (clauses);
|
||||
OMP_CLAUSE_IF_EXPR (c) = OMP_CLAUSE_IF_EXPR (clauses);
|
||||
OMP_CLAUSE_CHAIN (c)
|
||||
= cclauses[C_OMP_CLAUSE_SPLIT_TARGET];
|
||||
cclauses[C_OMP_CLAUSE_SPLIT_TARGET] = c;
|
||||
s = C_OMP_CLAUSE_SPLIT_PARALLEL;
|
||||
}
|
||||
else
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (clauses),
|
||||
"expected %<parallel%> or %<target%> %<if%> "
|
||||
"clause modifier");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
s = C_OMP_CLAUSE_SPLIT_PARALLEL;
|
||||
}
|
||||
else
|
||||
s = C_OMP_CLAUSE_SPLIT_TARGET;
|
||||
break;
|
||||
case OMP_CLAUSE_LINEAR:
|
||||
/* Linear clause is allowed on simd and for. Put it on the
|
||||
innermost construct. */
|
||||
if (code == OMP_SIMD)
|
||||
s = C_OMP_CLAUSE_SPLIT_SIMD;
|
||||
else
|
||||
s = C_OMP_CLAUSE_SPLIT_FOR;
|
||||
break;
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
OMP_CLAUSE_CHAIN (clauses) = cclauses[s];
|
||||
cclauses[s] = clauses;
|
||||
}
|
||||
#ifdef ENABLE_CHECKING
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP)) == 0)
|
||||
gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_TARGET] == NULL_TREE);
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_TEAMS)) == 0)
|
||||
gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_TEAMS] == NULL_TREE);
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)) == 0)
|
||||
gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_DISTRIBUTE] == NULL_TREE);
|
||||
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_THREADS)) == 0)
|
||||
gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL] == NULL_TREE);
|
||||
if ((mask & ((OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)
|
||||
| (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP))) == 0
|
||||
&& code != OMP_SECTIONS)
|
||||
gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_FOR] == NULL_TREE);
|
||||
if (code != OMP_SIMD)
|
||||
gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_SIMD] == NULL_TREE);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -1246,6 +1246,7 @@ static const struct omp_pragma_def omp_pragmas_simd[] = {
|
||||
{ "parallel", PRAGMA_OMP_PARALLEL },
|
||||
{ "simd", PRAGMA_OMP_SIMD },
|
||||
{ "target", PRAGMA_OMP_TARGET },
|
||||
{ "taskloop", PRAGMA_OMP_TASKLOOP },
|
||||
{ "teams", PRAGMA_OMP_TEAMS },
|
||||
};
|
||||
|
||||
|
@ -36,6 +36,7 @@ enum pragma_kind {
|
||||
PRAGMA_OACC_PARALLEL,
|
||||
PRAGMA_OACC_UPDATE,
|
||||
PRAGMA_OACC_WAIT,
|
||||
|
||||
PRAGMA_OMP_ATOMIC,
|
||||
PRAGMA_OMP_BARRIER,
|
||||
PRAGMA_OMP_CANCEL,
|
||||
@ -56,6 +57,7 @@ enum pragma_kind {
|
||||
PRAGMA_OMP_TARGET,
|
||||
PRAGMA_OMP_TASK,
|
||||
PRAGMA_OMP_TASKGROUP,
|
||||
PRAGMA_OMP_TASKLOOP,
|
||||
PRAGMA_OMP_TASKWAIT,
|
||||
PRAGMA_OMP_TASKYIELD,
|
||||
PRAGMA_OMP_THREADPRIVATE,
|
||||
@ -74,7 +76,7 @@ enum pragma_kind {
|
||||
};
|
||||
|
||||
|
||||
/* All clauses defined by OpenACC 2.0, and OpenMP 2.5, 3.0, 3.1, and 4.0.
|
||||
/* All clauses defined by OpenACC 2.0, and OpenMP 2.5, 3.0, 3.1, 4.0 and 4.5.
|
||||
Used internally by both C and C++ parsers. */
|
||||
enum pragma_omp_clause {
|
||||
PRAGMA_OMP_CLAUSE_NONE = 0,
|
||||
@ -84,6 +86,7 @@ enum pragma_omp_clause {
|
||||
PRAGMA_OMP_CLAUSE_COPYIN,
|
||||
PRAGMA_OMP_CLAUSE_COPYPRIVATE,
|
||||
PRAGMA_OMP_CLAUSE_DEFAULT,
|
||||
PRAGMA_OMP_CLAUSE_DEFAULTMAP,
|
||||
PRAGMA_OMP_CLAUSE_DEPEND,
|
||||
PRAGMA_OMP_CLAUSE_DEVICE,
|
||||
PRAGMA_OMP_CLAUSE_DIST_SCHEDULE,
|
||||
@ -91,18 +94,25 @@ enum pragma_omp_clause {
|
||||
PRAGMA_OMP_CLAUSE_FIRSTPRIVATE,
|
||||
PRAGMA_OMP_CLAUSE_FOR,
|
||||
PRAGMA_OMP_CLAUSE_FROM,
|
||||
PRAGMA_OMP_CLAUSE_GRAINSIZE,
|
||||
PRAGMA_OMP_CLAUSE_HINT,
|
||||
PRAGMA_OMP_CLAUSE_IF,
|
||||
PRAGMA_OMP_CLAUSE_INBRANCH,
|
||||
PRAGMA_OMP_CLAUSE_IS_DEVICE_PTR,
|
||||
PRAGMA_OMP_CLAUSE_LASTPRIVATE,
|
||||
PRAGMA_OMP_CLAUSE_LINEAR,
|
||||
PRAGMA_OMP_CLAUSE_LINK,
|
||||
PRAGMA_OMP_CLAUSE_MAP,
|
||||
PRAGMA_OMP_CLAUSE_MERGEABLE,
|
||||
PRAGMA_OMP_CLAUSE_NOGROUP,
|
||||
PRAGMA_OMP_CLAUSE_NOTINBRANCH,
|
||||
PRAGMA_OMP_CLAUSE_NOWAIT,
|
||||
PRAGMA_OMP_CLAUSE_NUM_TASKS,
|
||||
PRAGMA_OMP_CLAUSE_NUM_TEAMS,
|
||||
PRAGMA_OMP_CLAUSE_NUM_THREADS,
|
||||
PRAGMA_OMP_CLAUSE_ORDERED,
|
||||
PRAGMA_OMP_CLAUSE_PARALLEL,
|
||||
PRAGMA_OMP_CLAUSE_PRIORITY,
|
||||
PRAGMA_OMP_CLAUSE_PRIVATE,
|
||||
PRAGMA_OMP_CLAUSE_PROC_BIND,
|
||||
PRAGMA_OMP_CLAUSE_REDUCTION,
|
||||
@ -110,13 +120,16 @@ enum pragma_omp_clause {
|
||||
PRAGMA_OMP_CLAUSE_SCHEDULE,
|
||||
PRAGMA_OMP_CLAUSE_SECTIONS,
|
||||
PRAGMA_OMP_CLAUSE_SHARED,
|
||||
PRAGMA_OMP_CLAUSE_SIMD,
|
||||
PRAGMA_OMP_CLAUSE_SIMDLEN,
|
||||
PRAGMA_OMP_CLAUSE_TASKGROUP,
|
||||
PRAGMA_OMP_CLAUSE_THREAD_LIMIT,
|
||||
PRAGMA_OMP_CLAUSE_THREADS,
|
||||
PRAGMA_OMP_CLAUSE_TO,
|
||||
PRAGMA_OMP_CLAUSE_UNIFORM,
|
||||
PRAGMA_OMP_CLAUSE_UNTIED,
|
||||
|
||||
PRAGMA_OMP_CLAUSE_USE_DEVICE_PTR,
|
||||
|
||||
/* Clauses for Cilk Plus SIMD-enabled function. */
|
||||
PRAGMA_CILK_CLAUSE_NOMASK,
|
||||
PRAGMA_CILK_CLAUSE_MASK,
|
||||
|
@ -1,3 +1,85 @@
|
||||
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.
|
||||
|
||||
2015-10-06 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
* c-parser.c (c_parser_statement_after_labels): Use
|
||||
|
1513
gcc/c/c-parser.c
1513
gcc/c/c-parser.c
File diff suppressed because it is too large
Load Diff
@ -649,7 +649,7 @@ extern tree c_begin_omp_task (void);
|
||||
extern tree c_finish_omp_task (location_t, tree, tree);
|
||||
extern void c_finish_omp_cancel (location_t, tree);
|
||||
extern void c_finish_omp_cancellation_point (location_t, tree);
|
||||
extern tree c_finish_omp_clauses (tree);
|
||||
extern tree c_finish_omp_clauses (tree, bool, bool = false);
|
||||
extern tree c_build_va_arg (location_t, tree, tree);
|
||||
extern tree c_finish_transaction (location_t, tree, int);
|
||||
extern bool c_tree_equal (tree, tree);
|
||||
|
532
gcc/c/c-typeck.c
532
gcc/c/c-typeck.c
@ -11654,7 +11654,7 @@ c_finish_omp_cancellation_point (location_t loc, tree clauses)
|
||||
map(a[:b][2:1][:c][:2][:d][e:f][2:5])
|
||||
FIRST_NON_ONE will be 3, array-section-subscript [:b], [2:1] and [:c]
|
||||
all are or may have length of 1, array-section-subscript [:2] is the
|
||||
first one knonwn not to have length 1. For array-section-subscript
|
||||
first one known not to have length 1. For array-section-subscript
|
||||
<= FIRST_NON_ONE we diagnose non-contiguous arrays if low bound isn't
|
||||
0 or length isn't the array domain max + 1, for > FIRST_NON_ONE we
|
||||
can if MAYBE_ZERO_LEN is false. MAYBE_ZERO_LEN will be true in the above
|
||||
@ -11662,13 +11662,39 @@ c_finish_omp_cancellation_point (location_t loc, tree clauses)
|
||||
|
||||
static tree
|
||||
handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
|
||||
bool &maybe_zero_len, unsigned int &first_non_one)
|
||||
bool &maybe_zero_len, unsigned int &first_non_one,
|
||||
bool is_omp)
|
||||
{
|
||||
tree ret, low_bound, length, type;
|
||||
if (TREE_CODE (t) != TREE_LIST)
|
||||
{
|
||||
if (error_operand_p (t))
|
||||
return error_mark_node;
|
||||
ret = t;
|
||||
if (TREE_CODE (t) == COMPONENT_REF
|
||||
&& is_omp
|
||||
&& (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
|
||||
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE_TO
|
||||
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FROM))
|
||||
{
|
||||
if (DECL_BIT_FIELD (TREE_OPERAND (t, 1)))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"bit-field %qE in %qs clause",
|
||||
t, omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
return error_mark_node;
|
||||
}
|
||||
while (TREE_CODE (t) == COMPONENT_REF)
|
||||
{
|
||||
if (TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == UNION_TYPE)
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"%qE is a member of a union", t);
|
||||
return error_mark_node;
|
||||
}
|
||||
t = TREE_OPERAND (t, 0);
|
||||
}
|
||||
}
|
||||
if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
|
||||
{
|
||||
if (DECL_P (t))
|
||||
@ -11689,11 +11715,11 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
return error_mark_node;
|
||||
}
|
||||
return t;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = handle_omp_array_sections_1 (c, TREE_CHAIN (t), types,
|
||||
maybe_zero_len, first_non_one);
|
||||
maybe_zero_len, first_non_one, is_omp);
|
||||
if (ret == error_mark_node || ret == NULL_TREE)
|
||||
return ret;
|
||||
|
||||
@ -11734,11 +11760,32 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
|
||||
if (length != NULL_TREE)
|
||||
{
|
||||
if (!integer_nonzerop (length))
|
||||
maybe_zero_len = true;
|
||||
{
|
||||
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND
|
||||
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION)
|
||||
{
|
||||
if (integer_zerop (length))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"zero length array section in %qs clause",
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
return error_mark_node;
|
||||
}
|
||||
}
|
||||
else
|
||||
maybe_zero_len = true;
|
||||
}
|
||||
if (first_non_one == types.length ()
|
||||
&& (TREE_CODE (length) != INTEGER_CST || integer_onep (length)))
|
||||
first_non_one++;
|
||||
}
|
||||
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
|
||||
&& !integer_zerop (low_bound))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"%<reduction%> array section has to be zero-based");
|
||||
return error_mark_node;
|
||||
}
|
||||
if (TREE_CODE (type) == ARRAY_TYPE)
|
||||
{
|
||||
if (length == NULL_TREE
|
||||
@ -11786,7 +11833,17 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
|
||||
return error_mark_node;
|
||||
}
|
||||
if (tree_int_cst_equal (size, low_bound))
|
||||
maybe_zero_len = true;
|
||||
{
|
||||
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND
|
||||
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION)
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"zero length array section in %qs clause",
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
return error_mark_node;
|
||||
}
|
||||
maybe_zero_len = true;
|
||||
}
|
||||
else if (length == NULL_TREE
|
||||
&& first_non_one == types.length ()
|
||||
&& tree_int_cst_equal
|
||||
@ -11796,7 +11853,9 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
|
||||
}
|
||||
else if (length == NULL_TREE)
|
||||
{
|
||||
maybe_zero_len = true;
|
||||
if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_DEPEND
|
||||
&& OMP_CLAUSE_CODE (c) != OMP_CLAUSE_REDUCTION)
|
||||
maybe_zero_len = true;
|
||||
if (first_non_one == types.length ())
|
||||
first_non_one++;
|
||||
}
|
||||
@ -11830,7 +11889,9 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
|
||||
}
|
||||
else if (length == NULL_TREE)
|
||||
{
|
||||
maybe_zero_len = true;
|
||||
if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_DEPEND
|
||||
&& OMP_CLAUSE_CODE (c) != OMP_CLAUSE_REDUCTION)
|
||||
maybe_zero_len = true;
|
||||
if (first_non_one == types.length ())
|
||||
first_non_one++;
|
||||
}
|
||||
@ -11854,6 +11915,15 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
|
||||
"for pointer type length expression must be specified");
|
||||
return error_mark_node;
|
||||
}
|
||||
if (length != NULL_TREE
|
||||
&& TREE_CODE (length) == INTEGER_CST
|
||||
&& tree_int_cst_sgn (length) == -1)
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"negative length in array section in %qs clause",
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
return error_mark_node;
|
||||
}
|
||||
/* If there is a pointer type anywhere but in the very first
|
||||
array-section-subscript, the array section can't be contiguous. */
|
||||
if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_DEPEND
|
||||
@ -11887,28 +11957,22 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
|
||||
/* Handle array sections for clause C. */
|
||||
|
||||
static bool
|
||||
handle_omp_array_sections (tree c)
|
||||
handle_omp_array_sections (tree c, bool is_omp)
|
||||
{
|
||||
bool maybe_zero_len = false;
|
||||
unsigned int first_non_one = 0;
|
||||
vec<tree> types = vNULL;
|
||||
auto_vec<tree, 10> types;
|
||||
tree first = handle_omp_array_sections_1 (c, OMP_CLAUSE_DECL (c), types,
|
||||
maybe_zero_len, first_non_one);
|
||||
maybe_zero_len, first_non_one,
|
||||
is_omp);
|
||||
if (first == error_mark_node)
|
||||
{
|
||||
types.release ();
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
if (first == NULL_TREE)
|
||||
{
|
||||
types.release ();
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND)
|
||||
{
|
||||
tree t = OMP_CLAUSE_DECL (c);
|
||||
tree tem = NULL_TREE;
|
||||
types.release ();
|
||||
/* Need to evaluate side effects in the length expressions
|
||||
if any. */
|
||||
while (TREE_CODE (t) == TREE_LIST)
|
||||
@ -11978,7 +12042,6 @@ handle_omp_array_sections (tree c)
|
||||
"array section is not contiguous in %qs "
|
||||
"clause",
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
types.release ();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -11997,7 +12060,9 @@ handle_omp_array_sections (tree c)
|
||||
{
|
||||
tree l;
|
||||
|
||||
if (i > first_non_one && length && integer_nonzerop (length))
|
||||
if (i > first_non_one
|
||||
&& ((length && integer_nonzerop (length))
|
||||
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION))
|
||||
continue;
|
||||
if (length)
|
||||
l = fold_convert (sizetype, length);
|
||||
@ -12022,6 +12087,22 @@ handle_omp_array_sections (tree c)
|
||||
else if (size == NULL_TREE)
|
||||
{
|
||||
size = size_in_bytes (TREE_TYPE (types[i]));
|
||||
tree eltype = TREE_TYPE (types[num - 1]);
|
||||
while (TREE_CODE (eltype) == ARRAY_TYPE)
|
||||
eltype = TREE_TYPE (eltype);
|
||||
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION)
|
||||
{
|
||||
if (integer_zerop (size)
|
||||
|| integer_zerop (size_in_bytes (eltype)))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"zero length array section in %qs clause",
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
return error_mark_node;
|
||||
}
|
||||
size = size_binop (EXACT_DIV_EXPR, size,
|
||||
size_in_bytes (eltype));
|
||||
}
|
||||
size = size_binop (MULT_EXPR, size, l);
|
||||
if (condition)
|
||||
size = fold_build3 (COND_EXPR, sizetype, condition,
|
||||
@ -12031,20 +12112,56 @@ handle_omp_array_sections (tree c)
|
||||
size = size_binop (MULT_EXPR, size, l);
|
||||
}
|
||||
}
|
||||
types.release ();
|
||||
if (side_effects)
|
||||
size = build2 (COMPOUND_EXPR, sizetype, side_effects, size);
|
||||
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION)
|
||||
{
|
||||
size = size_binop (MINUS_EXPR, size, size_one_node);
|
||||
size = c_fully_fold (size, false, NULL);
|
||||
tree index_type = build_index_type (size);
|
||||
tree eltype = TREE_TYPE (first);
|
||||
while (TREE_CODE (eltype) == ARRAY_TYPE)
|
||||
eltype = TREE_TYPE (eltype);
|
||||
tree type = build_array_type (eltype, index_type);
|
||||
tree ptype = build_pointer_type (eltype);
|
||||
if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
|
||||
t = build_fold_addr_expr (t);
|
||||
t = build2 (MEM_REF, type, t, build_int_cst (ptype, 0));
|
||||
OMP_CLAUSE_DECL (c) = t;
|
||||
return false;
|
||||
}
|
||||
first = c_fully_fold (first, false, NULL);
|
||||
OMP_CLAUSE_DECL (c) = first;
|
||||
if (size)
|
||||
size = c_fully_fold (size, false, NULL);
|
||||
OMP_CLAUSE_SIZE (c) = size;
|
||||
if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_MAP)
|
||||
if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_MAP
|
||||
|| (TREE_CODE (t) == COMPONENT_REF
|
||||
&& TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE))
|
||||
return false;
|
||||
gcc_assert (OMP_CLAUSE_MAP_KIND (c) != GOMP_MAP_FORCE_DEVICEPTR);
|
||||
if (is_omp)
|
||||
switch (OMP_CLAUSE_MAP_KIND (c))
|
||||
{
|
||||
case GOMP_MAP_ALLOC:
|
||||
case GOMP_MAP_TO:
|
||||
case GOMP_MAP_FROM:
|
||||
case GOMP_MAP_TOFROM:
|
||||
case GOMP_MAP_ALWAYS_TO:
|
||||
case GOMP_MAP_ALWAYS_FROM:
|
||||
case GOMP_MAP_ALWAYS_TOFROM:
|
||||
case GOMP_MAP_RELEASE:
|
||||
case GOMP_MAP_DELETE:
|
||||
OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION (c) = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tree c2 = build_omp_clause (OMP_CLAUSE_LOCATION (c), OMP_CLAUSE_MAP);
|
||||
OMP_CLAUSE_SET_MAP_KIND (c2, GOMP_MAP_POINTER);
|
||||
if (!c_mark_addressable (t))
|
||||
OMP_CLAUSE_SET_MAP_KIND (c2, is_omp
|
||||
? GOMP_MAP_FIRSTPRIVATE_POINTER
|
||||
: GOMP_MAP_POINTER);
|
||||
if (!is_omp && !c_mark_addressable (t))
|
||||
return false;
|
||||
OMP_CLAUSE_DECL (c2) = t;
|
||||
t = build_fold_addr_expr (first);
|
||||
@ -12109,11 +12226,12 @@ c_find_omp_placeholder_r (tree *tp, int *, void *data)
|
||||
Remove any elements from the list that are invalid. */
|
||||
|
||||
tree
|
||||
c_finish_omp_clauses (tree clauses)
|
||||
c_finish_omp_clauses (tree clauses, bool is_omp, bool declare_simd)
|
||||
{
|
||||
bitmap_head generic_head, firstprivate_head, lastprivate_head;
|
||||
bitmap_head aligned_head;
|
||||
tree c, t, *pc;
|
||||
bitmap_head aligned_head, map_head, map_field_head, generic_field_head;
|
||||
tree c, t, type, *pc;
|
||||
tree simdlen = NULL_TREE, safelen = NULL_TREE;
|
||||
bool branch_seen = false;
|
||||
bool copyprivate_seen = false;
|
||||
tree *nowait_clause = NULL;
|
||||
@ -12123,6 +12241,9 @@ c_finish_omp_clauses (tree clauses)
|
||||
bitmap_initialize (&firstprivate_head, &bitmap_default_obstack);
|
||||
bitmap_initialize (&lastprivate_head, &bitmap_default_obstack);
|
||||
bitmap_initialize (&aligned_head, &bitmap_default_obstack);
|
||||
bitmap_initialize (&map_head, &bitmap_default_obstack);
|
||||
bitmap_initialize (&map_field_head, &bitmap_default_obstack);
|
||||
bitmap_initialize (&generic_field_head, &bitmap_default_obstack);
|
||||
|
||||
for (pc = &clauses, c = clauses; c ; c = *pc)
|
||||
{
|
||||
@ -12144,9 +12265,61 @@ c_finish_omp_clauses (tree clauses)
|
||||
case OMP_CLAUSE_REDUCTION:
|
||||
need_implicitly_determined = true;
|
||||
t = OMP_CLAUSE_DECL (c);
|
||||
if (TREE_CODE (t) == TREE_LIST)
|
||||
{
|
||||
if (handle_omp_array_sections (c, is_omp))
|
||||
{
|
||||
remove = true;
|
||||
break;
|
||||
}
|
||||
|
||||
t = OMP_CLAUSE_DECL (c);
|
||||
}
|
||||
t = require_complete_type (t);
|
||||
if (t == error_mark_node)
|
||||
{
|
||||
remove = true;
|
||||
break;
|
||||
}
|
||||
type = TREE_TYPE (t);
|
||||
if (TREE_CODE (t) == MEM_REF)
|
||||
type = TREE_TYPE (type);
|
||||
if (TREE_CODE (type) == ARRAY_TYPE)
|
||||
{
|
||||
tree oatype = type;
|
||||
gcc_assert (TREE_CODE (t) != MEM_REF);
|
||||
while (TREE_CODE (type) == ARRAY_TYPE)
|
||||
type = TREE_TYPE (type);
|
||||
if (integer_zerop (TYPE_SIZE_UNIT (type)))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"%qD in %<reduction%> clause is a zero size array",
|
||||
t);
|
||||
remove = true;
|
||||
break;
|
||||
}
|
||||
tree size = size_binop (EXACT_DIV_EXPR, TYPE_SIZE_UNIT (oatype),
|
||||
TYPE_SIZE_UNIT (type));
|
||||
if (integer_zerop (size))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"%qD in %<reduction%> clause is a zero size array",
|
||||
t);
|
||||
remove = true;
|
||||
break;
|
||||
}
|
||||
size = size_binop (MINUS_EXPR, size, size_one_node);
|
||||
tree index_type = build_index_type (size);
|
||||
tree atype = build_array_type (type, index_type);
|
||||
tree ptype = build_pointer_type (type);
|
||||
if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
|
||||
t = build_fold_addr_expr (t);
|
||||
t = build2 (MEM_REF, atype, t, build_int_cst (ptype, 0));
|
||||
OMP_CLAUSE_DECL (c) = t;
|
||||
}
|
||||
if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) == NULL_TREE
|
||||
&& (FLOAT_TYPE_P (TREE_TYPE (t))
|
||||
|| TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE))
|
||||
&& (FLOAT_TYPE_P (type)
|
||||
|| TREE_CODE (type) == COMPLEX_TYPE))
|
||||
{
|
||||
enum tree_code r_code = OMP_CLAUSE_REDUCTION_CODE (c);
|
||||
const char *r_name = NULL;
|
||||
@ -12158,11 +12331,11 @@ c_finish_omp_clauses (tree clauses)
|
||||
case MINUS_EXPR:
|
||||
break;
|
||||
case MIN_EXPR:
|
||||
if (TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE)
|
||||
if (TREE_CODE (type) == COMPLEX_TYPE)
|
||||
r_name = "min";
|
||||
break;
|
||||
case MAX_EXPR:
|
||||
if (TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE)
|
||||
if (TREE_CODE (type) == COMPLEX_TYPE)
|
||||
r_name = "max";
|
||||
break;
|
||||
case BIT_AND_EXPR:
|
||||
@ -12175,11 +12348,11 @@ c_finish_omp_clauses (tree clauses)
|
||||
r_name = "|";
|
||||
break;
|
||||
case TRUTH_ANDIF_EXPR:
|
||||
if (FLOAT_TYPE_P (TREE_TYPE (t)))
|
||||
if (FLOAT_TYPE_P (type))
|
||||
r_name = "&&";
|
||||
break;
|
||||
case TRUTH_ORIF_EXPR:
|
||||
if (FLOAT_TYPE_P (TREE_TYPE (t)))
|
||||
if (FLOAT_TYPE_P (type))
|
||||
r_name = "||";
|
||||
break;
|
||||
default:
|
||||
@ -12197,37 +12370,49 @@ c_finish_omp_clauses (tree clauses)
|
||||
else if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) == error_mark_node)
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"user defined reduction not found for %qD", t);
|
||||
"user defined reduction not found for %qE", t);
|
||||
remove = true;
|
||||
break;
|
||||
}
|
||||
else if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c))
|
||||
{
|
||||
tree list = OMP_CLAUSE_REDUCTION_PLACEHOLDER (c);
|
||||
tree type = TYPE_MAIN_VARIANT (TREE_TYPE (t));
|
||||
type = TYPE_MAIN_VARIANT (type);
|
||||
tree placeholder = build_decl (OMP_CLAUSE_LOCATION (c),
|
||||
VAR_DECL, NULL_TREE, type);
|
||||
tree decl_placeholder = NULL_TREE;
|
||||
OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = placeholder;
|
||||
DECL_ARTIFICIAL (placeholder) = 1;
|
||||
DECL_IGNORED_P (placeholder) = 1;
|
||||
if (TREE_CODE (t) == MEM_REF)
|
||||
{
|
||||
decl_placeholder = build_decl (OMP_CLAUSE_LOCATION (c),
|
||||
VAR_DECL, NULL_TREE, type);
|
||||
OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (c) = decl_placeholder;
|
||||
DECL_ARTIFICIAL (decl_placeholder) = 1;
|
||||
DECL_IGNORED_P (decl_placeholder) = 1;
|
||||
}
|
||||
if (TREE_ADDRESSABLE (TREE_VEC_ELT (list, 0)))
|
||||
c_mark_addressable (placeholder);
|
||||
if (TREE_ADDRESSABLE (TREE_VEC_ELT (list, 1)))
|
||||
c_mark_addressable (OMP_CLAUSE_DECL (c));
|
||||
c_mark_addressable (decl_placeholder ? decl_placeholder
|
||||
: OMP_CLAUSE_DECL (c));
|
||||
OMP_CLAUSE_REDUCTION_MERGE (c)
|
||||
= c_clone_omp_udr (TREE_VEC_ELT (list, 2),
|
||||
TREE_VEC_ELT (list, 0),
|
||||
TREE_VEC_ELT (list, 1),
|
||||
OMP_CLAUSE_DECL (c), placeholder);
|
||||
decl_placeholder ? decl_placeholder
|
||||
: OMP_CLAUSE_DECL (c), placeholder);
|
||||
OMP_CLAUSE_REDUCTION_MERGE (c)
|
||||
= build3_loc (OMP_CLAUSE_LOCATION (c), BIND_EXPR,
|
||||
void_type_node, NULL_TREE,
|
||||
OMP_CLAUSE_REDUCTION_MERGE (c), NULL_TREE);
|
||||
OMP_CLAUSE_REDUCTION_MERGE (c), NULL_TREE);
|
||||
TREE_SIDE_EFFECTS (OMP_CLAUSE_REDUCTION_MERGE (c)) = 1;
|
||||
if (TREE_VEC_LENGTH (list) == 6)
|
||||
{
|
||||
if (TREE_ADDRESSABLE (TREE_VEC_ELT (list, 3)))
|
||||
c_mark_addressable (OMP_CLAUSE_DECL (c));
|
||||
c_mark_addressable (decl_placeholder ? decl_placeholder
|
||||
: OMP_CLAUSE_DECL (c));
|
||||
if (TREE_ADDRESSABLE (TREE_VEC_ELT (list, 4)))
|
||||
c_mark_addressable (placeholder);
|
||||
tree init = TREE_VEC_ELT (list, 5);
|
||||
@ -12236,11 +12421,15 @@ c_finish_omp_clauses (tree clauses)
|
||||
OMP_CLAUSE_REDUCTION_INIT (c)
|
||||
= c_clone_omp_udr (init, TREE_VEC_ELT (list, 4),
|
||||
TREE_VEC_ELT (list, 3),
|
||||
OMP_CLAUSE_DECL (c), placeholder);
|
||||
decl_placeholder ? decl_placeholder
|
||||
: OMP_CLAUSE_DECL (c), placeholder);
|
||||
if (TREE_VEC_ELT (list, 5) == error_mark_node)
|
||||
OMP_CLAUSE_REDUCTION_INIT (c)
|
||||
= build2 (INIT_EXPR, TREE_TYPE (t), t,
|
||||
OMP_CLAUSE_REDUCTION_INIT (c));
|
||||
{
|
||||
tree v = decl_placeholder ? decl_placeholder : t;
|
||||
OMP_CLAUSE_REDUCTION_INIT (c)
|
||||
= build2 (INIT_EXPR, TREE_TYPE (v), v,
|
||||
OMP_CLAUSE_REDUCTION_INIT (c));
|
||||
}
|
||||
if (walk_tree (&OMP_CLAUSE_REDUCTION_INIT (c),
|
||||
c_find_omp_placeholder_r,
|
||||
placeholder, NULL))
|
||||
@ -12249,12 +12438,13 @@ c_finish_omp_clauses (tree clauses)
|
||||
else
|
||||
{
|
||||
tree init;
|
||||
if (AGGREGATE_TYPE_P (TREE_TYPE (t)))
|
||||
init = build_constructor (TREE_TYPE (t), NULL);
|
||||
tree v = decl_placeholder ? decl_placeholder : t;
|
||||
if (AGGREGATE_TYPE_P (TREE_TYPE (v)))
|
||||
init = build_constructor (TREE_TYPE (v), NULL);
|
||||
else
|
||||
init = fold_convert (TREE_TYPE (t), integer_zero_node);
|
||||
init = fold_convert (TREE_TYPE (v), integer_zero_node);
|
||||
OMP_CLAUSE_REDUCTION_INIT (c)
|
||||
= build2 (INIT_EXPR, TREE_TYPE (t), t, init);
|
||||
= build2 (INIT_EXPR, TREE_TYPE (v), v, init);
|
||||
}
|
||||
OMP_CLAUSE_REDUCTION_INIT (c)
|
||||
= build3_loc (OMP_CLAUSE_LOCATION (c), BIND_EXPR,
|
||||
@ -12262,7 +12452,22 @@ c_finish_omp_clauses (tree clauses)
|
||||
OMP_CLAUSE_REDUCTION_INIT (c), NULL_TREE);
|
||||
TREE_SIDE_EFFECTS (OMP_CLAUSE_REDUCTION_INIT (c)) = 1;
|
||||
}
|
||||
goto check_dup_generic;
|
||||
if (TREE_CODE (t) == MEM_REF)
|
||||
{
|
||||
if (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (t))) == NULL_TREE
|
||||
|| TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (t))))
|
||||
!= INTEGER_CST)
|
||||
{
|
||||
sorry ("variable length element type in array "
|
||||
"%<reduction%> clause");
|
||||
remove = true;
|
||||
break;
|
||||
}
|
||||
t = TREE_OPERAND (t, 0);
|
||||
if (TREE_CODE (t) == ADDR_EXPR)
|
||||
t = TREE_OPERAND (t, 0);
|
||||
}
|
||||
goto check_dup_generic_t;
|
||||
|
||||
case OMP_CLAUSE_COPYPRIVATE:
|
||||
copyprivate_seen = true;
|
||||
@ -12288,7 +12493,17 @@ c_finish_omp_clauses (tree clauses)
|
||||
goto check_dup_generic;
|
||||
|
||||
case OMP_CLAUSE_LINEAR:
|
||||
if (!declare_simd)
|
||||
need_implicitly_determined = true;
|
||||
t = OMP_CLAUSE_DECL (c);
|
||||
if (!declare_simd
|
||||
&& OMP_CLAUSE_LINEAR_KIND (c) != OMP_CLAUSE_LINEAR_DEFAULT)
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"modifier should not be specified in %<linear%> "
|
||||
"clause on %<simd%> or %<for%> constructs");
|
||||
OMP_CLAUSE_LINEAR_KIND (c) = OMP_CLAUSE_LINEAR_DEFAULT;
|
||||
}
|
||||
if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
|
||||
&& TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE)
|
||||
{
|
||||
@ -12316,6 +12531,7 @@ c_finish_omp_clauses (tree clauses)
|
||||
|
||||
check_dup_generic:
|
||||
t = OMP_CLAUSE_DECL (c);
|
||||
check_dup_generic_t:
|
||||
if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
@ -12406,9 +12622,41 @@ c_finish_omp_clauses (tree clauses)
|
||||
|
||||
case OMP_CLAUSE_DEPEND:
|
||||
t = OMP_CLAUSE_DECL (c);
|
||||
if (t == NULL_TREE)
|
||||
{
|
||||
gcc_assert (OMP_CLAUSE_DEPEND_KIND (c)
|
||||
== OMP_CLAUSE_DEPEND_SOURCE);
|
||||
break;
|
||||
}
|
||||
if (OMP_CLAUSE_DEPEND_KIND (c) == OMP_CLAUSE_DEPEND_SINK)
|
||||
{
|
||||
gcc_assert (TREE_CODE (t) == TREE_LIST);
|
||||
for (; t; t = TREE_CHAIN (t))
|
||||
{
|
||||
tree decl = TREE_VALUE (t);
|
||||
if (TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE)
|
||||
{
|
||||
tree offset = TREE_PURPOSE (t);
|
||||
bool neg = wi::neg_p ((wide_int) offset);
|
||||
offset = fold_unary (ABS_EXPR, TREE_TYPE (offset), offset);
|
||||
tree t2 = pointer_int_sum (OMP_CLAUSE_LOCATION (c),
|
||||
neg ? MINUS_EXPR : PLUS_EXPR,
|
||||
decl, offset);
|
||||
t2 = fold_build2_loc (OMP_CLAUSE_LOCATION (c), MINUS_EXPR,
|
||||
sizetype, t2, decl);
|
||||
if (t2 == error_mark_node)
|
||||
{
|
||||
remove = true;
|
||||
break;
|
||||
}
|
||||
TREE_PURPOSE (t) = t2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (TREE_CODE (t) == TREE_LIST)
|
||||
{
|
||||
if (handle_omp_array_sections (c))
|
||||
if (handle_omp_array_sections (c, is_omp))
|
||||
remove = true;
|
||||
break;
|
||||
}
|
||||
@ -12431,7 +12679,7 @@ c_finish_omp_clauses (tree clauses)
|
||||
t = OMP_CLAUSE_DECL (c);
|
||||
if (TREE_CODE (t) == TREE_LIST)
|
||||
{
|
||||
if (handle_omp_array_sections (c))
|
||||
if (handle_omp_array_sections (c, is_omp))
|
||||
remove = true;
|
||||
else
|
||||
{
|
||||
@ -12444,12 +12692,85 @@ c_finish_omp_clauses (tree clauses)
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
remove = true;
|
||||
}
|
||||
while (TREE_CODE (t) == ARRAY_REF)
|
||||
t = TREE_OPERAND (t, 0);
|
||||
if (TREE_CODE (t) == COMPONENT_REF
|
||||
&& TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
|
||||
{
|
||||
while (TREE_CODE (t) == COMPONENT_REF)
|
||||
t = TREE_OPERAND (t, 0);
|
||||
if (bitmap_bit_p (&map_field_head, DECL_UID (t)))
|
||||
break;
|
||||
if (bitmap_bit_p (&map_head, DECL_UID (t)))
|
||||
{
|
||||
if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_MAP)
|
||||
error ("%qD appears more than once in motion"
|
||||
" clauses", t);
|
||||
else
|
||||
error ("%qD appears more than once in map"
|
||||
" clauses", t);
|
||||
remove = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bitmap_set_bit (&map_head, DECL_UID (t));
|
||||
bitmap_set_bit (&map_field_head, DECL_UID (t));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (t == error_mark_node)
|
||||
remove = true;
|
||||
else if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
|
||||
{
|
||||
remove = true;
|
||||
break;
|
||||
}
|
||||
if (TREE_CODE (t) == COMPONENT_REF
|
||||
&& is_omp
|
||||
&& OMP_CLAUSE_CODE (c) != OMP_CLAUSE__CACHE_)
|
||||
{
|
||||
if (DECL_BIT_FIELD (TREE_OPERAND (t, 1)))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"bit-field %qE in %qs clause",
|
||||
t, omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
remove = true;
|
||||
}
|
||||
else if (!lang_hooks.types.omp_mappable_type (TREE_TYPE (t)))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"%qE does not have a mappable type in %qs clause",
|
||||
t, omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
remove = true;
|
||||
}
|
||||
while (TREE_CODE (t) == COMPONENT_REF)
|
||||
{
|
||||
if (TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0)))
|
||||
== UNION_TYPE)
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"%qE is a member of a union", t);
|
||||
remove = true;
|
||||
break;
|
||||
}
|
||||
t = TREE_OPERAND (t, 0);
|
||||
}
|
||||
if (remove)
|
||||
break;
|
||||
if (VAR_P (t) || TREE_CODE (t) == PARM_DECL)
|
||||
{
|
||||
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
|
||||
&& (OMP_CLAUSE_MAP_KIND (c)
|
||||
== GOMP_MAP_FIRSTPRIVATE_POINTER))
|
||||
{
|
||||
if (bitmap_bit_p (&generic_field_head, DECL_UID (t)))
|
||||
break;
|
||||
}
|
||||
else if (bitmap_bit_p (&map_field_head, DECL_UID (t)))
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"%qE is not a variable in %qs clause", t,
|
||||
@ -12467,8 +12788,11 @@ c_finish_omp_clauses (tree clauses)
|
||||
remove = true;
|
||||
else if (!(OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
|
||||
&& (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER
|
||||
|| (OMP_CLAUSE_MAP_KIND (c)
|
||||
== GOMP_MAP_FIRSTPRIVATE_POINTER)
|
||||
|| (OMP_CLAUSE_MAP_KIND (c)
|
||||
== GOMP_MAP_FORCE_DEVICEPTR)))
|
||||
&& t == OMP_CLAUSE_DECL (c)
|
||||
&& !lang_hooks.types.omp_mappable_type (TREE_TYPE (t)))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
@ -12476,7 +12800,24 @@ c_finish_omp_clauses (tree clauses)
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
remove = true;
|
||||
}
|
||||
else if (bitmap_bit_p (&generic_head, DECL_UID (t)))
|
||||
else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
|
||||
&& OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER)
|
||||
{
|
||||
if (bitmap_bit_p (&generic_head, DECL_UID (t))
|
||||
|| bitmap_bit_p (&firstprivate_head, DECL_UID (t)))
|
||||
{
|
||||
error ("%qD appears more than once in data clauses", t);
|
||||
remove = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bitmap_set_bit (&generic_head, DECL_UID (t));
|
||||
if (t != OMP_CLAUSE_DECL (c)
|
||||
&& TREE_CODE (OMP_CLAUSE_DECL (c)) == COMPONENT_REF)
|
||||
bitmap_set_bit (&generic_field_head, DECL_UID (t));
|
||||
}
|
||||
}
|
||||
else if (bitmap_bit_p (&map_head, DECL_UID (t)))
|
||||
{
|
||||
if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_MAP)
|
||||
error ("%qD appears more than once in motion clauses", t);
|
||||
@ -12485,7 +12826,42 @@ c_finish_omp_clauses (tree clauses)
|
||||
remove = true;
|
||||
}
|
||||
else
|
||||
bitmap_set_bit (&generic_head, DECL_UID (t));
|
||||
{
|
||||
bitmap_set_bit (&map_head, DECL_UID (t));
|
||||
if (t != OMP_CLAUSE_DECL (c)
|
||||
&& TREE_CODE (OMP_CLAUSE_DECL (c)) == COMPONENT_REF)
|
||||
bitmap_set_bit (&map_field_head, DECL_UID (t));
|
||||
}
|
||||
break;
|
||||
|
||||
case OMP_CLAUSE_TO_DECLARE:
|
||||
t = OMP_CLAUSE_DECL (c);
|
||||
if (TREE_CODE (t) == FUNCTION_DECL)
|
||||
break;
|
||||
/* FALLTHRU */
|
||||
case OMP_CLAUSE_LINK:
|
||||
t = OMP_CLAUSE_DECL (c);
|
||||
if (!VAR_P (t))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"%qE is not a variable in clause %qs", t,
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
remove = true;
|
||||
}
|
||||
else if (DECL_THREAD_LOCAL_P (t))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"%qD is threadprivate variable in %qs clause", t,
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
remove = true;
|
||||
}
|
||||
else if (!lang_hooks.types.omp_mappable_type (TREE_TYPE (t)))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"%qD does not have a mappable type in %qs clause", t,
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
remove = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case OMP_CLAUSE_UNIFORM:
|
||||
@ -12503,6 +12879,19 @@ c_finish_omp_clauses (tree clauses)
|
||||
}
|
||||
goto check_dup_generic;
|
||||
|
||||
case OMP_CLAUSE_IS_DEVICE_PTR:
|
||||
case OMP_CLAUSE_USE_DEVICE_PTR:
|
||||
t = OMP_CLAUSE_DECL (c);
|
||||
if (TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE
|
||||
&& TREE_CODE (TREE_TYPE (t)) != ARRAY_TYPE)
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (c),
|
||||
"%qs variable is neither a pointer nor an array",
|
||||
omp_clause_code_name[OMP_CLAUSE_CODE (c)]);
|
||||
remove = true;
|
||||
}
|
||||
goto check_dup_generic;
|
||||
|
||||
case OMP_CLAUSE_NOWAIT:
|
||||
if (copyprivate_seen)
|
||||
{
|
||||
@ -12527,8 +12916,6 @@ c_finish_omp_clauses (tree clauses)
|
||||
case OMP_CLAUSE_COLLAPSE:
|
||||
case OMP_CLAUSE_FINAL:
|
||||
case OMP_CLAUSE_MERGEABLE:
|
||||
case OMP_CLAUSE_SAFELEN:
|
||||
case OMP_CLAUSE_SIMDLEN:
|
||||
case OMP_CLAUSE_DEVICE:
|
||||
case OMP_CLAUSE_DIST_SCHEDULE:
|
||||
case OMP_CLAUSE_PARALLEL:
|
||||
@ -12536,6 +12923,14 @@ c_finish_omp_clauses (tree clauses)
|
||||
case OMP_CLAUSE_SECTIONS:
|
||||
case OMP_CLAUSE_TASKGROUP:
|
||||
case OMP_CLAUSE_PROC_BIND:
|
||||
case OMP_CLAUSE_PRIORITY:
|
||||
case OMP_CLAUSE_GRAINSIZE:
|
||||
case OMP_CLAUSE_NUM_TASKS:
|
||||
case OMP_CLAUSE_NOGROUP:
|
||||
case OMP_CLAUSE_THREADS:
|
||||
case OMP_CLAUSE_SIMD:
|
||||
case OMP_CLAUSE_HINT:
|
||||
case OMP_CLAUSE_DEFAULTMAP:
|
||||
case OMP_CLAUSE__CILK_FOR_COUNT_:
|
||||
case OMP_CLAUSE_NUM_GANGS:
|
||||
case OMP_CLAUSE_NUM_WORKERS:
|
||||
@ -12550,6 +12945,15 @@ c_finish_omp_clauses (tree clauses)
|
||||
pc = &OMP_CLAUSE_CHAIN (c);
|
||||
continue;
|
||||
|
||||
case OMP_CLAUSE_SAFELEN:
|
||||
safelen = c;
|
||||
pc = &OMP_CLAUSE_CHAIN (c);
|
||||
continue;
|
||||
case OMP_CLAUSE_SIMDLEN:
|
||||
simdlen = c;
|
||||
pc = &OMP_CLAUSE_CHAIN (c);
|
||||
continue;
|
||||
|
||||
case OMP_CLAUSE_INBRANCH:
|
||||
case OMP_CLAUSE_NOTINBRANCH:
|
||||
if (branch_seen)
|
||||
@ -12619,6 +13023,18 @@ c_finish_omp_clauses (tree clauses)
|
||||
pc = &OMP_CLAUSE_CHAIN (c);
|
||||
}
|
||||
|
||||
if (simdlen
|
||||
&& safelen
|
||||
&& tree_int_cst_lt (OMP_CLAUSE_SAFELEN_EXPR (safelen),
|
||||
OMP_CLAUSE_SIMDLEN_EXPR (simdlen)))
|
||||
{
|
||||
error_at (OMP_CLAUSE_LOCATION (simdlen),
|
||||
"%<simdlen%> clause value is bigger than "
|
||||
"%<safelen%> clause value");
|
||||
OMP_CLAUSE_SIMDLEN_EXPR (simdlen)
|
||||
= OMP_CLAUSE_SAFELEN_EXPR (safelen);
|
||||
}
|
||||
|
||||
bitmap_obstack_release (NULL);
|
||||
return clauses;
|
||||
}
|
||||
|
@ -643,8 +643,14 @@ enum cgraph_simd_clone_arg_type
|
||||
{
|
||||
SIMD_CLONE_ARG_TYPE_VECTOR,
|
||||
SIMD_CLONE_ARG_TYPE_UNIFORM,
|
||||
/* These are only for integer/pointer arguments passed by value. */
|
||||
SIMD_CLONE_ARG_TYPE_LINEAR_CONSTANT_STEP,
|
||||
SIMD_CLONE_ARG_TYPE_LINEAR_VARIABLE_STEP,
|
||||
/* These 3 are only for reference type arguments or arguments passed
|
||||
by reference. */
|
||||
SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP,
|
||||
SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP,
|
||||
SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP,
|
||||
SIMD_CLONE_ARG_TYPE_MASK
|
||||
};
|
||||
|
||||
@ -684,7 +690,7 @@ struct GTY(()) cgraph_simd_clone_arg {
|
||||
variable), uniform, or vector. */
|
||||
enum cgraph_simd_clone_arg_type arg_type;
|
||||
|
||||
/* For arg_type SIMD_CLONE_ARG_TYPE_LINEAR_CONSTANT_STEP this is
|
||||
/* For arg_type SIMD_CLONE_ARG_TYPE_LINEAR_*CONSTANT_STEP this is
|
||||
the constant linear step, if arg_type is
|
||||
SIMD_CLONE_ARG_TYPE_LINEAR_VARIABLE_STEP, this is index of
|
||||
the uniform argument holding the step, otherwise 0. */
|
||||
|
@ -112,6 +112,7 @@ struct gomp_atomic_load;
|
||||
struct gomp_atomic_store;
|
||||
struct gomp_continue;
|
||||
struct gomp_critical;
|
||||
struct gomp_ordered;
|
||||
struct gomp_for;
|
||||
struct gomp_parallel;
|
||||
struct gomp_task;
|
||||
|
147
gcc/cp/ChangeLog
147
gcc/cp/ChangeLog
@ -1,3 +1,150 @@
|
||||
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.
|
||||
|
||||
2015-10-12 Ville Voutilainen <ville.voutilainen@gmail.com>
|
||||
|
||||
PR c++/58566
|
||||
|
@ -6697,6 +6697,8 @@ finish_struct_1 (tree t)
|
||||
|
||||
finish_struct_bits (t);
|
||||
set_method_tm_attributes (t);
|
||||
if (flag_openmp || flag_openmp_simd)
|
||||
finish_omp_declare_simd_methods (t);
|
||||
|
||||
/* Complete the rtl for any static member objects of the type we're
|
||||
working on. */
|
||||
|
@ -713,6 +713,7 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
|
||||
case OMP_FOR:
|
||||
case OMP_SIMD:
|
||||
case OMP_DISTRIBUTE:
|
||||
case OMP_TASKLOOP:
|
||||
ret = cp_gimplify_omp_for (expr_p, pre_p);
|
||||
break;
|
||||
|
||||
@ -1294,7 +1295,8 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
|
||||
genericize_break_stmt (stmt_p);
|
||||
else if (TREE_CODE (stmt) == OMP_FOR
|
||||
|| TREE_CODE (stmt) == OMP_SIMD
|
||||
|| TREE_CODE (stmt) == OMP_DISTRIBUTE)
|
||||
|| TREE_CODE (stmt) == OMP_DISTRIBUTE
|
||||
|| TREE_CODE (stmt) == OMP_TASKLOOP)
|
||||
genericize_omp_for_stmt (stmt_p, walk_subtrees, data);
|
||||
else if (TREE_CODE (stmt) == SIZEOF_EXPR)
|
||||
{
|
||||
@ -1752,16 +1754,7 @@ cxx_omp_finish_clause (tree c, gimple_seq *)
|
||||
if (decl == error_mark_node)
|
||||
make_shared = true;
|
||||
else if (TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE)
|
||||
{
|
||||
if (is_invisiref_parm (decl))
|
||||
inner_type = TREE_TYPE (inner_type);
|
||||
else
|
||||
{
|
||||
error ("%qE implicitly determined as %<firstprivate%> has reference type",
|
||||
decl);
|
||||
make_shared = true;
|
||||
}
|
||||
}
|
||||
inner_type = TREE_TYPE (inner_type);
|
||||
|
||||
/* We're interested in the base element, not arrays. */
|
||||
while (TREE_CODE (inner_type) == ARRAY_TYPE)
|
||||
@ -1778,3 +1771,19 @@ cxx_omp_finish_clause (tree c, gimple_seq *)
|
||||
if (make_shared)
|
||||
OMP_CLAUSE_CODE (c) = OMP_CLAUSE_SHARED;
|
||||
}
|
||||
|
||||
/* Return true if DECL's DECL_VALUE_EXPR (if any) should be
|
||||
disregarded in OpenMP construct, because it is going to be
|
||||
remapped during OpenMP lowering. SHARED is true if DECL
|
||||
is going to be shared, false if it is going to be privatized. */
|
||||
|
||||
bool
|
||||
cxx_omp_disregard_value_expr (tree decl, bool shared)
|
||||
{
|
||||
return !shared
|
||||
&& VAR_P (decl)
|
||||
&& DECL_HAS_VALUE_EXPR_P (decl)
|
||||
&& DECL_ARTIFICIAL (decl)
|
||||
&& DECL_LANG_SPECIFIC (decl)
|
||||
&& DECL_OMP_PRIVATIZED_MEMBER (decl);
|
||||
}
|
||||
|
@ -150,6 +150,8 @@ extern void cp_common_init_ts (void);
|
||||
#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE cxx_omp_privatize_by_reference
|
||||
#undef LANG_HOOKS_OMP_MAPPABLE_TYPE
|
||||
#define LANG_HOOKS_OMP_MAPPABLE_TYPE cp_omp_mappable_type
|
||||
#undef LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR
|
||||
#define LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR cxx_omp_disregard_value_expr
|
||||
|
||||
#undef LANG_HOOKS_EH_USE_CXA_END_CLEANUP
|
||||
#define LANG_HOOKS_EH_USE_CXA_END_CLEANUP true
|
||||
|
@ -58,7 +58,8 @@ c-common.h, not after.
|
||||
STMT_EXPR_NO_SCOPE (in STMT_EXPR)
|
||||
BIND_EXPR_TRY_BLOCK (in BIND_EXPR)
|
||||
TYPENAME_IS_ENUM_P (in TYPENAME_TYPE)
|
||||
OMP_FOR_GIMPLIFYING_P (in OMP_FOR, OMP_SIMD and OMP_DISTRIBUTE)
|
||||
OMP_FOR_GIMPLIFYING_P (in OMP_FOR, OMP_SIMD, OMP_DISTRIBUTE,
|
||||
and OMP_TASKLOOP)
|
||||
BASELINK_QUALIFIED_P (in BASELINK)
|
||||
TARGET_EXPR_IMPLICIT_P (in TARGET_EXPR)
|
||||
TEMPLATE_PARM_PARAMETER_PACK (in TEMPLATE_PARM_INDEX)
|
||||
@ -2172,6 +2173,7 @@ struct GTY(()) lang_decl_base {
|
||||
unsigned repo_available_p : 1; /* var or fn */
|
||||
unsigned threadprivate_or_deleted_p : 1; /* var or fn */
|
||||
unsigned anticipated_p : 1; /* fn, type or template */
|
||||
/* anticipated_p reused as DECL_OMP_PRIVATIZED_MEMBER in var */
|
||||
unsigned friend_or_tls : 1; /* var, fn, type or template */
|
||||
unsigned template_conv_p : 1; /* var or template */
|
||||
unsigned odr_used : 1; /* var or fn */
|
||||
@ -3512,6 +3514,11 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
|
||||
(DECL_LANG_SPECIFIC (TYPE_FUNCTION_OR_TEMPLATE_DECL_CHECK (NODE)) \
|
||||
->u.base.anticipated_p)
|
||||
|
||||
/* True for artificial decls added for OpenMP privatized non-static
|
||||
data members. */
|
||||
#define DECL_OMP_PRIVATIZED_MEMBER(NODE) \
|
||||
(DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE))->u.base.anticipated_p)
|
||||
|
||||
/* Nonzero if NODE is a FUNCTION_DECL which was declared as a friend
|
||||
within a class but has not been declared in the surrounding scope.
|
||||
The function is invisible except via argument dependent lookup. */
|
||||
@ -6301,7 +6308,12 @@ extern void finalize_nrv (tree *, tree, tree);
|
||||
extern tree omp_reduction_id (enum tree_code, tree, tree);
|
||||
extern tree cp_remove_omp_priv_cleanup_stmt (tree *, int *, void *);
|
||||
extern void cp_check_omp_declare_reduction (tree);
|
||||
extern tree finish_omp_clauses (tree);
|
||||
extern void finish_omp_declare_simd_methods (tree);
|
||||
extern tree finish_omp_clauses (tree, bool, bool = false);
|
||||
extern tree push_omp_privatization_clauses (bool);
|
||||
extern void pop_omp_privatization_clauses (tree);
|
||||
extern void save_omp_privatization_clauses (vec<tree> &);
|
||||
extern void restore_omp_privatization_clauses (vec<tree> &);
|
||||
extern void finish_omp_threadprivate (tree);
|
||||
extern tree begin_omp_structured_block (void);
|
||||
extern tree finish_omp_structured_block (tree);
|
||||
@ -6314,7 +6326,7 @@ extern tree begin_omp_task (void);
|
||||
extern tree finish_omp_task (tree, tree);
|
||||
extern tree finish_omp_for (location_t, enum tree_code,
|
||||
tree, tree, tree, tree, tree,
|
||||
tree, tree);
|
||||
tree, tree, tree);
|
||||
extern void finish_omp_atomic (enum tree_code, enum tree_code,
|
||||
tree, tree, tree, tree, tree,
|
||||
bool);
|
||||
@ -6324,6 +6336,7 @@ extern void finish_omp_taskwait (void);
|
||||
extern void finish_omp_taskyield (void);
|
||||
extern void finish_omp_cancel (tree);
|
||||
extern void finish_omp_cancellation_point (tree);
|
||||
extern tree omp_privatize_field (tree);
|
||||
extern tree begin_transaction_stmt (location_t, tree *, int);
|
||||
extern void finish_transaction_stmt (tree, tree, int, tree);
|
||||
extern tree build_transaction_expr (location_t, tree, int, tree);
|
||||
@ -6693,6 +6706,7 @@ extern tree cxx_omp_clause_assign_op (tree, tree, tree);
|
||||
extern tree cxx_omp_clause_dtor (tree, tree);
|
||||
extern void cxx_omp_finish_clause (tree, gimple_seq *);
|
||||
extern bool cxx_omp_privatize_by_reference (const_tree);
|
||||
extern bool cxx_omp_disregard_value_expr (tree, bool);
|
||||
|
||||
/* in name-lookup.c */
|
||||
extern void suggest_alternatives_for (location_t, tree);
|
||||
|
1547
gcc/cp/parser.c
1547
gcc/cp/parser.c
File diff suppressed because it is too large
Load Diff
317
gcc/cp/pt.c
317
gcc/cp/pt.c
@ -9519,7 +9519,7 @@ can_complete_type_without_circularity (tree type)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static tree tsubst_omp_clauses (tree, bool, tree, tsubst_flags_t, tree);
|
||||
static tree tsubst_omp_clauses (tree, bool, bool, tree, tsubst_flags_t, tree);
|
||||
|
||||
/* Apply any attributes which had to be deferred until instantiation
|
||||
time. DECL_P, ATTRIBUTES and ATTR_FLAGS are as cplus_decl_attributes;
|
||||
@ -9568,10 +9568,10 @@ apply_late_template_attributes (tree *decl_p, tree attributes, int attr_flags,
|
||||
&& TREE_VALUE (t))
|
||||
{
|
||||
tree clauses = TREE_VALUE (TREE_VALUE (t));
|
||||
clauses = tsubst_omp_clauses (clauses, true, args,
|
||||
clauses = tsubst_omp_clauses (clauses, true, false, args,
|
||||
complain, in_decl);
|
||||
c_omp_declare_simd_clauses_to_decls (*decl_p, clauses);
|
||||
clauses = finish_omp_clauses (clauses);
|
||||
clauses = finish_omp_clauses (clauses, false, true);
|
||||
tree parms = DECL_ARGUMENTS (*decl_p);
|
||||
clauses
|
||||
= c_omp_declare_simd_clauses_to_numbers (parms, clauses);
|
||||
@ -14290,13 +14290,21 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
|
||||
}
|
||||
|
||||
/* Helper function for tsubst_omp_clauses, used for instantiation of
|
||||
OMP_CLAUSE_DECL of clauses that handles also OpenMP array sections
|
||||
represented with TREE_LIST. */
|
||||
OMP_CLAUSE_DECL of clauses. */
|
||||
|
||||
static tree
|
||||
tsubst_omp_clause_decl (tree decl, tree args, tsubst_flags_t complain,
|
||||
tree in_decl)
|
||||
{
|
||||
if (decl == NULL_TREE)
|
||||
return NULL_TREE;
|
||||
|
||||
/* Handle an OpenMP array section represented as a TREE_LIST (or
|
||||
OMP_CLAUSE_DEPEND_KIND). An OMP_CLAUSE_DEPEND (with a depend
|
||||
kind of OMP_CLAUSE_DEPEND_SINK) can also be represented as a
|
||||
TREE_LIST. We can handle it exactly the same as an array section
|
||||
(purpose, value, and a chain), even though the nomenclature
|
||||
(low_bound, length, etc) is different. */
|
||||
if (TREE_CODE (decl) == TREE_LIST)
|
||||
{
|
||||
tree low_bound
|
||||
@ -14310,18 +14318,29 @@ tsubst_omp_clause_decl (tree decl, tree args, tsubst_flags_t complain,
|
||||
&& TREE_VALUE (decl) == length
|
||||
&& TREE_CHAIN (decl) == chain)
|
||||
return decl;
|
||||
return tree_cons (low_bound, length, chain);
|
||||
tree ret = tree_cons (low_bound, length, chain);
|
||||
OMP_CLAUSE_DEPEND_SINK_NEGATIVE (ret)
|
||||
= OMP_CLAUSE_DEPEND_SINK_NEGATIVE (decl);
|
||||
return ret;
|
||||
}
|
||||
return tsubst_copy (decl, args, complain, in_decl);
|
||||
tree ret = tsubst_expr (decl, args, complain, in_decl,
|
||||
/*integral_constant_expression_p=*/false);
|
||||
/* Undo convert_from_reference tsubst_expr could have called. */
|
||||
if (decl
|
||||
&& REFERENCE_REF_P (ret)
|
||||
&& !REFERENCE_REF_P (decl))
|
||||
ret = TREE_OPERAND (ret, 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Like tsubst_copy, but specifically for OpenMP clauses. */
|
||||
|
||||
static tree
|
||||
tsubst_omp_clauses (tree clauses, bool declare_simd,
|
||||
tsubst_omp_clauses (tree clauses, bool declare_simd, bool allow_fields,
|
||||
tree args, tsubst_flags_t complain, tree in_decl)
|
||||
{
|
||||
tree new_clauses = NULL, nc, oc;
|
||||
tree new_clauses = NULL_TREE, nc, oc;
|
||||
tree linear_no_step = NULL_TREE;
|
||||
|
||||
for (oc = clauses; oc ; oc = OMP_CLAUSE_CHAIN (oc))
|
||||
{
|
||||
@ -14347,13 +14366,12 @@ tsubst_omp_clauses (tree clauses, bool declare_simd,
|
||||
case OMP_CLAUSE_COPYIN:
|
||||
case OMP_CLAUSE_COPYPRIVATE:
|
||||
case OMP_CLAUSE_UNIFORM:
|
||||
OMP_CLAUSE_DECL (nc) = tsubst_copy (OMP_CLAUSE_DECL (oc), args,
|
||||
complain, in_decl);
|
||||
break;
|
||||
case OMP_CLAUSE_DEPEND:
|
||||
case OMP_CLAUSE_FROM:
|
||||
case OMP_CLAUSE_TO:
|
||||
case OMP_CLAUSE_MAP:
|
||||
case OMP_CLAUSE_USE_DEVICE_PTR:
|
||||
case OMP_CLAUSE_IS_DEVICE_PTR:
|
||||
OMP_CLAUSE_DECL (nc)
|
||||
= tsubst_omp_clause_decl (OMP_CLAUSE_DECL (oc), args, complain,
|
||||
in_decl);
|
||||
@ -14369,6 +14387,11 @@ tsubst_omp_clauses (tree clauses, bool declare_simd,
|
||||
case OMP_CLAUSE_THREAD_LIMIT:
|
||||
case OMP_CLAUSE_SAFELEN:
|
||||
case OMP_CLAUSE_SIMDLEN:
|
||||
case OMP_CLAUSE_NUM_TASKS:
|
||||
case OMP_CLAUSE_GRAINSIZE:
|
||||
case OMP_CLAUSE_PRIORITY:
|
||||
case OMP_CLAUSE_ORDERED:
|
||||
case OMP_CLAUSE_HINT:
|
||||
OMP_CLAUSE_OPERAND (nc, 0)
|
||||
= tsubst_expr (OMP_CLAUSE_OPERAND (oc, 0), args, complain,
|
||||
in_decl, /*integral_constant_expression_p=*/false);
|
||||
@ -14389,19 +14412,26 @@ tsubst_omp_clauses (tree clauses, bool declare_simd,
|
||||
else
|
||||
gcc_assert (identifier_p (placeholder));
|
||||
}
|
||||
OMP_CLAUSE_DECL (nc) = tsubst_copy (OMP_CLAUSE_DECL (oc), args,
|
||||
complain, in_decl);
|
||||
OMP_CLAUSE_DECL (nc)
|
||||
= tsubst_omp_clause_decl (OMP_CLAUSE_DECL (oc), args, complain,
|
||||
in_decl);
|
||||
break;
|
||||
case OMP_CLAUSE_LINEAR:
|
||||
case OMP_CLAUSE_ALIGNED:
|
||||
OMP_CLAUSE_DECL (nc) = tsubst_copy (OMP_CLAUSE_DECL (oc), args,
|
||||
complain, in_decl);
|
||||
OMP_CLAUSE_DECL (nc)
|
||||
= tsubst_omp_clause_decl (OMP_CLAUSE_DECL (oc), args, complain,
|
||||
in_decl);
|
||||
OMP_CLAUSE_OPERAND (nc, 1)
|
||||
= tsubst_expr (OMP_CLAUSE_OPERAND (oc, 1), args, complain,
|
||||
in_decl, /*integral_constant_expression_p=*/false);
|
||||
if (OMP_CLAUSE_CODE (oc) == OMP_CLAUSE_LINEAR
|
||||
&& OMP_CLAUSE_LINEAR_STEP (oc) == NULL_TREE)
|
||||
{
|
||||
gcc_assert (!linear_no_step);
|
||||
linear_no_step = nc;
|
||||
}
|
||||
break;
|
||||
case OMP_CLAUSE_NOWAIT:
|
||||
case OMP_CLAUSE_ORDERED:
|
||||
case OMP_CLAUSE_DEFAULT:
|
||||
case OMP_CLAUSE_UNTIED:
|
||||
case OMP_CLAUSE_MERGEABLE:
|
||||
@ -14412,15 +14442,86 @@ tsubst_omp_clauses (tree clauses, bool declare_simd,
|
||||
case OMP_CLAUSE_PARALLEL:
|
||||
case OMP_CLAUSE_SECTIONS:
|
||||
case OMP_CLAUSE_TASKGROUP:
|
||||
case OMP_CLAUSE_NOGROUP:
|
||||
case OMP_CLAUSE_THREADS:
|
||||
case OMP_CLAUSE_SIMD:
|
||||
case OMP_CLAUSE_DEFAULTMAP:
|
||||
break;
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
if (allow_fields)
|
||||
switch (OMP_CLAUSE_CODE (nc))
|
||||
{
|
||||
case OMP_CLAUSE_PRIVATE:
|
||||
case OMP_CLAUSE_FIRSTPRIVATE:
|
||||
case OMP_CLAUSE_LASTPRIVATE:
|
||||
case OMP_CLAUSE_COPYPRIVATE:
|
||||
case OMP_CLAUSE_LINEAR:
|
||||
case OMP_CLAUSE_REDUCTION:
|
||||
case OMP_CLAUSE_USE_DEVICE_PTR:
|
||||
case OMP_CLAUSE_IS_DEVICE_PTR:
|
||||
/* tsubst_expr on SCOPE_REF results in returning
|
||||
finish_non_static_data_member result. Undo that here. */
|
||||
if (TREE_CODE (OMP_CLAUSE_DECL (oc)) == SCOPE_REF
|
||||
&& (TREE_CODE (TREE_OPERAND (OMP_CLAUSE_DECL (oc), 1))
|
||||
== IDENTIFIER_NODE))
|
||||
{
|
||||
tree t = OMP_CLAUSE_DECL (nc);
|
||||
tree v = t;
|
||||
while (v)
|
||||
switch (TREE_CODE (v))
|
||||
{
|
||||
case COMPONENT_REF:
|
||||
case MEM_REF:
|
||||
case INDIRECT_REF:
|
||||
CASE_CONVERT:
|
||||
case POINTER_PLUS_EXPR:
|
||||
v = TREE_OPERAND (v, 0);
|
||||
continue;
|
||||
case PARM_DECL:
|
||||
if (DECL_CONTEXT (v) == current_function_decl
|
||||
&& DECL_ARTIFICIAL (v)
|
||||
&& DECL_NAME (v) == this_identifier)
|
||||
OMP_CLAUSE_DECL (nc) = TREE_OPERAND (t, 1);
|
||||
/* FALLTHRU */
|
||||
default:
|
||||
v = NULL_TREE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (VAR_P (OMP_CLAUSE_DECL (oc))
|
||||
&& DECL_HAS_VALUE_EXPR_P (OMP_CLAUSE_DECL (oc))
|
||||
&& DECL_ARTIFICIAL (OMP_CLAUSE_DECL (oc))
|
||||
&& DECL_LANG_SPECIFIC (OMP_CLAUSE_DECL (oc))
|
||||
&& DECL_OMP_PRIVATIZED_MEMBER (OMP_CLAUSE_DECL (oc)))
|
||||
{
|
||||
tree decl = OMP_CLAUSE_DECL (nc);
|
||||
if (VAR_P (decl))
|
||||
{
|
||||
if (!DECL_LANG_SPECIFIC (decl))
|
||||
retrofit_lang_decl (decl);
|
||||
DECL_OMP_PRIVATIZED_MEMBER (decl) = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
new_clauses = nreverse (new_clauses);
|
||||
if (!declare_simd)
|
||||
new_clauses = finish_omp_clauses (new_clauses);
|
||||
{
|
||||
new_clauses = finish_omp_clauses (new_clauses, allow_fields);
|
||||
if (linear_no_step)
|
||||
for (nc = new_clauses; nc; nc = OMP_CLAUSE_CHAIN (nc))
|
||||
if (nc == linear_no_step)
|
||||
{
|
||||
OMP_CLAUSE_LINEAR_STEP (nc) = NULL_TREE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new_clauses;
|
||||
}
|
||||
|
||||
@ -14467,11 +14568,17 @@ tsubst_copy_asm_operands (tree t, tree args, tsubst_flags_t complain,
|
||||
#undef RECUR
|
||||
}
|
||||
|
||||
/* Used to temporarily communicate the list of #pragma omp parallel
|
||||
clauses to #pragma omp for instantiation if they are combined
|
||||
together. */
|
||||
|
||||
static tree *omp_parallel_combined_clauses;
|
||||
|
||||
/* Substitute one OMP_FOR iterator. */
|
||||
|
||||
static void
|
||||
tsubst_omp_for_iterator (tree t, int i, tree declv, tree initv,
|
||||
tree condv, tree incrv, tree *clauses,
|
||||
tsubst_omp_for_iterator (tree t, int i, tree declv, tree orig_declv,
|
||||
tree initv, tree condv, tree incrv, tree *clauses,
|
||||
tree args, tsubst_flags_t complain, tree in_decl,
|
||||
bool integral_constant_expression_p)
|
||||
{
|
||||
@ -14482,6 +14589,13 @@ tsubst_omp_for_iterator (tree t, int i, tree declv, tree initv,
|
||||
|
||||
init = TREE_VEC_ELT (OMP_FOR_INIT (t), i);
|
||||
gcc_assert (TREE_CODE (init) == MODIFY_EXPR);
|
||||
|
||||
if (orig_declv && OMP_FOR_ORIG_DECLS (t))
|
||||
{
|
||||
tree o = TREE_VEC_ELT (OMP_FOR_ORIG_DECLS (t), i);
|
||||
TREE_VEC_ELT (orig_declv, i) = RECUR (o);
|
||||
}
|
||||
|
||||
decl = TREE_OPERAND (init, 0);
|
||||
init = TREE_OPERAND (init, 1);
|
||||
tree decl_expr = NULL_TREE;
|
||||
@ -14495,7 +14609,41 @@ tsubst_omp_for_iterator (tree t, int i, tree declv, tree initv,
|
||||
decl = tsubst_decl (decl, args, complain);
|
||||
}
|
||||
else
|
||||
decl = RECUR (decl);
|
||||
{
|
||||
if (TREE_CODE (decl) == SCOPE_REF)
|
||||
{
|
||||
decl = RECUR (decl);
|
||||
if (TREE_CODE (decl) == COMPONENT_REF)
|
||||
{
|
||||
tree v = decl;
|
||||
while (v)
|
||||
switch (TREE_CODE (v))
|
||||
{
|
||||
case COMPONENT_REF:
|
||||
case MEM_REF:
|
||||
case INDIRECT_REF:
|
||||
CASE_CONVERT:
|
||||
case POINTER_PLUS_EXPR:
|
||||
v = TREE_OPERAND (v, 0);
|
||||
continue;
|
||||
case PARM_DECL:
|
||||
if (DECL_CONTEXT (v) == current_function_decl
|
||||
&& DECL_ARTIFICIAL (v)
|
||||
&& DECL_NAME (v) == this_identifier)
|
||||
{
|
||||
decl = TREE_OPERAND (decl, 1);
|
||||
decl = omp_privatize_field (decl);
|
||||
}
|
||||
/* FALLTHRU */
|
||||
default:
|
||||
v = NULL_TREE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
decl = RECUR (decl);
|
||||
}
|
||||
init = RECUR (init);
|
||||
|
||||
tree auto_node = type_uses_auto (TREE_TYPE (decl));
|
||||
@ -14542,25 +14690,51 @@ tsubst_omp_for_iterator (tree t, int i, tree declv, tree initv,
|
||||
}
|
||||
else if (init)
|
||||
{
|
||||
tree c;
|
||||
for (c = *clauses; c ; c = OMP_CLAUSE_CHAIN (c))
|
||||
tree *pc;
|
||||
int j;
|
||||
for (j = (omp_parallel_combined_clauses == NULL ? 1 : 0); j < 2; j++)
|
||||
{
|
||||
if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_PRIVATE
|
||||
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE)
|
||||
&& OMP_CLAUSE_DECL (c) == decl)
|
||||
for (pc = j ? clauses : omp_parallel_combined_clauses; *pc; )
|
||||
{
|
||||
if (OMP_CLAUSE_CODE (*pc) == OMP_CLAUSE_PRIVATE
|
||||
&& OMP_CLAUSE_DECL (*pc) == decl)
|
||||
break;
|
||||
else if (OMP_CLAUSE_CODE (*pc) == OMP_CLAUSE_LASTPRIVATE
|
||||
&& OMP_CLAUSE_DECL (*pc) == decl)
|
||||
{
|
||||
if (j)
|
||||
break;
|
||||
/* Move lastprivate (decl) clause to OMP_FOR_CLAUSES. */
|
||||
tree c = *pc;
|
||||
*pc = OMP_CLAUSE_CHAIN (c);
|
||||
OMP_CLAUSE_CHAIN (c) = *clauses;
|
||||
*clauses = c;
|
||||
}
|
||||
else if (OMP_CLAUSE_CODE (*pc) == OMP_CLAUSE_FIRSTPRIVATE
|
||||
&& OMP_CLAUSE_DECL (*pc) == decl)
|
||||
{
|
||||
error ("iteration variable %qD should not be firstprivate",
|
||||
decl);
|
||||
*pc = OMP_CLAUSE_CHAIN (*pc);
|
||||
}
|
||||
else if (OMP_CLAUSE_CODE (*pc) == OMP_CLAUSE_REDUCTION
|
||||
&& OMP_CLAUSE_DECL (*pc) == decl)
|
||||
{
|
||||
error ("iteration variable %qD should not be reduction",
|
||||
decl);
|
||||
*pc = OMP_CLAUSE_CHAIN (*pc);
|
||||
}
|
||||
else
|
||||
pc = &OMP_CLAUSE_CHAIN (*pc);
|
||||
}
|
||||
if (*pc)
|
||||
break;
|
||||
else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE
|
||||
&& OMP_CLAUSE_DECL (c) == decl)
|
||||
error ("iteration variable %qD should not be firstprivate", decl);
|
||||
else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
|
||||
&& OMP_CLAUSE_DECL (c) == decl)
|
||||
error ("iteration variable %qD should not be reduction", decl);
|
||||
}
|
||||
if (c == NULL)
|
||||
if (*pc == NULL_TREE)
|
||||
{
|
||||
c = build_omp_clause (input_location, OMP_CLAUSE_PRIVATE);
|
||||
tree c = build_omp_clause (input_location, OMP_CLAUSE_PRIVATE);
|
||||
OMP_CLAUSE_DECL (c) = decl;
|
||||
c = finish_omp_clauses (c);
|
||||
c = finish_omp_clauses (c, true);
|
||||
if (c)
|
||||
{
|
||||
OMP_CLAUSE_CHAIN (c) = *clauses;
|
||||
@ -15021,20 +15195,27 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
|
||||
break;
|
||||
|
||||
case OMP_PARALLEL:
|
||||
tmp = tsubst_omp_clauses (OMP_PARALLEL_CLAUSES (t), false,
|
||||
r = push_omp_privatization_clauses (OMP_PARALLEL_COMBINED (t));
|
||||
tmp = tsubst_omp_clauses (OMP_PARALLEL_CLAUSES (t), false, true,
|
||||
args, complain, in_decl);
|
||||
if (OMP_PARALLEL_COMBINED (t))
|
||||
omp_parallel_combined_clauses = &tmp;
|
||||
stmt = begin_omp_parallel ();
|
||||
RECUR (OMP_PARALLEL_BODY (t));
|
||||
gcc_assert (omp_parallel_combined_clauses == NULL);
|
||||
OMP_PARALLEL_COMBINED (finish_omp_parallel (tmp, stmt))
|
||||
= OMP_PARALLEL_COMBINED (t);
|
||||
pop_omp_privatization_clauses (r);
|
||||
break;
|
||||
|
||||
case OMP_TASK:
|
||||
tmp = tsubst_omp_clauses (OMP_TASK_CLAUSES (t), false,
|
||||
r = push_omp_privatization_clauses (false);
|
||||
tmp = tsubst_omp_clauses (OMP_TASK_CLAUSES (t), false, true,
|
||||
args, complain, in_decl);
|
||||
stmt = begin_omp_task ();
|
||||
RECUR (OMP_TASK_BODY (t));
|
||||
finish_omp_task (tmp, stmt);
|
||||
pop_omp_privatization_clauses (r);
|
||||
break;
|
||||
|
||||
case OMP_FOR:
|
||||
@ -15042,17 +15223,22 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
|
||||
case CILK_SIMD:
|
||||
case CILK_FOR:
|
||||
case OMP_DISTRIBUTE:
|
||||
case OMP_TASKLOOP:
|
||||
{
|
||||
tree clauses, body, pre_body;
|
||||
tree declv = NULL_TREE, initv = NULL_TREE, condv = NULL_TREE;
|
||||
tree orig_declv = NULL_TREE;
|
||||
tree incrv = NULL_TREE;
|
||||
int i;
|
||||
|
||||
clauses = tsubst_omp_clauses (OMP_FOR_CLAUSES (t), false,
|
||||
r = push_omp_privatization_clauses (OMP_FOR_INIT (t) == NULL_TREE);
|
||||
clauses = tsubst_omp_clauses (OMP_FOR_CLAUSES (t), false, true,
|
||||
args, complain, in_decl);
|
||||
if (OMP_FOR_INIT (t) != NULL_TREE)
|
||||
{
|
||||
declv = make_tree_vec (TREE_VEC_LENGTH (OMP_FOR_INIT (t)));
|
||||
if (TREE_CODE (t) == OMP_FOR && OMP_FOR_ORIG_DECLS (t))
|
||||
orig_declv = make_tree_vec (TREE_VEC_LENGTH (OMP_FOR_INIT (t)));
|
||||
initv = make_tree_vec (TREE_VEC_LENGTH (OMP_FOR_INIT (t)));
|
||||
condv = make_tree_vec (TREE_VEC_LENGTH (OMP_FOR_INIT (t)));
|
||||
incrv = make_tree_vec (TREE_VEC_LENGTH (OMP_FOR_INIT (t)));
|
||||
@ -15066,17 +15252,19 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
|
||||
|
||||
if (OMP_FOR_INIT (t) != NULL_TREE)
|
||||
for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (t)); i++)
|
||||
tsubst_omp_for_iterator (t, i, declv, initv, condv, incrv,
|
||||
&clauses, args, complain, in_decl,
|
||||
tsubst_omp_for_iterator (t, i, declv, orig_declv, initv, condv,
|
||||
incrv, &clauses, args, complain, in_decl,
|
||||
integral_constant_expression_p);
|
||||
omp_parallel_combined_clauses = NULL;
|
||||
|
||||
body = push_stmt_list ();
|
||||
RECUR (OMP_FOR_BODY (t));
|
||||
body = pop_stmt_list (body);
|
||||
|
||||
if (OMP_FOR_INIT (t) != NULL_TREE)
|
||||
t = finish_omp_for (EXPR_LOCATION (t), TREE_CODE (t), declv, initv,
|
||||
condv, incrv, body, pre_body, clauses);
|
||||
t = finish_omp_for (EXPR_LOCATION (t), TREE_CODE (t), declv,
|
||||
orig_declv, initv, condv, incrv, body, pre_body,
|
||||
clauses);
|
||||
else
|
||||
{
|
||||
t = make_node (TREE_CODE (t));
|
||||
@ -15089,13 +15277,19 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
|
||||
}
|
||||
|
||||
add_stmt (finish_omp_structured_block (stmt));
|
||||
pop_omp_privatization_clauses (r);
|
||||
}
|
||||
break;
|
||||
|
||||
case OMP_SECTIONS:
|
||||
omp_parallel_combined_clauses = NULL;
|
||||
/* FALLTHRU */
|
||||
case OMP_SINGLE:
|
||||
case OMP_TEAMS:
|
||||
tmp = tsubst_omp_clauses (OMP_CLAUSES (t), false,
|
||||
case OMP_CRITICAL:
|
||||
r = push_omp_privatization_clauses (TREE_CODE (t) == OMP_TEAMS
|
||||
&& OMP_TEAMS_COMBINED (t));
|
||||
tmp = tsubst_omp_clauses (OMP_CLAUSES (t), false, true,
|
||||
args, complain, in_decl);
|
||||
stmt = push_stmt_list ();
|
||||
RECUR (OMP_BODY (t));
|
||||
@ -15105,11 +15299,12 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
|
||||
OMP_BODY (t) = stmt;
|
||||
OMP_CLAUSES (t) = tmp;
|
||||
add_stmt (t);
|
||||
pop_omp_privatization_clauses (r);
|
||||
break;
|
||||
|
||||
case OMP_TARGET_DATA:
|
||||
case OMP_TARGET:
|
||||
tmp = tsubst_omp_clauses (OMP_CLAUSES (t), false,
|
||||
tmp = tsubst_omp_clauses (OMP_CLAUSES (t), false, true,
|
||||
args, complain, in_decl);
|
||||
keep_next_level (true);
|
||||
stmt = begin_omp_structured_block ();
|
||||
@ -15124,18 +15319,31 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
|
||||
break;
|
||||
|
||||
case OMP_TARGET_UPDATE:
|
||||
tmp = tsubst_omp_clauses (OMP_TARGET_UPDATE_CLAUSES (t), false,
|
||||
case OMP_TARGET_ENTER_DATA:
|
||||
case OMP_TARGET_EXIT_DATA:
|
||||
tmp = tsubst_omp_clauses (OMP_STANDALONE_CLAUSES (t), false, true,
|
||||
args, complain, in_decl);
|
||||
t = copy_node (t);
|
||||
OMP_TARGET_UPDATE_CLAUSES (t) = tmp;
|
||||
OMP_STANDALONE_CLAUSES (t) = tmp;
|
||||
add_stmt (t);
|
||||
break;
|
||||
|
||||
case OMP_ORDERED:
|
||||
tmp = tsubst_omp_clauses (OMP_ORDERED_CLAUSES (t), false, true,
|
||||
args, complain, in_decl);
|
||||
stmt = push_stmt_list ();
|
||||
RECUR (OMP_BODY (t));
|
||||
stmt = pop_stmt_list (stmt);
|
||||
|
||||
t = copy_node (t);
|
||||
OMP_BODY (t) = stmt;
|
||||
OMP_ORDERED_CLAUSES (t) = tmp;
|
||||
add_stmt (t);
|
||||
break;
|
||||
|
||||
case OMP_SECTION:
|
||||
case OMP_CRITICAL:
|
||||
case OMP_MASTER:
|
||||
case OMP_TASKGROUP:
|
||||
case OMP_ORDERED:
|
||||
stmt = push_stmt_list ();
|
||||
RECUR (OMP_BODY (t));
|
||||
stmt = pop_stmt_list (stmt);
|
||||
@ -21053,7 +21261,7 @@ instantiate_decl (tree d, int defer_ok,
|
||||
bool external_p;
|
||||
bool deleted_p;
|
||||
tree fn_context;
|
||||
bool nested;
|
||||
bool nested = false;
|
||||
|
||||
/* This function should only be used to instantiate templates for
|
||||
functions and static member variables. */
|
||||
@ -21278,6 +21486,10 @@ instantiate_decl (tree d, int defer_ok,
|
||||
|
||||
fn_context = decl_function_context (d);
|
||||
nested = (current_function_decl != NULL_TREE);
|
||||
vec<tree> omp_privatization_save;
|
||||
if (nested)
|
||||
save_omp_privatization_clauses (omp_privatization_save);
|
||||
|
||||
if (!fn_context)
|
||||
push_to_top_level ();
|
||||
else
|
||||
@ -21447,6 +21659,8 @@ out:
|
||||
c_inhibit_evaluation_warnings = saved_inhibit_evaluation_warnings;
|
||||
pop_deferring_access_checks ();
|
||||
pop_tinst_level ();
|
||||
if (nested)
|
||||
restore_omp_privatization_clauses (omp_privatization_save);
|
||||
|
||||
timevar_pop (TV_TEMPLATE_INST);
|
||||
|
||||
@ -22811,7 +23025,7 @@ dependent_template_id_p (tree tmpl, tree args)
|
||||
}
|
||||
|
||||
/* Returns TRUE if OMP_FOR with DECLV, INITV, CONDV and INCRV vectors
|
||||
is dependent. */
|
||||
are dependent. */
|
||||
|
||||
bool
|
||||
dependent_omp_for_p (tree declv, tree initv, tree condv, tree incrv)
|
||||
@ -22828,7 +23042,8 @@ dependent_omp_for_p (tree declv, tree initv, tree condv, tree incrv)
|
||||
tree cond = TREE_VEC_ELT (condv, i);
|
||||
tree incr = TREE_VEC_ELT (incrv, i);
|
||||
|
||||
if (type_dependent_expression_p (decl))
|
||||
if (type_dependent_expression_p (decl)
|
||||
|| TREE_CODE (decl) == SCOPE_REF)
|
||||
return true;
|
||||
|
||||
if (init && type_dependent_expression_p (init))
|
||||
|
1332
gcc/cp/semantics.c
1332
gcc/cp/semantics.c
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,27 @@
|
||||
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.
|
||||
|
||||
2015-10-07 Andre Vehreschild <vehre@gcc.gnu.org>
|
||||
|
||||
PR fortran/65889
|
||||
|
@ -633,7 +633,14 @@ gfc_init_builtin_functions (void)
|
||||
ARG6, ARG7) NAME,
|
||||
#define DEF_FUNCTION_TYPE_8(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8) NAME,
|
||||
#define DEF_FUNCTION_TYPE_9(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9) NAME,
|
||||
#define DEF_FUNCTION_TYPE_10(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10) NAME,
|
||||
#define DEF_FUNCTION_TYPE_11(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_6(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6) NAME,
|
||||
@ -651,7 +658,11 @@ gfc_init_builtin_functions (void)
|
||||
#undef DEF_FUNCTION_TYPE_6
|
||||
#undef DEF_FUNCTION_TYPE_7
|
||||
#undef DEF_FUNCTION_TYPE_8
|
||||
#undef DEF_FUNCTION_TYPE_9
|
||||
#undef DEF_FUNCTION_TYPE_10
|
||||
#undef DEF_FUNCTION_TYPE_11
|
||||
#undef DEF_FUNCTION_TYPE_VAR_0
|
||||
#undef DEF_FUNCTION_TYPE_VAR_1
|
||||
#undef DEF_FUNCTION_TYPE_VAR_2
|
||||
#undef DEF_FUNCTION_TYPE_VAR_6
|
||||
#undef DEF_FUNCTION_TYPE_VAR_7
|
||||
@ -1086,10 +1097,60 @@ gfc_init_builtin_functions (void)
|
||||
builtin_types[(int) ARG7], \
|
||||
builtin_types[(int) ARG8], \
|
||||
NULL_TREE);
|
||||
#define DEF_FUNCTION_TYPE_9(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9) \
|
||||
builtin_types[(int) ENUM] \
|
||||
= build_function_type_list (builtin_types[(int) RETURN], \
|
||||
builtin_types[(int) ARG1], \
|
||||
builtin_types[(int) ARG2], \
|
||||
builtin_types[(int) ARG3], \
|
||||
builtin_types[(int) ARG4], \
|
||||
builtin_types[(int) ARG5], \
|
||||
builtin_types[(int) ARG6], \
|
||||
builtin_types[(int) ARG7], \
|
||||
builtin_types[(int) ARG8], \
|
||||
builtin_types[(int) ARG9], \
|
||||
NULL_TREE);
|
||||
#define DEF_FUNCTION_TYPE_10(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, \
|
||||
ARG5, ARG6, ARG7, ARG8, ARG9, ARG10) \
|
||||
builtin_types[(int) ENUM] \
|
||||
= build_function_type_list (builtin_types[(int) RETURN], \
|
||||
builtin_types[(int) ARG1], \
|
||||
builtin_types[(int) ARG2], \
|
||||
builtin_types[(int) ARG3], \
|
||||
builtin_types[(int) ARG4], \
|
||||
builtin_types[(int) ARG5], \
|
||||
builtin_types[(int) ARG6], \
|
||||
builtin_types[(int) ARG7], \
|
||||
builtin_types[(int) ARG8], \
|
||||
builtin_types[(int) ARG9], \
|
||||
builtin_types[(int) ARG10], \
|
||||
NULL_TREE);
|
||||
#define DEF_FUNCTION_TYPE_11(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, \
|
||||
ARG5, ARG6, ARG7, ARG8, ARG9, ARG10, ARG11)\
|
||||
builtin_types[(int) ENUM] \
|
||||
= build_function_type_list (builtin_types[(int) RETURN], \
|
||||
builtin_types[(int) ARG1], \
|
||||
builtin_types[(int) ARG2], \
|
||||
builtin_types[(int) ARG3], \
|
||||
builtin_types[(int) ARG4], \
|
||||
builtin_types[(int) ARG5], \
|
||||
builtin_types[(int) ARG6], \
|
||||
builtin_types[(int) ARG7], \
|
||||
builtin_types[(int) ARG8], \
|
||||
builtin_types[(int) ARG9], \
|
||||
builtin_types[(int) ARG10], \
|
||||
builtin_types[(int) ARG11], \
|
||||
NULL_TREE);
|
||||
#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
|
||||
builtin_types[(int) ENUM] \
|
||||
= build_varargs_function_type_list (builtin_types[(int) RETURN], \
|
||||
NULL_TREE);
|
||||
#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
|
||||
builtin_types[(int) ENUM] \
|
||||
= build_varargs_function_type_list (builtin_types[(int) RETURN], \
|
||||
builtin_types[(int) ARG1], \
|
||||
NULL_TREE);
|
||||
#define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \
|
||||
builtin_types[(int) ENUM] \
|
||||
= build_varargs_function_type_list (builtin_types[(int) RETURN], \
|
||||
@ -1133,7 +1194,9 @@ gfc_init_builtin_functions (void)
|
||||
#undef DEF_FUNCTION_TYPE_6
|
||||
#undef DEF_FUNCTION_TYPE_7
|
||||
#undef DEF_FUNCTION_TYPE_8
|
||||
#undef DEF_FUNCTION_TYPE_10
|
||||
#undef DEF_FUNCTION_TYPE_VAR_0
|
||||
#undef DEF_FUNCTION_TYPE_VAR_1
|
||||
#undef DEF_FUNCTION_TYPE_VAR_2
|
||||
#undef DEF_FUNCTION_TYPE_VAR_6
|
||||
#undef DEF_FUNCTION_TYPE_VAR_7
|
||||
|
@ -2245,6 +2245,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
|
||||
gfc_add_block_to_block (block, &se.post);
|
||||
|
||||
c = build_omp_clause (where.lb->location, OMP_CLAUSE_IF);
|
||||
OMP_CLAUSE_IF_MODIFIER (c) = ERROR_MARK;
|
||||
OMP_CLAUSE_IF_EXPR (c) = if_var;
|
||||
omp_clauses = gfc_trans_add_clause (c, omp_clauses);
|
||||
}
|
||||
@ -2348,6 +2349,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
|
||||
if (clauses->ordered)
|
||||
{
|
||||
c = build_omp_clause (where.lb->location, OMP_CLAUSE_ORDERED);
|
||||
OMP_CLAUSE_ORDERED_EXPR (c) = NULL_TREE;
|
||||
omp_clauses = gfc_trans_add_clause (c, omp_clauses);
|
||||
}
|
||||
|
||||
@ -2523,6 +2525,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
|
||||
if (clauses->seq)
|
||||
{
|
||||
c = build_omp_clause (where.lb->location, OMP_CLAUSE_ORDERED);
|
||||
OMP_CLAUSE_ORDERED_EXPR (c) = NULL_TREE;
|
||||
omp_clauses = gfc_trans_add_clause (c, omp_clauses);
|
||||
}
|
||||
if (clauses->independent)
|
||||
@ -3095,7 +3098,8 @@ gfc_trans_omp_critical (gfc_code *code)
|
||||
if (code->ext.omp_name != NULL)
|
||||
name = get_identifier (code->ext.omp_name);
|
||||
stmt = gfc_trans_code (code->block->next);
|
||||
return build2_loc (input_location, OMP_CRITICAL, void_type_node, stmt, name);
|
||||
return build3_loc (input_location, OMP_CRITICAL, void_type_node, stmt,
|
||||
NULL_TREE, name);
|
||||
}
|
||||
|
||||
typedef struct dovar_init_d {
|
||||
@ -3486,7 +3490,8 @@ gfc_trans_omp_master (gfc_code *code)
|
||||
static tree
|
||||
gfc_trans_omp_ordered (gfc_code *code)
|
||||
{
|
||||
return build1_v (OMP_ORDERED, gfc_trans_code (code->block->next));
|
||||
return build2_loc (input_location, OMP_ORDERED, void_type_node,
|
||||
gfc_trans_code (code->block->next), NULL_TREE);
|
||||
}
|
||||
|
||||
static tree
|
||||
|
@ -154,6 +154,11 @@ DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_VPTR_PTR_INT, BT_VOID, BT_SIZE,
|
||||
BT_VOLATILE_PTR, BT_PTR, BT_INT)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_VOID, BT_SIZE,
|
||||
BT_CONST_VOLATILE_PTR, BT_PTR, BT_INT)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR,
|
||||
BT_BOOL, BT_UINT, BT_PTR_LONG, BT_PTR_LONG, BT_PTR_LONG)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR,
|
||||
BT_BOOL, BT_UINT, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG,
|
||||
BT_PTR_ULONGLONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_5 (BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT,
|
||||
@ -165,6 +170,12 @@ DEF_FUNCTION_TYPE_5 (BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT, BT_VOID, BT_SIZE,
|
||||
BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT)
|
||||
DEF_FUNCTION_TYPE_5 (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR,
|
||||
BT_VOID, BT_INT, BT_SIZE, BT_PTR, BT_PTR, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR,
|
||||
BT_BOOL, BT_UINT, BT_PTR_LONG, BT_LONG, BT_PTR_LONG,
|
||||
BT_PTR_LONG)
|
||||
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR,
|
||||
BT_BOOL, BT_UINT, BT_PTR_ULONGLONG, BT_ULONGLONG,
|
||||
BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
|
||||
BT_BOOL, BT_LONG, BT_LONG, BT_LONG, BT_LONG,
|
||||
@ -189,8 +200,6 @@ DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I16_BOOL_INT_INT,
|
||||
BT_INT)
|
||||
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_SIZE_VPTR_PTR_PTR_INT_INT, BT_BOOL, BT_SIZE,
|
||||
BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT, BT_INT)
|
||||
DEF_FUNCTION_TYPE_6 (BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
|
||||
BT_VOID, BT_INT, BT_PTR, BT_SIZE, BT_PTR, BT_PTR, BT_PTR)
|
||||
|
||||
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
|
||||
@ -199,20 +208,39 @@ DEF_FUNCTION_TYPE_7 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
|
||||
BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
|
||||
BT_ULONGLONG, BT_ULONGLONG,
|
||||
BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
|
||||
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
|
||||
BT_VOID, BT_INT, BT_PTR_FN_VOID_PTR, BT_PTR, BT_SIZE,
|
||||
BT_PTR, BT_PTR, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR,
|
||||
BT_VOID, BT_INT, BT_SIZE, BT_PTR, BT_PTR, BT_PTR, BT_UINT,
|
||||
BT_PTR)
|
||||
|
||||
DEF_FUNCTION_TYPE_8 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
|
||||
BT_LONG, BT_LONG, BT_LONG, BT_LONG, BT_UINT)
|
||||
DEF_FUNCTION_TYPE_8 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR,
|
||||
DEF_FUNCTION_TYPE_8 (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR,
|
||||
BT_VOID, BT_INT, BT_PTR_FN_VOID_PTR, BT_SIZE, BT_PTR,
|
||||
BT_PTR, BT_PTR, BT_UINT, BT_PTR)
|
||||
|
||||
DEF_FUNCTION_TYPE_9 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR,
|
||||
BT_PTR_FN_VOID_PTR_PTR, BT_LONG, BT_LONG,
|
||||
BT_BOOL, BT_UINT, BT_PTR)
|
||||
BT_BOOL, BT_UINT, BT_PTR, BT_INT)
|
||||
|
||||
DEF_FUNCTION_TYPE_11 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR,
|
||||
BT_PTR_FN_VOID_PTR_PTR, BT_LONG, BT_LONG,
|
||||
BT_UINT, BT_LONG, BT_INT, BT_LONG, BT_LONG, BT_LONG)
|
||||
DEF_FUNCTION_TYPE_11 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR,
|
||||
BT_PTR_FN_VOID_PTR_PTR, BT_LONG, BT_LONG,
|
||||
BT_UINT, BT_LONG, BT_INT,
|
||||
BT_ULONGLONG, BT_ULONGLONG, BT_ULONGLONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_0 (BT_FN_VOID_VAR, BT_VOID)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_LONG_VAR,
|
||||
BT_VOID, BT_LONG)
|
||||
DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_ULL_VAR,
|
||||
BT_VOID, BT_ULONGLONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_2 (BT_FN_VOID_INT_INT_VAR, BT_VOID, BT_INT, BT_INT)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_7 (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_INT_INT_VAR,
|
||||
|
@ -1134,6 +1134,9 @@ dump_gimple_omp_for (pretty_printer *buffer, gomp_for *gs, int spc, int flags)
|
||||
case GF_OMP_FOR_KIND_DISTRIBUTE:
|
||||
kind = " distribute";
|
||||
break;
|
||||
case GF_OMP_FOR_KIND_TASKLOOP:
|
||||
kind = " taskloop";
|
||||
break;
|
||||
case GF_OMP_FOR_KIND_CILKFOR:
|
||||
kind = " _Cilk_for";
|
||||
break;
|
||||
@ -1174,6 +1177,9 @@ dump_gimple_omp_for (pretty_printer *buffer, gomp_for *gs, int spc, int flags)
|
||||
case GF_OMP_FOR_KIND_DISTRIBUTE:
|
||||
pp_string (buffer, "#pragma omp distribute");
|
||||
break;
|
||||
case GF_OMP_FOR_KIND_TASKLOOP:
|
||||
pp_string (buffer, "#pragma omp taskloop");
|
||||
break;
|
||||
case GF_OMP_FOR_KIND_CILKFOR:
|
||||
break;
|
||||
case GF_OMP_FOR_KIND_OACC_LOOP:
|
||||
@ -1330,6 +1336,12 @@ dump_gimple_omp_target (pretty_printer *buffer, gomp_target *gs,
|
||||
case GF_OMP_TARGET_KIND_UPDATE:
|
||||
kind = " update";
|
||||
break;
|
||||
case GF_OMP_TARGET_KIND_ENTER_DATA:
|
||||
kind = " enter data";
|
||||
break;
|
||||
case GF_OMP_TARGET_KIND_EXIT_DATA:
|
||||
kind = " exit data";
|
||||
break;
|
||||
case GF_OMP_TARGET_KIND_OACC_KERNELS:
|
||||
kind = " oacc_kernels";
|
||||
break;
|
||||
@ -1477,9 +1489,6 @@ dump_gimple_omp_block (pretty_printer *buffer, gimple *gs, int spc, int flags)
|
||||
case GIMPLE_OMP_TASKGROUP:
|
||||
pp_string (buffer, "#pragma omp taskgroup");
|
||||
break;
|
||||
case GIMPLE_OMP_ORDERED:
|
||||
pp_string (buffer, "#pragma omp ordered");
|
||||
break;
|
||||
case GIMPLE_OMP_SECTION:
|
||||
pp_string (buffer, "#pragma omp section");
|
||||
break;
|
||||
@ -1517,6 +1526,32 @@ dump_gimple_omp_critical (pretty_printer *buffer, gomp_critical *gs,
|
||||
flags, false);
|
||||
pp_right_paren (buffer);
|
||||
}
|
||||
dump_omp_clauses (buffer, gimple_omp_critical_clauses (gs), spc, flags);
|
||||
if (!gimple_seq_empty_p (gimple_omp_body (gs)))
|
||||
{
|
||||
newline_and_indent (buffer, spc + 2);
|
||||
pp_left_brace (buffer);
|
||||
pp_newline (buffer);
|
||||
dump_gimple_seq (buffer, gimple_omp_body (gs), spc + 4, flags);
|
||||
newline_and_indent (buffer, spc + 2);
|
||||
pp_right_brace (buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Dump a GIMPLE_OMP_ORDERED tuple on the pretty_printer BUFFER. */
|
||||
|
||||
static void
|
||||
dump_gimple_omp_ordered (pretty_printer *buffer, gomp_ordered *gs,
|
||||
int spc, int flags)
|
||||
{
|
||||
if (flags & TDF_RAW)
|
||||
dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S> >", gs,
|
||||
gimple_omp_body (gs));
|
||||
else
|
||||
{
|
||||
pp_string (buffer, "#pragma omp ordered");
|
||||
dump_omp_clauses (buffer, gimple_omp_ordered_clauses (gs), spc, flags);
|
||||
if (!gimple_seq_empty_p (gimple_omp_body (gs)))
|
||||
{
|
||||
newline_and_indent (buffer, spc + 2);
|
||||
@ -1969,7 +2004,10 @@ dump_gimple_omp_task (pretty_printer *buffer, gomp_task *gs, int spc,
|
||||
else
|
||||
{
|
||||
gimple_seq body;
|
||||
pp_string (buffer, "#pragma omp task");
|
||||
if (gimple_omp_task_taskloop_p (gs))
|
||||
pp_string (buffer, "#pragma omp taskloop");
|
||||
else
|
||||
pp_string (buffer, "#pragma omp task");
|
||||
dump_omp_clauses (buffer, gimple_omp_task_clauses (gs), spc, flags);
|
||||
if (gimple_omp_task_child_fn (gs))
|
||||
{
|
||||
@ -2235,11 +2273,15 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple *gs, int spc, int flags)
|
||||
|
||||
case GIMPLE_OMP_MASTER:
|
||||
case GIMPLE_OMP_TASKGROUP:
|
||||
case GIMPLE_OMP_ORDERED:
|
||||
case GIMPLE_OMP_SECTION:
|
||||
dump_gimple_omp_block (buffer, gs, spc, flags);
|
||||
break;
|
||||
|
||||
case GIMPLE_OMP_ORDERED:
|
||||
dump_gimple_omp_ordered (buffer, as_a <gomp_ordered *> (gs), spc,
|
||||
flags);
|
||||
break;
|
||||
|
||||
case GIMPLE_OMP_CRITICAL:
|
||||
dump_gimple_omp_critical (buffer, as_a <gomp_critical *> (gs), spc,
|
||||
flags);
|
||||
|
@ -320,6 +320,20 @@ walk_gimple_op (gimple *stmt, walk_tree_fn callback_op,
|
||||
callback_op, wi, pset);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = walk_tree (gimple_omp_critical_clauses_ptr (omp_stmt),
|
||||
callback_op, wi, pset);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
break;
|
||||
|
||||
case GIMPLE_OMP_ORDERED:
|
||||
{
|
||||
gomp_ordered *omp_stmt = as_a <gomp_ordered *> (stmt);
|
||||
ret = walk_tree (gimple_omp_ordered_clauses_ptr (omp_stmt),
|
||||
callback_op, wi, pset);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
break;
|
||||
|
||||
|
31
gcc/gimple.c
31
gcc/gimple.c
@ -838,14 +838,16 @@ gimple_build_debug_source_bind_stat (tree var, tree value,
|
||||
/* Build a GIMPLE_OMP_CRITICAL statement.
|
||||
|
||||
BODY is the sequence of statements for which only one thread can execute.
|
||||
NAME is optional identifier for this critical block. */
|
||||
NAME is optional identifier for this critical block.
|
||||
CLAUSES are clauses for this critical block. */
|
||||
|
||||
gomp_critical *
|
||||
gimple_build_omp_critical (gimple_seq body, tree name)
|
||||
gimple_build_omp_critical (gimple_seq body, tree name, tree clauses)
|
||||
{
|
||||
gomp_critical *p
|
||||
= as_a <gomp_critical *> (gimple_alloc (GIMPLE_OMP_CRITICAL, 0));
|
||||
gimple_omp_critical_set_name (p, name);
|
||||
gimple_omp_critical_set_clauses (p, clauses);
|
||||
if (body)
|
||||
gimple_omp_set_body (p, body);
|
||||
|
||||
@ -994,12 +996,15 @@ gimple_build_omp_continue (tree control_def, tree control_use)
|
||||
/* Build a GIMPLE_OMP_ORDERED statement.
|
||||
|
||||
BODY is the sequence of statements inside a loop that will executed in
|
||||
sequence. */
|
||||
sequence.
|
||||
CLAUSES are clauses for this statement. */
|
||||
|
||||
gimple *
|
||||
gimple_build_omp_ordered (gimple_seq body)
|
||||
gomp_ordered *
|
||||
gimple_build_omp_ordered (gimple_seq body, tree clauses)
|
||||
{
|
||||
gimple *p = gimple_alloc (GIMPLE_OMP_ORDERED, 0);
|
||||
gomp_ordered *p
|
||||
= as_a <gomp_ordered *> (gimple_alloc (GIMPLE_OMP_ORDERED, 0));
|
||||
gimple_omp_ordered_set_clauses (p, clauses);
|
||||
if (body)
|
||||
gimple_omp_set_body (p, body);
|
||||
|
||||
@ -1779,9 +1784,18 @@ gimple_copy (gimple *stmt)
|
||||
goto copy_omp_body;
|
||||
|
||||
case GIMPLE_OMP_CRITICAL:
|
||||
t = unshare_expr (gimple_omp_critical_name (
|
||||
as_a <gomp_critical *> (stmt)));
|
||||
t = unshare_expr (gimple_omp_critical_name
|
||||
(as_a <gomp_critical *> (stmt)));
|
||||
gimple_omp_critical_set_name (as_a <gomp_critical *> (copy), t);
|
||||
t = unshare_expr (gimple_omp_critical_clauses
|
||||
(as_a <gomp_critical *> (stmt)));
|
||||
gimple_omp_critical_set_clauses (as_a <gomp_critical *> (copy), t);
|
||||
goto copy_omp_body;
|
||||
|
||||
case GIMPLE_OMP_ORDERED:
|
||||
t = unshare_expr (gimple_omp_ordered_clauses
|
||||
(as_a <gomp_ordered *> (stmt)));
|
||||
gimple_omp_ordered_set_clauses (as_a <gomp_ordered *> (copy), t);
|
||||
goto copy_omp_body;
|
||||
|
||||
case GIMPLE_OMP_SECTIONS:
|
||||
@ -1797,7 +1811,6 @@ gimple_copy (gimple *stmt)
|
||||
case GIMPLE_OMP_SECTION:
|
||||
case GIMPLE_OMP_MASTER:
|
||||
case GIMPLE_OMP_TASKGROUP:
|
||||
case GIMPLE_OMP_ORDERED:
|
||||
copy_omp_body:
|
||||
new_seq = gimple_seq_copy (gimple_omp_body (stmt));
|
||||
gimple_omp_set_body (copy, new_seq);
|
||||
|
@ -283,10 +283,6 @@ DEFGSCODE(GIMPLE_OMP_MASTER, "gimple_omp_master", GSS_OMP)
|
||||
BODY is the sequence of statements to execute in the taskgroup section. */
|
||||
DEFGSCODE(GIMPLE_OMP_TASKGROUP, "gimple_omp_taskgroup", GSS_OMP)
|
||||
|
||||
/* GIMPLE_OMP_ORDERED <BODY> represents #pragma omp ordered.
|
||||
BODY is the sequence of statements to execute in the ordered section. */
|
||||
DEFGSCODE(GIMPLE_OMP_ORDERED, "gimple_omp_ordered", GSS_OMP)
|
||||
|
||||
/* GIMPLE_OMP_PARALLEL <BODY, CLAUSES, CHILD_FN, DATA_ARG> represents
|
||||
|
||||
#pragma omp parallel [CLAUSES]
|
||||
@ -375,6 +371,11 @@ DEFGSCODE(GIMPLE_OMP_TARGET, "gimple_omp_target", GSS_OMP_PARALLEL_LAYOUT)
|
||||
CLAUSES is an OMP_CLAUSE chain holding the associated clauses. */
|
||||
DEFGSCODE(GIMPLE_OMP_TEAMS, "gimple_omp_teams", GSS_OMP_SINGLE_LAYOUT)
|
||||
|
||||
/* GIMPLE_OMP_ORDERED <BODY, CLAUSES> represents #pragma omp ordered.
|
||||
BODY is the sequence of statements to execute in the ordered section.
|
||||
CLAUSES is an OMP_CLAUSE chain holding the associated clauses. */
|
||||
DEFGSCODE(GIMPLE_OMP_ORDERED, "gimple_omp_ordered", GSS_OMP_SINGLE_LAYOUT)
|
||||
|
||||
/* GIMPLE_PREDICT <PREDICT, OUTCOME> specifies a hint for branch prediction.
|
||||
|
||||
PREDICT is one of the predictors from predict.def.
|
||||
|
151
gcc/gimple.h
151
gcc/gimple.h
@ -146,26 +146,30 @@ enum gf_mask {
|
||||
GF_CALL_CTRL_ALTERING = 1 << 7,
|
||||
GF_CALL_WITH_BOUNDS = 1 << 8,
|
||||
GF_OMP_PARALLEL_COMBINED = 1 << 0,
|
||||
GF_OMP_FOR_KIND_MASK = (1 << 3) - 1,
|
||||
GF_OMP_TASK_TASKLOOP = 1 << 0,
|
||||
GF_OMP_FOR_KIND_MASK = (1 << 4) - 1,
|
||||
GF_OMP_FOR_KIND_FOR = 0,
|
||||
GF_OMP_FOR_KIND_DISTRIBUTE = 1,
|
||||
GF_OMP_FOR_KIND_CILKFOR = 2,
|
||||
GF_OMP_FOR_KIND_OACC_LOOP = 3,
|
||||
GF_OMP_FOR_KIND_TASKLOOP = 2,
|
||||
GF_OMP_FOR_KIND_CILKFOR = 3,
|
||||
GF_OMP_FOR_KIND_OACC_LOOP = 4,
|
||||
/* Flag for SIMD variants of OMP_FOR kinds. */
|
||||
GF_OMP_FOR_SIMD = 1 << 2,
|
||||
GF_OMP_FOR_SIMD = 1 << 3,
|
||||
GF_OMP_FOR_KIND_SIMD = GF_OMP_FOR_SIMD | 0,
|
||||
GF_OMP_FOR_KIND_CILKSIMD = GF_OMP_FOR_SIMD | 1,
|
||||
GF_OMP_FOR_COMBINED = 1 << 3,
|
||||
GF_OMP_FOR_COMBINED_INTO = 1 << 4,
|
||||
GF_OMP_TARGET_KIND_MASK = (1 << 3) - 1,
|
||||
GF_OMP_FOR_COMBINED = 1 << 4,
|
||||
GF_OMP_FOR_COMBINED_INTO = 1 << 5,
|
||||
GF_OMP_TARGET_KIND_MASK = (1 << 4) - 1,
|
||||
GF_OMP_TARGET_KIND_REGION = 0,
|
||||
GF_OMP_TARGET_KIND_DATA = 1,
|
||||
GF_OMP_TARGET_KIND_UPDATE = 2,
|
||||
GF_OMP_TARGET_KIND_OACC_PARALLEL = 3,
|
||||
GF_OMP_TARGET_KIND_OACC_KERNELS = 4,
|
||||
GF_OMP_TARGET_KIND_OACC_DATA = 5,
|
||||
GF_OMP_TARGET_KIND_OACC_UPDATE = 6,
|
||||
GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA = 7,
|
||||
GF_OMP_TARGET_KIND_ENTER_DATA = 3,
|
||||
GF_OMP_TARGET_KIND_EXIT_DATA = 4,
|
||||
GF_OMP_TARGET_KIND_OACC_PARALLEL = 5,
|
||||
GF_OMP_TARGET_KIND_OACC_KERNELS = 6,
|
||||
GF_OMP_TARGET_KIND_OACC_DATA = 7,
|
||||
GF_OMP_TARGET_KIND_OACC_UPDATE = 8,
|
||||
GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA = 9,
|
||||
|
||||
/* True on an GIMPLE_OMP_RETURN statement if the return does not require
|
||||
a thread synchronization via some sort of barrier. The exact barrier
|
||||
@ -571,7 +575,10 @@ struct GTY((tag("GSS_OMP_CRITICAL")))
|
||||
{
|
||||
/* [ WORD 1-7 ] : base class */
|
||||
|
||||
/* [ WORD 8 ]
|
||||
/* [ WORD 8 ] */
|
||||
tree clauses;
|
||||
|
||||
/* [ WORD 9 ]
|
||||
Critical section name. */
|
||||
tree name;
|
||||
};
|
||||
@ -717,7 +724,7 @@ struct GTY((tag("GSS_OMP_CONTINUE")))
|
||||
tree control_use;
|
||||
};
|
||||
|
||||
/* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TEAMS */
|
||||
/* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TEAMS, GIMPLE_OMP_ORDERED */
|
||||
|
||||
struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
|
||||
gimple_statement_omp_single_layout : public gimple_statement_omp
|
||||
@ -742,6 +749,13 @@ struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
|
||||
stmt->code == GIMPLE_OMP_TEAMS. */
|
||||
};
|
||||
|
||||
struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
|
||||
gomp_ordered : public gimple_statement_omp_single_layout
|
||||
{
|
||||
/* No extra fields; adds invariant:
|
||||
stmt->code == GIMPLE_OMP_ORDERED. */
|
||||
};
|
||||
|
||||
|
||||
/* GIMPLE_OMP_ATOMIC_LOAD.
|
||||
Note: This is based on gimple, not g_s_omp, because g_s_omp
|
||||
@ -1071,6 +1085,14 @@ is_a_helper <gomp_critical *>::test (gimple *gs)
|
||||
return gs->code == GIMPLE_OMP_CRITICAL;
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
inline bool
|
||||
is_a_helper <gomp_ordered *>::test (gimple *gs)
|
||||
{
|
||||
return gs->code == GIMPLE_OMP_ORDERED;
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
inline bool
|
||||
@ -1279,6 +1301,14 @@ is_a_helper <const gomp_critical *>::test (const gimple *gs)
|
||||
return gs->code == GIMPLE_OMP_CRITICAL;
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
inline bool
|
||||
is_a_helper <const gomp_ordered *>::test (const gimple *gs)
|
||||
{
|
||||
return gs->code == GIMPLE_OMP_ORDERED;
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
inline bool
|
||||
@ -1413,7 +1443,7 @@ gdebug *gimple_build_debug_bind_stat (tree, tree, gimple * MEM_STAT_DECL);
|
||||
gdebug *gimple_build_debug_source_bind_stat (tree, tree, gimple * MEM_STAT_DECL);
|
||||
#define gimple_build_debug_source_bind(var,val,stmt) \
|
||||
gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
|
||||
gomp_critical *gimple_build_omp_critical (gimple_seq, tree);
|
||||
gomp_critical *gimple_build_omp_critical (gimple_seq, tree, tree);
|
||||
gomp_for *gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
|
||||
gomp_parallel *gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
|
||||
gomp_task *gimple_build_omp_task (gimple_seq, tree, tree, tree, tree,
|
||||
@ -1422,7 +1452,7 @@ gimple *gimple_build_omp_section (gimple_seq);
|
||||
gimple *gimple_build_omp_master (gimple_seq);
|
||||
gimple *gimple_build_omp_taskgroup (gimple_seq);
|
||||
gomp_continue *gimple_build_omp_continue (tree, tree);
|
||||
gimple *gimple_build_omp_ordered (gimple_seq);
|
||||
gomp_ordered *gimple_build_omp_ordered (gimple_seq, tree);
|
||||
gimple *gimple_build_omp_return (bool);
|
||||
gomp_sections *gimple_build_omp_sections (gimple_seq, tree);
|
||||
gimple *gimple_build_omp_sections_switch (void);
|
||||
@ -4658,7 +4688,8 @@ gimple_omp_critical_name (const gomp_critical *crit_stmt)
|
||||
}
|
||||
|
||||
|
||||
/* Return a pointer to the name associated with OMP critical statement GS. */
|
||||
/* Return a pointer to the name associated with OMP critical statement
|
||||
CRIT_STMT. */
|
||||
|
||||
static inline tree *
|
||||
gimple_omp_critical_name_ptr (gomp_critical *crit_stmt)
|
||||
@ -4667,7 +4698,8 @@ gimple_omp_critical_name_ptr (gomp_critical *crit_stmt)
|
||||
}
|
||||
|
||||
|
||||
/* Set NAME to be the name associated with OMP critical statement GS. */
|
||||
/* Set NAME to be the name associated with OMP critical statement
|
||||
CRIT_STMT. */
|
||||
|
||||
static inline void
|
||||
gimple_omp_critical_set_name (gomp_critical *crit_stmt, tree name)
|
||||
@ -4676,6 +4708,64 @@ gimple_omp_critical_set_name (gomp_critical *crit_stmt, tree name)
|
||||
}
|
||||
|
||||
|
||||
/* Return the clauses associated with OMP_CRITICAL statement CRIT_STMT. */
|
||||
|
||||
static inline tree
|
||||
gimple_omp_critical_clauses (const gomp_critical *crit_stmt)
|
||||
{
|
||||
return crit_stmt->clauses;
|
||||
}
|
||||
|
||||
|
||||
/* Return a pointer to the clauses associated with OMP critical statement
|
||||
CRIT_STMT. */
|
||||
|
||||
static inline tree *
|
||||
gimple_omp_critical_clauses_ptr (gomp_critical *crit_stmt)
|
||||
{
|
||||
return &crit_stmt->clauses;
|
||||
}
|
||||
|
||||
|
||||
/* Set CLAUSES to be the clauses associated with OMP critical statement
|
||||
CRIT_STMT. */
|
||||
|
||||
static inline void
|
||||
gimple_omp_critical_set_clauses (gomp_critical *crit_stmt, tree clauses)
|
||||
{
|
||||
crit_stmt->clauses = clauses;
|
||||
}
|
||||
|
||||
|
||||
/* Return the clauses associated with OMP_ORDERED statement ORD_STMT. */
|
||||
|
||||
static inline tree
|
||||
gimple_omp_ordered_clauses (const gomp_ordered *ord_stmt)
|
||||
{
|
||||
return ord_stmt->clauses;
|
||||
}
|
||||
|
||||
|
||||
/* Return a pointer to the clauses associated with OMP ordered statement
|
||||
ORD_STMT. */
|
||||
|
||||
static inline tree *
|
||||
gimple_omp_ordered_clauses_ptr (gomp_ordered *ord_stmt)
|
||||
{
|
||||
return &ord_stmt->clauses;
|
||||
}
|
||||
|
||||
|
||||
/* Set CLAUSES to be the clauses associated with OMP ordered statement
|
||||
ORD_STMT. */
|
||||
|
||||
static inline void
|
||||
gimple_omp_ordered_set_clauses (gomp_ordered *ord_stmt, tree clauses)
|
||||
{
|
||||
ord_stmt->clauses = clauses;
|
||||
}
|
||||
|
||||
|
||||
/* Return the kind of the OMP_FOR statemement G. */
|
||||
|
||||
static inline int
|
||||
@ -5090,6 +5180,31 @@ gimple_omp_task_set_clauses (gimple *gs, tree clauses)
|
||||
}
|
||||
|
||||
|
||||
/* Return true if OMP task statement G has the
|
||||
GF_OMP_TASK_TASKLOOP flag set. */
|
||||
|
||||
static inline bool
|
||||
gimple_omp_task_taskloop_p (const gimple *g)
|
||||
{
|
||||
GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
|
||||
return (gimple_omp_subcode (g) & GF_OMP_TASK_TASKLOOP) != 0;
|
||||
}
|
||||
|
||||
|
||||
/* Set the GF_OMP_TASK_TASKLOOP field in G depending on the boolean
|
||||
value of TASKLOOP_P. */
|
||||
|
||||
static inline void
|
||||
gimple_omp_task_set_taskloop_p (gimple *g, bool taskloop_p)
|
||||
{
|
||||
GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
|
||||
if (taskloop_p)
|
||||
g->subcode |= GF_OMP_TASK_TASKLOOP;
|
||||
else
|
||||
g->subcode &= ~GF_OMP_TASK_TASKLOOP;
|
||||
}
|
||||
|
||||
|
||||
/* Return the child function used to hold the body of OMP_TASK GS. */
|
||||
|
||||
static inline tree
|
||||
|
1208
gcc/gimplify.c
1208
gcc/gimplify.c
File diff suppressed because it is too large
Load Diff
@ -175,6 +175,22 @@ expand_GOMP_SIMD_LAST_LANE (gcall *)
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
/* This should get expanded in adjust_simduid_builtins. */
|
||||
|
||||
static void
|
||||
expand_GOMP_SIMD_ORDERED_START (gcall *)
|
||||
{
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
/* This should get expanded in adjust_simduid_builtins. */
|
||||
|
||||
static void
|
||||
expand_GOMP_SIMD_ORDERED_END (gcall *)
|
||||
{
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
/* This should get expanded in the sanopt pass. */
|
||||
|
||||
static void
|
||||
|
@ -44,6 +44,8 @@ DEF_INTERNAL_FN (STORE_LANES, ECF_CONST | ECF_LEAF, NULL)
|
||||
DEF_INTERNAL_FN (GOMP_SIMD_LANE, ECF_NOVOPS | ECF_LEAF | ECF_NOTHROW, NULL)
|
||||
DEF_INTERNAL_FN (GOMP_SIMD_VF, ECF_CONST | ECF_LEAF | ECF_NOTHROW, NULL)
|
||||
DEF_INTERNAL_FN (GOMP_SIMD_LAST_LANE, ECF_CONST | ECF_LEAF | ECF_NOTHROW, NULL)
|
||||
DEF_INTERNAL_FN (GOMP_SIMD_ORDERED_START, ECF_LEAF | ECF_NOTHROW, NULL)
|
||||
DEF_INTERNAL_FN (GOMP_SIMD_ORDERED_END, ECF_LEAF | ECF_NOTHROW, NULL)
|
||||
DEF_INTERNAL_FN (LOOP_VECTORIZED, ECF_NOVOPS | ECF_LEAF | ECF_NOTHROW, NULL)
|
||||
DEF_INTERNAL_FN (MASK_LOAD, ECF_PURE | ECF_LEAF, NULL)
|
||||
DEF_INTERNAL_FN (MASK_STORE, ECF_LEAF, NULL)
|
||||
|
@ -1,3 +1,10 @@
|
||||
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.
|
||||
|
||||
2015-09-30 Thomas Schwinge <thomas@codesourcery.com>
|
||||
Ulrich Drepper <drepper@gmail.com>
|
||||
|
||||
|
@ -306,6 +306,20 @@ builtins_manager::make_type (enum jit_builtin_type type_id)
|
||||
ARG6, ARG7, ARG8) \
|
||||
case ENUM: return make_fn_type (ENUM, RETURN, 0, 8, ARG1, ARG2, ARG3, \
|
||||
ARG4, ARG5, ARG6, ARG7, ARG8);
|
||||
#define DEF_FUNCTION_TYPE_9(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9) \
|
||||
case ENUM: return make_fn_type (ENUM, RETURN, 0, 9, ARG1, ARG2, ARG3, \
|
||||
ARG4, ARG5, ARG6, ARG7, ARG8, ARG9);
|
||||
#define DEF_FUNCTION_TYPE_10(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10) \
|
||||
case ENUM: return make_fn_type (ENUM, RETURN, 0, 10, ARG1, ARG2, ARG3, \
|
||||
ARG4, ARG5, ARG6, ARG7, ARG8, ARG9, \
|
||||
ARG10);
|
||||
#define DEF_FUNCTION_TYPE_11(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) \
|
||||
case ENUM: return make_fn_type (ENUM, RETURN, 0, 11, ARG1, ARG2, ARG3, \
|
||||
ARG4, ARG5, ARG6, ARG7, ARG8, ARG9, \
|
||||
ARG10, ARG11);
|
||||
#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
|
||||
case ENUM: return make_fn_type (ENUM, RETURN, 1, 0);
|
||||
#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
|
||||
@ -343,6 +357,9 @@ builtins_manager::make_type (enum jit_builtin_type type_id)
|
||||
#undef DEF_FUNCTION_TYPE_6
|
||||
#undef DEF_FUNCTION_TYPE_7
|
||||
#undef DEF_FUNCTION_TYPE_8
|
||||
#undef DEF_FUNCTION_TYPE_9
|
||||
#undef DEF_FUNCTION_TYPE_10
|
||||
#undef DEF_FUNCTION_TYPE_11
|
||||
#undef DEF_FUNCTION_TYPE_VAR_0
|
||||
#undef DEF_FUNCTION_TYPE_VAR_1
|
||||
#undef DEF_FUNCTION_TYPE_VAR_2
|
||||
|
@ -43,6 +43,12 @@ enum jit_builtin_type
|
||||
ARG6, ARG7) NAME,
|
||||
#define DEF_FUNCTION_TYPE_8(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8) NAME,
|
||||
#define DEF_FUNCTION_TYPE_9(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9) NAME,
|
||||
#define DEF_FUNCTION_TYPE_10(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10) NAME,
|
||||
#define DEF_FUNCTION_TYPE_11(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME,
|
||||
@ -66,6 +72,9 @@ enum jit_builtin_type
|
||||
#undef DEF_FUNCTION_TYPE_6
|
||||
#undef DEF_FUNCTION_TYPE_7
|
||||
#undef DEF_FUNCTION_TYPE_8
|
||||
#undef DEF_FUNCTION_TYPE_9
|
||||
#undef DEF_FUNCTION_TYPE_10
|
||||
#undef DEF_FUNCTION_TYPE_11
|
||||
#undef DEF_FUNCTION_TYPE_VAR_0
|
||||
#undef DEF_FUNCTION_TYPE_VAR_1
|
||||
#undef DEF_FUNCTION_TYPE_VAR_2
|
||||
|
@ -1,3 +1,8 @@
|
||||
2015-10-13 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* lto-lang.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
|
||||
DEF_FUNCTION_TYPE_11): Define.
|
||||
|
||||
2015-10-10 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
* lto.c (hash_canonical_type): Honor
|
||||
|
@ -153,6 +153,12 @@ enum lto_builtin_type
|
||||
ARG6, ARG7) NAME,
|
||||
#define DEF_FUNCTION_TYPE_8(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8) NAME,
|
||||
#define DEF_FUNCTION_TYPE_9(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9) NAME,
|
||||
#define DEF_FUNCTION_TYPE_10(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10) NAME,
|
||||
#define DEF_FUNCTION_TYPE_11(NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME,
|
||||
#define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME,
|
||||
@ -176,6 +182,9 @@ enum lto_builtin_type
|
||||
#undef DEF_FUNCTION_TYPE_6
|
||||
#undef DEF_FUNCTION_TYPE_7
|
||||
#undef DEF_FUNCTION_TYPE_8
|
||||
#undef DEF_FUNCTION_TYPE_9
|
||||
#undef DEF_FUNCTION_TYPE_10
|
||||
#undef DEF_FUNCTION_TYPE_11
|
||||
#undef DEF_FUNCTION_TYPE_VAR_0
|
||||
#undef DEF_FUNCTION_TYPE_VAR_1
|
||||
#undef DEF_FUNCTION_TYPE_VAR_2
|
||||
@ -656,6 +665,18 @@ lto_define_builtins (tree va_list_ref_type_node ATTRIBUTE_UNUSED,
|
||||
ARG6, ARG7, ARG8) \
|
||||
def_fn_type (ENUM, RETURN, 0, 8, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8);
|
||||
#define DEF_FUNCTION_TYPE_9(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9) \
|
||||
def_fn_type (ENUM, RETURN, 0, 9, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8, ARG9);
|
||||
#define DEF_FUNCTION_TYPE_10(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10) \
|
||||
def_fn_type (ENUM, RETURN, 0, 10, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8, ARG9, ARG10);
|
||||
#define DEF_FUNCTION_TYPE_11(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
|
||||
ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) \
|
||||
def_fn_type (ENUM, RETURN, 0, 11, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, \
|
||||
ARG7, ARG8, ARG9, ARG10, ARG11);
|
||||
#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
|
||||
def_fn_type (ENUM, RETURN, 1, 0);
|
||||
#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
|
||||
@ -689,6 +710,9 @@ lto_define_builtins (tree va_list_ref_type_node ATTRIBUTE_UNUSED,
|
||||
#undef DEF_FUNCTION_TYPE_6
|
||||
#undef DEF_FUNCTION_TYPE_7
|
||||
#undef DEF_FUNCTION_TYPE_8
|
||||
#undef DEF_FUNCTION_TYPE_9
|
||||
#undef DEF_FUNCTION_TYPE_10
|
||||
#undef DEF_FUNCTION_TYPE_11
|
||||
#undef DEF_FUNCTION_TYPE_VAR_0
|
||||
#undef DEF_FUNCTION_TYPE_VAR_1
|
||||
#undef DEF_FUNCTION_TYPE_VAR_2
|
||||
|
@ -129,6 +129,22 @@ DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START,
|
||||
"GOMP_loop_ordered_runtime_start",
|
||||
BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
|
||||
ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_DOACROSS_STATIC_START,
|
||||
"GOMP_loop_doacross_static_start",
|
||||
BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR,
|
||||
ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_DOACROSS_DYNAMIC_START,
|
||||
"GOMP_loop_doacross_dynamic_start",
|
||||
BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR,
|
||||
ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_DOACROSS_GUIDED_START,
|
||||
"GOMP_loop_doacross_guided_start",
|
||||
BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR,
|
||||
ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_DOACROSS_RUNTIME_START,
|
||||
"GOMP_loop_doacross_runtime_start",
|
||||
BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR,
|
||||
ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_STATIC_NEXT, "GOMP_loop_static_next",
|
||||
BT_FN_BOOL_LONGPTR_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, "GOMP_loop_dynamic_next",
|
||||
@ -181,6 +197,22 @@ DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_RUNTIME_START,
|
||||
"GOMP_loop_ull_ordered_runtime_start",
|
||||
BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
|
||||
ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_DOACROSS_STATIC_START,
|
||||
"GOMP_loop_ull_doacross_static_start",
|
||||
BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR,
|
||||
ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_DOACROSS_DYNAMIC_START,
|
||||
"GOMP_loop_ull_doacross_dynamic_start",
|
||||
BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR,
|
||||
ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_DOACROSS_GUIDED_START,
|
||||
"GOMP_loop_ull_doacross_guided_start",
|
||||
BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR,
|
||||
ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_DOACROSS_RUNTIME_START,
|
||||
"GOMP_loop_ull_doacross_runtime_start",
|
||||
BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR,
|
||||
ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_STATIC_NEXT, "GOMP_loop_ull_static_next",
|
||||
BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_DYNAMIC_NEXT, "GOMP_loop_ull_dynamic_next",
|
||||
@ -230,10 +262,24 @@ DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ORDERED_START, "GOMP_ordered_start",
|
||||
BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ORDERED_END, "GOMP_ordered_end",
|
||||
BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_DOACROSS_POST, "GOMP_doacross_post",
|
||||
BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_DOACROSS_WAIT, "GOMP_doacross_wait",
|
||||
BT_FN_VOID_LONG_VAR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_DOACROSS_ULL_POST, "GOMP_doacross_ull_post",
|
||||
BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_DOACROSS_ULL_WAIT, "GOMP_doacross_ull_wait",
|
||||
BT_FN_VOID_ULL_VAR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL, "GOMP_parallel",
|
||||
BT_FN_VOID_OMPFN_PTR_UINT_UINT, ATTR_NOTHROW_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASK, "GOMP_task",
|
||||
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR,
|
||||
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT,
|
||||
ATTR_NOTHROW_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASKLOOP, "GOMP_taskloop",
|
||||
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG,
|
||||
ATTR_NOTHROW_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASKLOOP_ULL, "GOMP_taskloop_ull",
|
||||
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL,
|
||||
ATTR_NOTHROW_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SECTIONS_START, "GOMP_sections_start",
|
||||
BT_FN_UINT_UINT, ATTR_NOTHROW_LEAF_LIST)
|
||||
@ -256,14 +302,18 @@ DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SINGLE_COPY_START, "GOMP_single_copy_start",
|
||||
BT_FN_PTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SINGLE_COPY_END, "GOMP_single_copy_end",
|
||||
BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET, "GOMP_target",
|
||||
BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET, "GOMP_target_41",
|
||||
BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR,
|
||||
ATTR_NOTHROW_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_DATA, "GOMP_target_data",
|
||||
BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR, ATTR_NOTHROW_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_DATA, "GOMP_target_data_41",
|
||||
BT_FN_VOID_INT_SIZE_PTR_PTR_PTR, ATTR_NOTHROW_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_END_DATA, "GOMP_target_end_data",
|
||||
BT_FN_VOID, ATTR_NOTHROW_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_UPDATE, "GOMP_target_update",
|
||||
BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR, ATTR_NOTHROW_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_UPDATE, "GOMP_target_update_41",
|
||||
BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR,
|
||||
ATTR_NOTHROW_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_ENTER_EXIT_DATA,
|
||||
"GOMP_target_enter_exit_data",
|
||||
BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR, ATTR_NOTHROW_LIST)
|
||||
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TEAMS, "GOMP_teams",
|
||||
BT_FN_VOID_UINT_UINT, ATTR_NOTHROW_LIST)
|
||||
|
4137
gcc/omp-low.c
4137
gcc/omp-low.c
File diff suppressed because it is too large
Load Diff
@ -29,6 +29,7 @@ extern tree omp_reduction_init_op (location_t, enum tree_code, tree);
|
||||
extern tree omp_reduction_init (tree, tree);
|
||||
extern bool make_gimple_omp_edges (basic_block, struct omp_region **, int *);
|
||||
extern void omp_finish_file (void);
|
||||
extern tree omp_member_access_dummy_var (tree);
|
||||
extern tree get_oacc_fn_attrib (tree);
|
||||
|
||||
extern GTY(()) vec<tree, va_gc> *offload_funcs;
|
||||
|
@ -341,6 +341,7 @@ along with GCC; see the file COPYING3. If not see
|
||||
NEXT_PASS (pass_tm_memopt);
|
||||
NEXT_PASS (pass_tm_edges);
|
||||
POP_INSERT_PASSES ()
|
||||
NEXT_PASS (pass_simduid_cleanup);
|
||||
NEXT_PASS (pass_vtable_verify);
|
||||
NEXT_PASS (pass_lower_vaarg);
|
||||
NEXT_PASS (pass_lower_vector);
|
||||
|
@ -1,3 +1,78 @@
|
||||
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.
|
||||
|
||||
2015-10-13 Christophe Lyon <christophe.lyon@linaro.org>
|
||||
|
||||
* gcc/testsuite/gcc.target/aarch64/table-intrinsics.c: Fix regexp
|
||||
|
@ -27,7 +27,7 @@ void foo()
|
||||
#pragma simd
|
||||
for (int i=0; i < 1000; ++i)
|
||||
{
|
||||
#pragma omp for /* { dg-error "OpenMP constructs may not" } */
|
||||
#pragma omp for /* { dg-error "OpenMP constructs other than" } */
|
||||
for (j=0; j < 1000; ++j)
|
||||
a[i] = b[i];
|
||||
}
|
||||
|
@ -6,6 +6,6 @@
|
||||
# error _OPENMP not defined
|
||||
#endif
|
||||
|
||||
#if _OPENMP != 201307
|
||||
#if _OPENMP != 201511
|
||||
# error _OPENMP defined to wrong value
|
||||
#endif
|
||||
|
@ -230,7 +230,7 @@ f_acc_parallel (void)
|
||||
{
|
||||
#pragma omp target /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
;
|
||||
#pragma omp target data /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
#pragma omp target data map(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
;
|
||||
#pragma omp target update to(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
}
|
||||
@ -300,7 +300,7 @@ f_acc_kernels (void)
|
||||
{
|
||||
#pragma omp target /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
;
|
||||
#pragma omp target data /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
#pragma omp target data map(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
;
|
||||
#pragma omp target update to(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
}
|
||||
@ -370,7 +370,7 @@ f_acc_data (void)
|
||||
{
|
||||
#pragma omp target /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
;
|
||||
#pragma omp target data /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
#pragma omp target data map(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
;
|
||||
#pragma omp target update to(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
}
|
||||
@ -450,7 +450,7 @@ f_acc_loop (void)
|
||||
{
|
||||
#pragma omp target /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
;
|
||||
#pragma omp target data /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
#pragma omp target data map(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
;
|
||||
#pragma omp target update to(i) /* { dg-error "non-OpenACC construct inside of OpenACC region" } */
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ f1 (void)
|
||||
void
|
||||
f2 (void)
|
||||
{
|
||||
int i;
|
||||
int i, j = 0;
|
||||
#pragma omp parallel
|
||||
{
|
||||
#pragma omp cancel parallel
|
||||
@ -132,7 +132,7 @@ f2 (void)
|
||||
#pragma omp cancellation point taskgroup/* { dg-error "not closely nested inside" } */
|
||||
}
|
||||
}
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(j)
|
||||
{
|
||||
#pragma omp cancel parallel /* { dg-error "not closely nested inside" } */
|
||||
#pragma omp cancel for /* { dg-error "not closely nested inside" } */
|
||||
@ -155,7 +155,7 @@ f2 (void)
|
||||
#pragma omp cancellation point taskgroup /* { dg-error "not closely nested inside" } */
|
||||
}
|
||||
}
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(j)
|
||||
{
|
||||
#pragma omp cancel parallel /* { dg-error "not closely nested inside" } */
|
||||
#pragma omp cancel for /* { dg-error "not closely nested inside" } */
|
||||
@ -214,7 +214,7 @@ f2 (void)
|
||||
}
|
||||
#pragma omp for
|
||||
for (i = 0; i < 10; i++)
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(j)
|
||||
{
|
||||
#pragma omp cancel parallel /* { dg-error "not closely nested inside" } */
|
||||
#pragma omp cancel for /* { dg-error "not closely nested inside" } */
|
||||
@ -241,7 +241,7 @@ f2 (void)
|
||||
#pragma omp for ordered
|
||||
for (i = 0; i < 10; i++)
|
||||
#pragma omp ordered
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(j)
|
||||
{
|
||||
#pragma omp cancel parallel /* { dg-error "not closely nested inside" } */
|
||||
#pragma omp cancel for /* { dg-error "not closely nested inside" } */
|
||||
@ -292,7 +292,7 @@ f2 (void)
|
||||
}
|
||||
#pragma omp sections
|
||||
{
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(j)
|
||||
{
|
||||
#pragma omp cancel parallel /* { dg-error "not closely nested inside" } */
|
||||
#pragma omp cancel for /* { dg-error "not closely nested inside" } */
|
||||
@ -304,7 +304,7 @@ f2 (void)
|
||||
#pragma omp cancellation point taskgroup /* { dg-error "not closely nested inside" } */
|
||||
}
|
||||
#pragma omp section
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(j)
|
||||
{
|
||||
#pragma omp cancel parallel /* { dg-error "not closely nested inside" } */
|
||||
#pragma omp cancel for /* { dg-error "not closely nested inside" } */
|
||||
|
162
gcc/testsuite/c-c++-common/gomp/clauses-1.c
Normal file
162
gcc/testsuite/c-c++-common/gomp/clauses-1.c
Normal file
@ -0,0 +1,162 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
/* { dg-additional-options "-std=c99" { target c } } */
|
||||
|
||||
int t;
|
||||
#pragma omp threadprivate (t)
|
||||
|
||||
#pragma omp declare target
|
||||
int f, l, ll, r;
|
||||
|
||||
void
|
||||
foo (int d, int m, int i1, int i2, int p, int *idp, int s,
|
||||
int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q)
|
||||
{
|
||||
#pragma omp distribute parallel for \
|
||||
private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \
|
||||
if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
|
||||
lastprivate (l) schedule(static, 4)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp distribute parallel for simd \
|
||||
private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \
|
||||
if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
|
||||
lastprivate (l) schedule(static, 4) \
|
||||
safelen(8) simdlen(4) aligned(q: 32)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp distribute simd \
|
||||
private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \
|
||||
safelen(8) simdlen(4) aligned(q: 32) reduction(+:r)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
}
|
||||
#pragma omp end declare target
|
||||
|
||||
void
|
||||
bar (int d, int m, int i1, int i2, int p, int *idp, int s,
|
||||
int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q)
|
||||
{
|
||||
#pragma omp for simd \
|
||||
private (p) firstprivate (f) lastprivate (l) linear (ll:1) reduction(+:r) schedule(static, 4) collapse(1) nowait \
|
||||
safelen(8) simdlen(4) aligned(q: 32)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp parallel for \
|
||||
private (p) firstprivate (f) if (parallel: i2) default(shared) shared(s) copyin(t) reduction(+:r) num_threads (nth) proc_bind(spread) \
|
||||
lastprivate (l) linear (ll:1) ordered schedule(static, 4) collapse(1)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp parallel for simd \
|
||||
private (p) firstprivate (f) if (parallel: i2) default(shared) shared(s) copyin(t) reduction(+:r) num_threads (nth) proc_bind(spread) \
|
||||
lastprivate (l) linear (ll:1) schedule(static, 4) collapse(1) \
|
||||
safelen(8) simdlen(4) aligned(q: 32)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp parallel sections \
|
||||
private (p) firstprivate (f) if (parallel: i2) default(shared) shared(s) copyin(t) reduction(+:r) num_threads (nth) proc_bind(spread) \
|
||||
lastprivate (l)
|
||||
{
|
||||
#pragma omp section
|
||||
{}
|
||||
#pragma omp section
|
||||
{}
|
||||
}
|
||||
#pragma omp target parallel \
|
||||
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
|
||||
if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread)
|
||||
;
|
||||
#pragma omp target parallel for \
|
||||
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
|
||||
if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
|
||||
lastprivate (l) linear (ll:1) ordered schedule(static, 4) collapse(1)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp target parallel for simd \
|
||||
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
|
||||
if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \
|
||||
lastprivate (l) linear (ll:1) schedule(static, 4) collapse(1) \
|
||||
safelen(8) simdlen(4) aligned(q: 32)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp target teams \
|
||||
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
|
||||
shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl)
|
||||
;
|
||||
#pragma omp target teams distribute \
|
||||
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
|
||||
shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
|
||||
collapse(1) dist_schedule(static, 16)
|
||||
for (int i = 0; i < 64; i++)
|
||||
;
|
||||
#pragma omp target teams distribute parallel for \
|
||||
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
|
||||
shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
|
||||
collapse(1) dist_schedule(static, 16) \
|
||||
if (parallel: i2) num_threads (nth) proc_bind(spread) \
|
||||
lastprivate (l) schedule(static, 4)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp target teams distribute parallel for simd \
|
||||
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
|
||||
shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
|
||||
collapse(1) dist_schedule(static, 16) \
|
||||
if (parallel: i2) num_threads (nth) proc_bind(spread) \
|
||||
lastprivate (l) schedule(static, 4) \
|
||||
safelen(8) simdlen(4) aligned(q: 32)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp target teams distribute simd \
|
||||
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
|
||||
shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
|
||||
collapse(1) dist_schedule(static, 16) \
|
||||
safelen(8) simdlen(4) aligned(q: 32)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp target simd \
|
||||
device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
|
||||
safelen(8) simdlen(4) lastprivate (l) linear(ll: 1) aligned(q: 32) reduction(+:r)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp taskloop simd \
|
||||
private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) grainsize (g) collapse(1) untied if(taskloop: i1) final(fi) mergeable nogroup priority (pp) \
|
||||
safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) reduction(+:r)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp taskwait
|
||||
#pragma omp taskloop simd \
|
||||
private (p) firstprivate (f) lastprivate (l) shared (s) default(shared) num_tasks (nta) collapse(1) if(taskloop: i1) final(fi) priority (pp) \
|
||||
safelen(8) simdlen(4) linear(ll: 1) aligned(q: 32) reduction(+:r)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp target
|
||||
#pragma omp teams distribute \
|
||||
private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
|
||||
collapse(1) dist_schedule(static, 16)
|
||||
for (int i = 0; i < 64; i++)
|
||||
;
|
||||
#pragma omp target
|
||||
#pragma omp teams distribute parallel for \
|
||||
private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
|
||||
collapse(1) dist_schedule(static, 16) \
|
||||
if (parallel: i2) num_threads (nth) proc_bind(spread) \
|
||||
lastprivate (l) schedule(static, 4)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp target
|
||||
#pragma omp teams distribute parallel for simd \
|
||||
private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
|
||||
collapse(1) dist_schedule(static, 16) \
|
||||
if (parallel: i2) num_threads (nth) proc_bind(spread) \
|
||||
lastprivate (l) schedule(static, 4) \
|
||||
safelen(8) simdlen(4) aligned(q: 32)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
#pragma omp target
|
||||
#pragma omp teams distribute simd \
|
||||
private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \
|
||||
collapse(1) dist_schedule(static, 16) \
|
||||
safelen(8) simdlen(4) aligned(q: 32)
|
||||
for (int i = 0; i < 64; i++)
|
||||
ll++;
|
||||
}
|
53
gcc/testsuite/c-c++-common/gomp/clauses-2.c
Normal file
53
gcc/testsuite/c-c++-common/gomp/clauses-2.c
Normal file
@ -0,0 +1,53 @@
|
||||
struct S { int r; int *s; int t[10]; };
|
||||
void bar (int *);
|
||||
|
||||
void
|
||||
foo (int *p, int q, struct S t, int i, int j, int k, int l)
|
||||
{
|
||||
#pragma omp target map (q), firstprivate (q)
|
||||
bar (&q);
|
||||
#pragma omp target map (p[0]) firstprivate (p) /* { dg-error "appears more than once in data clauses" } */
|
||||
bar (p);
|
||||
#pragma omp target firstprivate (p), map (p[0]) /* { dg-error "appears more than once in data clauses" } */
|
||||
bar (p);
|
||||
#pragma omp target map (p[0]) map (p)
|
||||
bar (p);
|
||||
#pragma omp target map (p) , map (p[0])
|
||||
bar (p);
|
||||
#pragma omp target map (q) map (q) /* { dg-error "appears more than once in map clauses" } */
|
||||
bar (&q);
|
||||
#pragma omp target map (p[0]) map (p[0]) /* { dg-error "appears more than once in data clauses" } */
|
||||
bar (p);
|
||||
#pragma omp target map (t) map (t.r) /* { dg-error "appears more than once in map clauses" } */
|
||||
bar (&t.r);
|
||||
#pragma omp target map (t.r) map (t) /* { dg-error "appears more than once in map clauses" } */
|
||||
bar (&t.r);
|
||||
#pragma omp target map (t.r) map (t.r) /* { dg-error "appears more than once in map clauses" } */
|
||||
bar (&t.r);
|
||||
#pragma omp target firstprivate (t), map (t.r)
|
||||
bar (&t.r);
|
||||
#pragma omp target map (t.r) firstprivate (t)
|
||||
bar (&t.r);
|
||||
#pragma omp target map (t.s[0]) map (t)
|
||||
bar (t.s);
|
||||
#pragma omp target map (t) map(t.s[0])
|
||||
bar (t.s);
|
||||
#pragma omp target firstprivate (t) map (t.s[0]) /* { dg-error "appears more than once in data clauses" } */
|
||||
bar (t.s);
|
||||
#pragma omp target map (t.s[0]) firstprivate (t) /* { dg-error "appears more than once in data clauses" } */
|
||||
bar (t.s);
|
||||
#pragma omp target map (t.s[0]) map (t.s[2]) /* { dg-error "appears more than once in map clauses" } */
|
||||
bar (t.s);
|
||||
#pragma omp target map (t.t[0:2]) map (t.t[4:6]) /* { dg-error "appears more than once in map clauses" } */
|
||||
bar (t.t);
|
||||
#pragma omp target map (t.t[i:j]) map (t.t[k:l]) /* { dg-error "appears more than once in map clauses" } */
|
||||
bar (t.t);
|
||||
#pragma omp target map (t.s[0]) map (t.r)
|
||||
bar (t.s);
|
||||
#pragma omp target map (t.r) ,map (t.s[0])
|
||||
bar (t.s);
|
||||
#pragma omp target map (t.r) map (t) map (t.s[0]) firstprivate (t) /* { dg-error "appears more than once in map clauses" } */
|
||||
bar (t.s); /* { dg-error "appears more than once in data clauses" "" { target *-*-* } 49 } */
|
||||
#pragma omp target map (t) map (t.r) firstprivate (t) map (t.s[0]) /* { dg-error "appears more than once in map clauses" } */
|
||||
bar (t.s); /* { dg-error "appears more than once in data clauses" "" { target *-*-* } 51 } */
|
||||
}
|
23
gcc/testsuite/c-c++-common/gomp/clauses-3.c
Normal file
23
gcc/testsuite/c-c++-common/gomp/clauses-3.c
Normal file
@ -0,0 +1,23 @@
|
||||
struct T { int a; int *b; };
|
||||
struct S { int *s; char u; struct T v; long x; };
|
||||
|
||||
void bar (int *);
|
||||
#pragma omp declare target to (bar)
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int a[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
struct S s = { a, 5, { 6, a + 5 }, 99L };
|
||||
#pragma omp target map (s.v.a, s.u, s.x)
|
||||
;
|
||||
#pragma omp target map (s.v.a, s.u, s.x)
|
||||
bar (&s.v.a);
|
||||
#pragma omp target map (s.v.a) map (always, to: s.u) map (s.x)
|
||||
;
|
||||
#pragma omp target map (s.s[0]) map (s.v.b[:3])
|
||||
;
|
||||
#pragma omp target map (s.s[0]) map (s.v.b[:3])
|
||||
bar (s.s);
|
||||
return 0;
|
||||
}
|
96
gcc/testsuite/c-c++-common/gomp/clauses-4.c
Normal file
96
gcc/testsuite/c-c++-common/gomp/clauses-4.c
Normal file
@ -0,0 +1,96 @@
|
||||
int t;
|
||||
#pragma omp threadprivate (t)
|
||||
|
||||
void
|
||||
foo (int y, short z)
|
||||
{
|
||||
int x;
|
||||
#pragma omp target teams map (from: x)
|
||||
#pragma omp distribute simd linear (x : 2)
|
||||
for (x = 0; x < 64; x += 2)
|
||||
;
|
||||
#pragma omp target teams map (from: x)
|
||||
#pragma omp distribute parallel for simd linear (x)
|
||||
for (x = 0; x < 64; x++)
|
||||
;
|
||||
#pragma omp target teams map (tofrom: y)
|
||||
#pragma omp distribute simd linear (y : 2) /* { dg-error ".linear. clause for variable other than loop iterator specified on construct combined with .distribute." } */
|
||||
for (x = 0; x < 64; x += 2)
|
||||
y += 2;
|
||||
#pragma omp target teams map (tofrom: z)
|
||||
#pragma omp distribute parallel for simd linear (z) /* { dg-error ".linear. clause for variable other than loop iterator specified on construct combined with .distribute." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
z++;
|
||||
#pragma omp target teams map (tofrom: z)
|
||||
#pragma omp distribute parallel for linear (z: 4) /* { dg-error ".linear. is not valid for .#pragma omp distribute parallel for." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
z += 4;
|
||||
#pragma omp target map (from: x)
|
||||
#pragma omp teams distribute simd linear (x : 2)
|
||||
for (x = 0; x < 64; x += 2)
|
||||
;
|
||||
#pragma omp target map (from: x)
|
||||
#pragma omp teams distribute parallel for simd linear (x)
|
||||
for (x = 0; x < 64; x++)
|
||||
;
|
||||
#pragma omp target map (tofrom: y)
|
||||
#pragma omp teams distribute simd linear (y : 2) /* { dg-error ".linear. clause for variable other than loop iterator specified on construct combined with .distribute." } */
|
||||
for (x = 0; x < 64; x += 2)
|
||||
y += 2;
|
||||
#pragma omp target map (tofrom: z)
|
||||
#pragma omp teams distribute parallel for simd linear (z) /* { dg-error ".linear. clause for variable other than loop iterator specified on construct combined with .distribute." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
z++;
|
||||
#pragma omp target map (tofrom: z)
|
||||
#pragma omp teams distribute parallel for linear (z: 4) /* { dg-error ".linear. is not valid for .#pragma omp teams distribute parallel for." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
z += 4;
|
||||
#pragma omp target parallel copyin (t) /* { dg-error ".copyin. is not valid for .#pragma omp target parallel." } */
|
||||
;
|
||||
#pragma omp target parallel for copyin (t) /* { dg-error ".copyin. is not valid for .#pragma omp target parallel for." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
;
|
||||
#pragma omp target parallel for simd copyin (t) /* { dg-error ".copyin. is not valid for .#pragma omp target parallel for simd." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
;
|
||||
#pragma omp target teams
|
||||
#pragma omp distribute parallel for ordered /* { dg-error ".ordered. is not valid for .#pragma omp distribute parallel for." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
{
|
||||
#pragma omp ordered /* { dg-error "ordered region must be closely nested inside a loop region with an ordered clause" } */
|
||||
;
|
||||
}
|
||||
#pragma omp target teams
|
||||
#pragma omp distribute parallel for simd ordered /* { dg-error ".ordered. is not valid for .#pragma omp distribute parallel for simd." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
{
|
||||
#pragma omp ordered simd, threads /* { dg-error "OpenMP constructs other than .#pragma omp ordered simd. may not be nested inside simd region" } */
|
||||
;
|
||||
}
|
||||
#pragma omp target
|
||||
#pragma omp teams distribute parallel for ordered /* { dg-error ".ordered. is not valid for .#pragma omp teams distribute parallel for." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
{
|
||||
#pragma omp ordered /* { dg-error "ordered region must be closely nested inside a loop region with an ordered clause" } */
|
||||
;
|
||||
}
|
||||
#pragma omp target
|
||||
#pragma omp teams distribute parallel for simd ordered /* { dg-error ".ordered. is not valid for .#pragma omp teams distribute parallel for simd." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
{
|
||||
#pragma omp ordered simd, threads /* { dg-error "OpenMP constructs other than .#pragma omp ordered simd. may not be nested inside simd region" } */
|
||||
;
|
||||
}
|
||||
#pragma omp target teams distribute parallel for ordered /* { dg-error ".ordered. is not valid for .#pragma omp target teams distribute parallel for." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
{
|
||||
#pragma omp ordered /* { dg-error "ordered region must be closely nested inside a loop region with an ordered clause" } */
|
||||
;
|
||||
}
|
||||
#pragma omp target teams distribute parallel for simd ordered /* { dg-error ".ordered. is not valid for .#pragma omp target teams distribute parallel for simd." } */
|
||||
for (x = 0; x < 64; x++)
|
||||
{
|
||||
#pragma omp ordered simd, threads /* { dg-error "OpenMP constructs other than .#pragma omp ordered simd. may not be nested inside simd region" } */
|
||||
;
|
||||
}
|
||||
}
|
13
gcc/testsuite/c-c++-common/gomp/declare-target-1.c
Normal file
13
gcc/testsuite/c-c++-common/gomp/declare-target-1.c
Normal file
@ -0,0 +1,13 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
int foo (void), bar (void);
|
||||
extern int a;
|
||||
int b;
|
||||
char d;
|
||||
#pragma omp declare target
|
||||
long c;
|
||||
#pragma omp end declare target
|
||||
|
||||
#pragma omp declare target (bar, a)
|
||||
#pragma omp declare target to (b) link (d) to (foo)
|
27
gcc/testsuite/c-c++-common/gomp/declare-target-2.c
Normal file
27
gcc/testsuite/c-c++-common/gomp/declare-target-2.c
Normal file
@ -0,0 +1,27 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
extern int a;
|
||||
#pragma omp declare target
|
||||
#pragma omp declare target to (a) /* { dg-error "with clauses in between" } */
|
||||
#pragma omp end declare target
|
||||
int b;
|
||||
#pragma omp declare target to (b) link (b) /* { dg-error "specified both in declare target" } */
|
||||
int c;
|
||||
#pragma omp declare target (c)
|
||||
#pragma omp declare target link (c) /* { dg-error "specified both in declare target" } */
|
||||
int foo (void);
|
||||
#pragma omp declare target link (foo) /* { dg-error "is not a variable in clause" } */
|
||||
struct S;
|
||||
extern struct S d[]; /* { dg-error "array type has incomplete element type" "" { target c } } */
|
||||
#pragma omp declare target to (d) /* { dg-error "does not have a mappable type in" } */
|
||||
extern struct S e;
|
||||
#pragma omp declare target link (e) /* { dg-error "does not have a mappable type in" } */
|
||||
extern int f[];
|
||||
#pragma omp declare target to (f) /* { dg-error "does not have a mappable type in" } */
|
||||
int g, h;
|
||||
#pragma omp threadprivate (g, h)
|
||||
#pragma omp declare target to (g) /* { dg-error "is threadprivate variable in" } */
|
||||
#pragma omp declare target link (h) /* { dg-error "is threadprivate variable in" } */
|
||||
int j[10];
|
||||
#pragma omp declare target to (j[0:4]) /* { dg-error "expected" } */
|
21
gcc/testsuite/c-c++-common/gomp/depend-3.c
Normal file
21
gcc/testsuite/c-c++-common/gomp/depend-3.c
Normal file
@ -0,0 +1,21 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
void bar (int a[10][10][10]);
|
||||
void
|
||||
foo (int a[10][10][10], int **b, int x)
|
||||
{
|
||||
int c[10][10][10];
|
||||
#pragma omp task depend(out: a[2:4][3:0][:7]) /* { dg-error "zero length array section" } */
|
||||
bar (a);
|
||||
#pragma omp task depend(inout: b[:7][0:0][:0]) /* { dg-error "zero length array section" } */
|
||||
bar (a);
|
||||
#pragma omp task depend(in: c[:][:][10:]) /* { dg-error "zero length array section" } */
|
||||
bar (c);
|
||||
#pragma omp task depend(out: a[2:4][3:0][:x]) /* { dg-error "zero length array section" } */
|
||||
bar (a);
|
||||
#pragma omp task depend(inout: b[:x][0:0][:0]) /* { dg-error "zero length array section" } */
|
||||
bar (a);
|
||||
#pragma omp task depend(in: c[:][x-2:x][10:]) /* { dg-error "zero length array section" } */
|
||||
bar (c);
|
||||
}
|
44
gcc/testsuite/c-c++-common/gomp/depend-4.c
Normal file
44
gcc/testsuite/c-c++-common/gomp/depend-4.c
Normal file
@ -0,0 +1,44 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
void
|
||||
foo (int *p, int (*q)[10], int r[10], int s[10][10])
|
||||
{
|
||||
int a[10], b[10][10];
|
||||
#pragma omp task depend (inout: p[-1:2])
|
||||
;
|
||||
#pragma omp task depend (inout: q[-1:2][2:4])
|
||||
;
|
||||
#pragma omp task depend (inout: q[-1:2][-2:4]) /* { dg-error "negative low bound in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: r[-1:2])
|
||||
;
|
||||
#pragma omp task depend (inout: s[-1:2][2:4])
|
||||
;
|
||||
#pragma omp task depend (inout: s[-1:2][-2:4]) /* { dg-error "negative low bound in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: a[-1:2]) /* { dg-error "negative low bound in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: b[-1:2][2:4]) /* { dg-error "negative low bound in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: b[1:2][-2:4]) /* { dg-error "negative low bound in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: p[2:-3]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: q[2:-3][:]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: r[2:-5]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: s[2:-5][:]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: a[2:-5]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: b[2:-5][0:10]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp task depend (inout: b[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
}
|
48
gcc/testsuite/c-c++-common/gomp/doacross-1.c
Normal file
48
gcc/testsuite/c-c++-common/gomp/doacross-1.c
Normal file
@ -0,0 +1,48 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
void
|
||||
foo (void)
|
||||
{
|
||||
int i, j, k;
|
||||
#pragma omp for ordered (1)
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered depend (sink: i - 1)
|
||||
#pragma omp ordered depend (source)
|
||||
}
|
||||
#pragma omp for ordered (1) collapse (1)
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered depend (sink: i - 1)
|
||||
#pragma omp ordered depend (source)
|
||||
}
|
||||
#pragma omp for collapse (2) ordered (1) /* { dg-error "clause parameter is less than" } */
|
||||
for (i = 0; i < 64; i++)
|
||||
for (j = 0; j < 64; j++)
|
||||
{
|
||||
#pragma omp ordered depend (sink: i - 1) /* { dg-error "does not match number" } */
|
||||
#pragma omp ordered depend (source)
|
||||
}
|
||||
#pragma omp for ordered (2) collapse (3) /* { dg-error "clause parameter is less than" } */
|
||||
for (i = 0; i < 64; i++)
|
||||
for (j = 0; j < 64; j++)
|
||||
for (k = 0; k < 64; k++)
|
||||
{
|
||||
#pragma omp ordered depend (sink: i - 1, j - 2) /* { dg-error "does not match number" } */
|
||||
#pragma omp ordered depend (source)
|
||||
}
|
||||
#pragma omp ordered depend (sink: j) /* { dg-error "clause must be closely nested inside an ordered loop" } */
|
||||
#pragma omp ordered depend (source) /* { dg-error "clause must be closely nested inside an ordered loop" } */
|
||||
#pragma omp for ordered (1)
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered depend (sink: i - 1) depend (sink: i - 2)
|
||||
#pragma omp ordered depend (source) depend (source) /* { dg-error "more than one .depend.source.. clause on an" } */
|
||||
}
|
||||
#pragma omp for ordered (1)
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered depend (sink: i - 1) depend (source) depend (sink: i - 2) /* { dg-error "clause specified together with" } */
|
||||
}
|
||||
}
|
48
gcc/testsuite/c-c++-common/gomp/if-1.c
Normal file
48
gcc/testsuite/c-c++-common/gomp/if-1.c
Normal file
@ -0,0 +1,48 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
void
|
||||
foo (int a, int b, int *p, int *q)
|
||||
{
|
||||
int i;
|
||||
#pragma omp parallel if (a)
|
||||
;
|
||||
#pragma omp parallel if (parallel:a)
|
||||
;
|
||||
#pragma omp parallel for simd if (a)
|
||||
for (i = 0; i < 16; i++)
|
||||
;
|
||||
#pragma omp parallel for simd if (parallel : a)
|
||||
for (i = 0; i < 16; i++)
|
||||
;
|
||||
#pragma omp task if (a)
|
||||
;
|
||||
#pragma omp task if (task: a)
|
||||
;
|
||||
#pragma omp taskloop if (a)
|
||||
for (i = 0; i < 16; i++)
|
||||
;
|
||||
#pragma omp taskloop if (taskloop : a)
|
||||
for (i = 0; i < 16; i++)
|
||||
;
|
||||
#pragma omp target if (a)
|
||||
;
|
||||
#pragma omp target if (target: a)
|
||||
;
|
||||
#pragma omp target teams distribute parallel for simd if (a)
|
||||
for (i = 0; i < 16; i++)
|
||||
;
|
||||
#pragma omp target teams distribute parallel for simd if (parallel : a) if (target: b)
|
||||
for (i = 0; i < 16; i++)
|
||||
;
|
||||
#pragma omp target data if (a) map (p[0:2])
|
||||
;
|
||||
#pragma omp target data if (target data: a) map (p[0:2])
|
||||
;
|
||||
#pragma omp target enter data if (a) map (to: p[0:2])
|
||||
#pragma omp target enter data if (target enter data: a) map (to: p[0:2])
|
||||
#pragma omp target exit data if (a) map (from: p[0:2])
|
||||
#pragma omp target exit data if (target exit data: a) map (from: p[0:2])
|
||||
#pragma omp target update if (a) to (q[0:3])
|
||||
#pragma omp target update if (target update:a) to (q[0:3])
|
||||
}
|
43
gcc/testsuite/c-c++-common/gomp/if-2.c
Normal file
43
gcc/testsuite/c-c++-common/gomp/if-2.c
Normal file
@ -0,0 +1,43 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
void
|
||||
foo (int a, int b, int *p, int *q, int task)
|
||||
{
|
||||
int i;
|
||||
#pragma omp parallel if (a) if (b) /* { dg-error "too many .if. clauses without modifier" } */
|
||||
;
|
||||
#pragma omp parallel if (a) if (parallel: b) /* { dg-error "if any .if. clause has modifier, then all .if. clauses have to use modifier" } */
|
||||
;
|
||||
#pragma omp parallel if (parallel: a) if (b) /* { dg-error "if any .if. clause has modifier, then all .if. clauses have to use modifier" } */
|
||||
;
|
||||
#pragma omp parallel if (parallel:a) if (parallel:a) /* { dg-error "too many .if. clauses with .parallel. modifier" } */
|
||||
;
|
||||
#pragma omp parallel if (task:a) /* { dg-error "expected .parallel. .if. clause modifier rather than .task." } */ \
|
||||
if (taskloop: b) /* { dg-error "expected .parallel. .if. clause modifier rather than .taskloop." } */
|
||||
;
|
||||
#pragma omp parallel if (target update:a) /* { dg-error "expected .parallel. .if. clause modifier rather than .target update." } */
|
||||
;
|
||||
#pragma omp parallel for simd if (target update: a) /* { dg-error "expected .parallel. .if. clause modifier rather than .target update." } */
|
||||
for (i = 0; i < 16; i++)
|
||||
;
|
||||
#pragma omp task if (task)
|
||||
;
|
||||
#pragma omp task if (task: task)
|
||||
;
|
||||
#pragma omp task if (parallel: a) /* { dg-error "expected .task. .if. clause modifier rather than .parallel." } */
|
||||
;
|
||||
#pragma omp taskloop if (task : a) /* { dg-error "expected .taskloop. .if. clause modifier rather than .task." } */
|
||||
for (i = 0; i < 16; i++)
|
||||
;
|
||||
#pragma omp target if (taskloop: a) /* { dg-error "expected .target. .if. clause modifier rather than .taskloop." } */
|
||||
;
|
||||
#pragma omp target teams distribute parallel for simd if (target exit data : a) /* { dg-error "expected .parallel. or .target. .if. clause modifier" } */
|
||||
for (i = 0; i < 16; i++)
|
||||
;
|
||||
#pragma omp target data if (target: a) map (p[0:2]) /* { dg-error "expected .target data. .if. clause modifier rather than .target." } */
|
||||
;
|
||||
#pragma omp target enter data if (target data: a) map (to: p[0:2]) /* { dg-error "expected .target enter data. .if. clause modifier rather than .target data." } */
|
||||
#pragma omp target exit data if (target enter data: a) map (from: p[0:2]) /* { dg-error "expected .target exit data. .if. clause modifier rather than .target enter data." } */
|
||||
#pragma omp target update if (target exit data:a) to (q[0:3]) /* { dg-error "expected .target update. .if. clause modifier rather than .target exit data." } */
|
||||
}
|
42
gcc/testsuite/c-c++-common/gomp/linear-1.c
Normal file
42
gcc/testsuite/c-c++-common/gomp/linear-1.c
Normal file
@ -0,0 +1,42 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
int i;
|
||||
|
||||
#pragma omp declare simd linear (val (x) : 1) linear (y : 2)
|
||||
int bar (int x, int y, int z);
|
||||
|
||||
void
|
||||
foo (int x, int y)
|
||||
{
|
||||
#pragma omp simd linear (i: 3)
|
||||
for (i = 0; i < 33; i += 3)
|
||||
;
|
||||
#pragma omp simd linear (val (i): 3) /* { dg-error "modifier should not be specified in" } */
|
||||
for (i = 0; i < 33; i += 3)
|
||||
;
|
||||
#pragma omp simd linear (x: y + 1)
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp simd linear (val (x): y + 1) /* { dg-error "modifier should not be specified in" } */
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for linear (x: y + 1)
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for linear (val (x): y + 1) /* { dg-error "modifier should not be specified in" } */
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for simd linear (i: 3)
|
||||
for (i = 0; i < 33; i += 3)
|
||||
;
|
||||
#pragma omp for simd linear (val (i): 3) /* { dg-error "modifier should not be specified in" } */
|
||||
for (i = 0; i < 33; i += 3)
|
||||
;
|
||||
#pragma omp for simd linear (x: y + 1)
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for simd linear (val (x): y + 1) /* { dg-error "modifier should not be specified in" } */
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
}
|
44
gcc/testsuite/c-c++-common/gomp/map-2.c
Normal file
44
gcc/testsuite/c-c++-common/gomp/map-2.c
Normal file
@ -0,0 +1,44 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
void
|
||||
foo (int *p, int (*q)[10], int r[10], int s[10][10])
|
||||
{
|
||||
int a[10], b[10][10];
|
||||
#pragma omp target map (tofrom: p[-1:2])
|
||||
;
|
||||
#pragma omp target map (tofrom: q[-1:2][0:10])
|
||||
;
|
||||
#pragma omp target map (tofrom: q[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: r[-1:2])
|
||||
;
|
||||
#pragma omp target map (tofrom: s[-1:2][:])
|
||||
;
|
||||
#pragma omp target map (tofrom: s[-1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: a[-1:2]) /* { dg-error "negative low bound in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: b[-1:2][0:]) /* { dg-error "negative low bound in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: b[1:2][-2:10]) /* { dg-error "negative low bound in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: p[2:-3]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: q[2:-3][:]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: q[2:3][0:-1]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: r[2:-5]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: s[2:-5][:]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: s[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: a[2:-5]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: b[2:-5][0:10]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
#pragma omp target map (tofrom: b[2:5][0:-4]) /* { dg-error "negative length in array section in" } */
|
||||
;
|
||||
}
|
21
gcc/testsuite/c-c++-common/gomp/map-3.c
Normal file
21
gcc/testsuite/c-c++-common/gomp/map-3.c
Normal file
@ -0,0 +1,21 @@
|
||||
struct S { int i : 1; int j : 4; long long k : 25; };
|
||||
void bar (struct S, int);
|
||||
#pragma omp declare target to (bar)
|
||||
|
||||
void
|
||||
foo (struct S a, struct S b, struct S c, struct S d)
|
||||
{
|
||||
#pragma omp target map (a)
|
||||
bar (a, 0);
|
||||
#pragma omp target map (a) map (b.i) /* { dg-error "bit-field .b.\(S::\|\)i. in .map. clause" } */
|
||||
bar (a, b.i);
|
||||
#pragma omp target map (a) map (b.j) /* { dg-error "bit-field .b.\(S::\|\)j. in .map. clause" } */
|
||||
bar (a, b.j);
|
||||
#pragma omp target map (a) map (b.k) /* { dg-error "bit-field .b.\(S::\|\)k. in .map. clause" } */
|
||||
bar (a, b.k);
|
||||
#pragma omp target data map (a) map (b.i) /* { dg-error "bit-field .b.\(S::\|\)i. in .map. clause" } */
|
||||
{
|
||||
#pragma omp target enter data map (alloc: a) map (to: c.j) /* { dg-error "bit-field .c.\(S::\|\)j. in .map. clause" } */
|
||||
#pragma omp target exit data map (release: a) map (from: d.k) /* { dg-error "bit-field .d.\(S::\|\)k. in .map. clause" } */
|
||||
}
|
||||
}
|
@ -11,12 +11,12 @@ f_omp_parallel (void)
|
||||
#pragma omp target
|
||||
;
|
||||
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(i)
|
||||
;
|
||||
|
||||
#pragma omp target update to(i)
|
||||
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(i)
|
||||
{
|
||||
#pragma omp parallel
|
||||
;
|
||||
@ -24,7 +24,7 @@ f_omp_parallel (void)
|
||||
#pragma omp target
|
||||
;
|
||||
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(i)
|
||||
;
|
||||
|
||||
#pragma omp target update to(i)
|
||||
@ -45,7 +45,7 @@ f_omp_target (void)
|
||||
void
|
||||
f_omp_target_data (void)
|
||||
{
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(i)
|
||||
{
|
||||
#pragma omp parallel
|
||||
;
|
||||
@ -53,12 +53,12 @@ f_omp_target_data (void)
|
||||
#pragma omp target
|
||||
;
|
||||
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(i)
|
||||
;
|
||||
|
||||
#pragma omp target update to(i)
|
||||
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(i)
|
||||
{
|
||||
#pragma omp parallel
|
||||
;
|
||||
@ -66,7 +66,7 @@ f_omp_target_data (void)
|
||||
#pragma omp target
|
||||
;
|
||||
|
||||
#pragma omp target data
|
||||
#pragma omp target data map(i)
|
||||
;
|
||||
|
||||
#pragma omp target update to(i)
|
||||
|
@ -7,7 +7,7 @@ f_omp_target (void)
|
||||
{
|
||||
#pragma omp target /* { dg-warning "target construct inside of target region" } */
|
||||
;
|
||||
#pragma omp target data /* { dg-warning "target data construct inside of target region" } */
|
||||
#pragma omp target data map(i) /* { dg-warning "target data construct inside of target region" } */
|
||||
;
|
||||
#pragma omp target update to(i) /* { dg-warning "target update construct inside of target region" } */
|
||||
|
||||
@ -15,7 +15,7 @@ f_omp_target (void)
|
||||
{
|
||||
#pragma omp target /* { dg-warning "target construct inside of target region" } */
|
||||
;
|
||||
#pragma omp target data /* { dg-warning "target data construct inside of target region" } */
|
||||
#pragma omp target data map(i) /* { dg-warning "target data construct inside of target region" } */
|
||||
;
|
||||
#pragma omp target update to(i) /* { dg-warning "target update construct inside of target region" } */
|
||||
}
|
||||
|
91
gcc/testsuite/c-c++-common/gomp/ordered-1.c
Normal file
91
gcc/testsuite/c-c++-common/gomp/ordered-1.c
Normal file
@ -0,0 +1,91 @@
|
||||
/* { dg-do run } */
|
||||
/* { dg-options "-O2 -fopenmp-simd" } */
|
||||
/* { dg-additional-options "-msse2" { target sse2_runtime } } */
|
||||
/* { dg-additional-options "-mavx" { target avx_runtime } } */
|
||||
|
||||
#define N 1024
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
void abort (void);
|
||||
|
||||
int last;
|
||||
|
||||
void
|
||||
bar (unsigned char *a, int i, int safelen)
|
||||
{
|
||||
int j, k;
|
||||
if (i != last++)
|
||||
abort ();
|
||||
for (j = i - safelen - 32; j < i; j++)
|
||||
if (j >= 0 && a[j] != 2)
|
||||
break;
|
||||
if (j <= i - safelen || a[j] != 1)
|
||||
abort ();
|
||||
for (k = j; k < i + safelen + 32; k++)
|
||||
if (k >= N || a[k] != 1)
|
||||
break;
|
||||
if (k <= i || k > j + safelen)
|
||||
abort ();
|
||||
if (k < N && a[k] != 0)
|
||||
abort ();
|
||||
for (; k < i + safelen + 32; k++)
|
||||
if (k < N && a[k] != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
static inline void
|
||||
foo (unsigned char *a, int i)
|
||||
{
|
||||
#pragma omp ordered simd
|
||||
bar (a, i, 64);
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
unsigned char a[N], b[N];
|
||||
int i;
|
||||
#pragma omp simd
|
||||
for (i = 0; i < N; i++)
|
||||
a[i] = 0;
|
||||
#pragma omp simd safelen (64)
|
||||
for (i = 0; i < N; i++)
|
||||
{
|
||||
a[i]++;
|
||||
foo (a, i);
|
||||
a[i]++;
|
||||
}
|
||||
#pragma omp simd
|
||||
for (i = 0; i < N; i++)
|
||||
{
|
||||
a[i] = 0;
|
||||
b[i] = 0;
|
||||
}
|
||||
last = 0;
|
||||
#pragma omp simd safelen (32)
|
||||
for (i = 0; i < N; i++)
|
||||
{
|
||||
a[i]++;
|
||||
#pragma omp ordered simd
|
||||
bar (a, i, 32);
|
||||
a[i]++;
|
||||
}
|
||||
for (i = 0; i < N; i++)
|
||||
if (a[i] != 2)
|
||||
abort ();
|
||||
#pragma omp simd safelen (32)
|
||||
for (i = 1; i < N; i++)
|
||||
{
|
||||
#pragma omp ordered simd
|
||||
b[i] = b[i - 1] + 1;
|
||||
a[i]++;
|
||||
#pragma omp ordered simd
|
||||
a[i] += a[i - 1];
|
||||
}
|
||||
for (i = 0; i < N; i++)
|
||||
if (a[i] != (unsigned char) (2 + 3 * i) || b[i] != (unsigned char) i)
|
||||
abort ();
|
||||
return 0;
|
||||
}
|
4
gcc/testsuite/c-c++-common/gomp/ordered-2.c
Normal file
4
gcc/testsuite/c-c++-common/gomp/ordered-2.c
Normal file
@ -0,0 +1,4 @@
|
||||
/* { dg-do run } */
|
||||
/* { dg-options "-O0 -fopenmp-simd" } */
|
||||
|
||||
#include "ordered-1.c"
|
91
gcc/testsuite/c-c++-common/gomp/ordered-3.c
Normal file
91
gcc/testsuite/c-c++-common/gomp/ordered-3.c
Normal file
@ -0,0 +1,91 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
void
|
||||
foo (void)
|
||||
{
|
||||
int i;
|
||||
#pragma omp for ordered
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered
|
||||
;
|
||||
}
|
||||
#pragma omp for ordered
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered threads
|
||||
;
|
||||
}
|
||||
#pragma omp for ordered
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered threads threads /* { dg-error "too many .threads. clauses" } */
|
||||
;
|
||||
}
|
||||
#pragma omp simd
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered simd
|
||||
;
|
||||
}
|
||||
#pragma omp simd
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered simd simd /* { dg-error "too many .simd. clauses" } */
|
||||
;
|
||||
}
|
||||
#pragma omp for simd ordered
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered threads, simd
|
||||
;
|
||||
}
|
||||
#pragma omp for simd ordered
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered threads, simd, threads, simd /* { dg-error "too many .threads. clauses" } */
|
||||
; /* { dg-error "too many .simd. clauses" "" { target *-*-* } 47 } */
|
||||
}
|
||||
#pragma omp for simd ordered(1) /* { dg-error ".ordered. clause with parameter may not be specified on .#pragma omp for simd. construct" } */
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered depend(sink: i - 1) /* { dg-error "clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
|
||||
#pragma omp ordered depend(source) /* { dg-error "clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
|
||||
}
|
||||
#pragma omp parallel for simd ordered(1) /* { dg-error ".ordered. clause with parameter may not be specified on .#pragma omp parallel for simd. construct" } */
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
#pragma omp ordered depend(sink: i - 1) /* { dg-error "clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
|
||||
#pragma omp ordered depend(source) /* { dg-error "clause must be closely nested inside a loop with .ordered. clause with a parameter" } */
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
bar (int x)
|
||||
{
|
||||
switch (x)
|
||||
{
|
||||
case 0:
|
||||
#pragma omp ordered
|
||||
;
|
||||
break;
|
||||
case 1:
|
||||
#pragma omp ordered threads
|
||||
;
|
||||
break;
|
||||
case 2:
|
||||
#pragma omp ordered threads, threads /* { dg-error "too many .threads. clauses" } */
|
||||
;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
baz (void)
|
||||
{
|
||||
#pragma omp ordered simd
|
||||
;
|
||||
#pragma omp ordered simd, simd /* { dg-error "too many .simd. clauses" } */
|
||||
;
|
||||
}
|
@ -6,8 +6,8 @@ int
|
||||
foo (int *a)
|
||||
{
|
||||
int i, j = 0;
|
||||
#pragma omp target teams distribute simd linear(i, j) map(a[:10])
|
||||
#pragma omp target teams distribute simd linear(i) map(a[:10])
|
||||
for (i = 0; i < 10; i++)
|
||||
a[i] = j++;
|
||||
return i + j;
|
||||
a[i] = j;
|
||||
return i;
|
||||
}
|
||||
|
@ -50,22 +50,21 @@ test (int n, int o, int p, int q, int r, int s, int *pp)
|
||||
private (p) firstprivate (q) shared (n) reduction (+: r) \
|
||||
thread_limit (n * 2) dist_schedule (static, 4) collapse (2) \
|
||||
num_threads (n + 4) proc_bind (spread) lastprivate (s) \
|
||||
ordered schedule (static, 8)
|
||||
schedule (static, 8)
|
||||
for (i = 0; i < 10; i++)
|
||||
for (j = 0; j < 10; j++)
|
||||
{
|
||||
r = r + 1;
|
||||
p = q;
|
||||
dosomething (a, n, p + q);
|
||||
#pragma omp ordered
|
||||
p = q;
|
||||
p = q;
|
||||
s = i * 10 + j;
|
||||
}
|
||||
#pragma omp target teams distribute parallel for device (n + 1) num_teams (n + 4) \
|
||||
if (n != 6)map (from: n) map (alloc: a[2:o-2]) default(shared) \
|
||||
private (p) firstprivate (q) shared (n) reduction (+: r) \
|
||||
thread_limit (n * 2) dist_schedule (static, 4) num_threads (n + 4) \
|
||||
proc_bind (master) lastprivate (s) ordered schedule (static, 8)
|
||||
proc_bind (master) lastprivate (s) schedule (static, 8)
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
for (j = 0; j < 10; j++)
|
||||
@ -74,8 +73,7 @@ test (int n, int o, int p, int q, int r, int s, int *pp)
|
||||
p = q;
|
||||
dosomething (a, n, p + q);
|
||||
}
|
||||
#pragma omp ordered
|
||||
p = q;
|
||||
p = q;
|
||||
s = i * 10;
|
||||
}
|
||||
#pragma omp target teams distribute parallel for simd device (n + 1) \
|
||||
@ -165,22 +163,21 @@ test (int n, int o, int p, int q, int r, int s, int *pp)
|
||||
default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \
|
||||
thread_limit (n * 2) dist_schedule (static, 4) collapse (2) \
|
||||
num_threads (n + 4) proc_bind (spread) lastprivate (s) \
|
||||
ordered schedule (static, 8)
|
||||
schedule (static, 8)
|
||||
for (i = 0; i < 10; i++)
|
||||
for (j = 0; j < 10; j++)
|
||||
{
|
||||
r = r + 1;
|
||||
p = q;
|
||||
dosomething (a, n, p + q);
|
||||
#pragma omp ordered
|
||||
p = q;
|
||||
p = q;
|
||||
s = i * 10 + j;
|
||||
}
|
||||
#pragma omp target device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2])
|
||||
#pragma omp teams distribute parallel for num_teams (n + 4) if (n != 6) \
|
||||
default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \
|
||||
thread_limit (n * 2) dist_schedule (static, 4) num_threads (n + 4) \
|
||||
proc_bind (master) lastprivate (s) ordered schedule (static, 8)
|
||||
proc_bind (master) lastprivate (s) schedule (static, 8)
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
for (j = 0; j < 10; j++)
|
||||
@ -189,8 +186,7 @@ test (int n, int o, int p, int q, int r, int s, int *pp)
|
||||
p = q;
|
||||
dosomething (a, n, p + q);
|
||||
}
|
||||
#pragma omp ordered
|
||||
p = q;
|
||||
p = q;
|
||||
s = i * 10;
|
||||
}
|
||||
#pragma omp target device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2])
|
||||
@ -273,15 +269,14 @@ test (int n, int o, int p, int q, int r, int s, int *pp)
|
||||
default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \
|
||||
collapse (2) dist_schedule (static, 4) \
|
||||
num_threads (n + 4) proc_bind (spread) lastprivate (s) \
|
||||
ordered schedule (static, 8)
|
||||
schedule (static, 8)
|
||||
for (i = 0; i < 10; i++)
|
||||
for (j = 0; j < 10; j++)
|
||||
{
|
||||
r = r + 1;
|
||||
p = q;
|
||||
dosomething (a, n, p + q);
|
||||
#pragma omp ordered
|
||||
p = q;
|
||||
p = q;
|
||||
s = i * 10 + j;
|
||||
}
|
||||
#pragma omp target teams device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) \
|
||||
@ -289,7 +284,7 @@ test (int n, int o, int p, int q, int r, int s, int *pp)
|
||||
#pragma omp distribute parallel for if (n != 6) \
|
||||
default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \
|
||||
num_threads (n + 4) dist_schedule (static, 4) \
|
||||
proc_bind (master) lastprivate (s) ordered schedule (static, 8)
|
||||
proc_bind (master) lastprivate (s) schedule (static, 8)
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
for (j = 0; j < 10; j++)
|
||||
@ -298,8 +293,7 @@ test (int n, int o, int p, int q, int r, int s, int *pp)
|
||||
p = q;
|
||||
dosomething (a, n, p + q);
|
||||
}
|
||||
#pragma omp ordered
|
||||
p = q;
|
||||
p = q;
|
||||
s = i * 10;
|
||||
}
|
||||
#pragma omp target teams device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) \
|
||||
@ -385,21 +379,20 @@ test2 (int n, int o, int p, int r, int s, int *pp)
|
||||
default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \
|
||||
collapse (2) dist_schedule (static, 4) \
|
||||
num_threads (n + 4) proc_bind (spread) lastprivate (s) \
|
||||
ordered schedule (static, 8)
|
||||
schedule (static, 8)
|
||||
for (i = 0; i < 10; i++)
|
||||
for (j = 0; j < 10; j++)
|
||||
{
|
||||
r = r + 1;
|
||||
p = q;
|
||||
dosomething (a, n, p + q);
|
||||
#pragma omp ordered
|
||||
p = q;
|
||||
p = q;
|
||||
s = i * 10 + j;
|
||||
}
|
||||
#pragma omp distribute parallel for if (n != 6) \
|
||||
default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \
|
||||
num_threads (n + 4) dist_schedule (static, 4) \
|
||||
proc_bind (master) lastprivate (s) ordered schedule (static, 8)
|
||||
proc_bind (master) lastprivate (s) schedule (static, 8)
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
for (j = 0; j < 10; j++)
|
||||
@ -408,8 +401,7 @@ test2 (int n, int o, int p, int r, int s, int *pp)
|
||||
p = q;
|
||||
dosomething (a, n, p + q);
|
||||
}
|
||||
#pragma omp ordered
|
||||
p = q;
|
||||
p = q;
|
||||
s = i * 10;
|
||||
}
|
||||
#pragma omp distribute parallel for simd if (n != 6)default(shared) \
|
||||
|
26
gcc/testsuite/c-c++-common/gomp/priority-1.c
Normal file
26
gcc/testsuite/c-c++-common/gomp/priority-1.c
Normal file
@ -0,0 +1,26 @@
|
||||
void bar (void);
|
||||
|
||||
void
|
||||
foo (int x, unsigned long long y)
|
||||
{
|
||||
#pragma omp task
|
||||
bar ();
|
||||
#pragma omp taskloop
|
||||
for (int i = 0; i < 10; i++)
|
||||
bar ();
|
||||
#pragma omp task
|
||||
bar ();
|
||||
#pragma omp taskloop
|
||||
for (unsigned long long int i = 0; i < y; i++)
|
||||
bar ();
|
||||
#pragma omp task priority (1)
|
||||
bar ();
|
||||
#pragma omp taskloop priority (1)
|
||||
for (int i = 0; i < 10; i++)
|
||||
bar ();
|
||||
#pragma omp task priority (x + 1)
|
||||
bar ();
|
||||
#pragma omp taskloop priority (x + 1)
|
||||
for (unsigned long long int i = 0; i < y; i++)
|
||||
bar ();
|
||||
}
|
51
gcc/testsuite/c-c++-common/gomp/reduction-1.c
Normal file
51
gcc/testsuite/c-c++-common/gomp/reduction-1.c
Normal file
@ -0,0 +1,51 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
void bar (int a[10][10][10]);
|
||||
extern int f[][2]; /* { dg-error "has incomplete type" "" { target c++ } } */
|
||||
extern int g[]; /* { dg-error "has incomplete type" "" { target c++ } } */
|
||||
void
|
||||
foo (int a[10][10][10], int **b, int x)
|
||||
{
|
||||
int c[10][10][0];
|
||||
int d[0];
|
||||
char e[12];
|
||||
#pragma omp parallel reduction(+: a[:4][:0][:7]) /* { dg-error "zero length array section" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: b[:7][0:0][:0]) /* { dg-error "zero length array section" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: c[:][:][0:]) /* { dg-error "zero length array section|for unknown bound array type length expression must be specified" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: a[:4][:0][:x]) /* { dg-error "zero length array section" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: b[:x][0:0][:0]) /* { dg-error "zero length array section" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: c[:][:x][0:]) /* { dg-error "zero length array section|for unknown bound array type length expression must be specified" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: d) /* { dg-error "is a zero size array" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: a[0:4])
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: a[2:4]) /* { dg-error "array section has to be zero-based" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: e[2:4]) /* { dg-error "array section has to be zero-based" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: a[0.5:2]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: a[0:2.5]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: f[:][0:2]) /* { dg-error "for unknown bound array type length expression must be specified" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: a[:][0:10]) /* { dg-error "for pointer type length expression must be specified" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: a[:10][0:12]) /* { dg-error "above array section size" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: b[0:10][0:10]) /* { dg-error "array section is not contiguous" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: a[0:2][0:9]) /* { dg-error "array section is not contiguous" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: f) /* { dg-error "has an incomplete type|invalid use of array with unspecified bounds" } */
|
||||
bar (a);
|
||||
#pragma omp parallel reduction(+: g) /* { dg-error "has an incomplete type|invalid use of array with unspecified bounds" } */
|
||||
bar (a);
|
||||
}
|
51
gcc/testsuite/c-c++-common/gomp/schedule-simd-1.c
Normal file
51
gcc/testsuite/c-c++-common/gomp/schedule-simd-1.c
Normal file
@ -0,0 +1,51 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp -O2" } */
|
||||
/* { dg-additional-options "-mavx512f" { target { x86_64-*-* i?86-*-* } } } */
|
||||
|
||||
#define N 1024
|
||||
int a[N], b[N], c[N];
|
||||
|
||||
void
|
||||
f1 (void)
|
||||
{
|
||||
int i;
|
||||
#pragma omp parallel for simd schedule (simd:static)
|
||||
for (i = 0; i < N; i++)
|
||||
a[i] = b[i] + c[i];
|
||||
}
|
||||
|
||||
void
|
||||
f2 (void)
|
||||
{
|
||||
int i;
|
||||
#pragma omp parallel for simd schedule (simd: static, 7)
|
||||
for (i = 0; i < N; i++)
|
||||
a[i] = b[i] + c[i];
|
||||
}
|
||||
|
||||
void
|
||||
f3 (void)
|
||||
{
|
||||
int i;
|
||||
#pragma omp parallel for simd schedule (simd : dynamic, 7)
|
||||
for (i = 0; i < N; i++)
|
||||
a[i] = b[i] + c[i];
|
||||
}
|
||||
|
||||
void
|
||||
f4 (void)
|
||||
{
|
||||
int i;
|
||||
#pragma omp parallel for simd schedule ( simd:runtime)
|
||||
for (i = 0; i < N; i++)
|
||||
a[i] = b[i] + c[i];
|
||||
}
|
||||
|
||||
void
|
||||
f5 (void)
|
||||
{
|
||||
int i;
|
||||
#pragma omp parallel for simd schedule (simd:auto)
|
||||
for (i = 0; i < N; i++)
|
||||
a[i] = b[i] + c[i];
|
||||
}
|
96
gcc/testsuite/c-c++-common/gomp/sink-1.c
Normal file
96
gcc/testsuite/c-c++-common/gomp/sink-1.c
Normal file
@ -0,0 +1,96 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp -Wunknown-pragmas -Werror" } */
|
||||
|
||||
extern void bark (void);
|
||||
int i,j,k;
|
||||
int array[555];
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
#pragma omp parallel for ordered(2)
|
||||
for (i=0; i < 100; ++i)
|
||||
for (j=0; j < 100; ++j)
|
||||
{
|
||||
/* OUT variant does not apply to ORDERED construct. */
|
||||
#pragma omp ordered depend(out:i) /* { dg-error "invalid depend kind" } */
|
||||
|
||||
/* depend(sink...) is allowed without an offset. */
|
||||
#pragma omp ordered depend(sink:i,j-1)
|
||||
|
||||
#pragma omp ordered depend(sink:i-1,j+2)
|
||||
bark ();
|
||||
}
|
||||
|
||||
/* depend(sink...) does not apply to `omp task'. */
|
||||
#pragma omp task depend(sink:i+3) /* { dg-error "only allowed in 'omp ordered'" } */
|
||||
bark();
|
||||
|
||||
#pragma omp ordered depend(source) /* { dg-error "'depend' clause must be closely nested" } */
|
||||
|
||||
#pragma omp parallel for ordered(2)
|
||||
for (i=0; i < 100; ++i)
|
||||
for (j=0; j < 100; ++j)
|
||||
{
|
||||
/* Multiple depend(source) allowed. */
|
||||
#pragma omp ordered depend(source)
|
||||
#pragma omp ordered depend(source)
|
||||
}
|
||||
|
||||
#pragma omp parallel for ordered(2)
|
||||
for (i=0; i < 100; ++i)
|
||||
for (j=0; j < 100; ++j)
|
||||
{
|
||||
#pragma omp ordered depend(sink:i-2,j-2,k+2) /* { dg-error "does not match number of iteration var" } */
|
||||
bark();
|
||||
}
|
||||
|
||||
#pragma omp parallel for ordered(2)
|
||||
for (i=0; i < 100; ++i)
|
||||
for (j=0; j < 100; ++j)
|
||||
{
|
||||
#pragma omp ordered depend(sink:i-2) /* { dg-error "does not match number of iteration variables" } */
|
||||
bark();
|
||||
}
|
||||
|
||||
#pragma omp parallel for ordered(2)
|
||||
for (i=0; i < 100; ++i)
|
||||
for (j=0; j < 100; ++j)
|
||||
{
|
||||
#pragma omp ordered depend(sink:k,i) /* { dg-error "is not an iteration" } */
|
||||
bark();
|
||||
}
|
||||
}
|
||||
|
||||
void bar (int, int, int);
|
||||
|
||||
void
|
||||
foo (int n, int m, int o)
|
||||
{
|
||||
int i, j, k;
|
||||
#pragma omp for collapse(2) ordered(3)
|
||||
for (i = 0; i < m; i++)
|
||||
{
|
||||
for (j = 0; j < n; j++)
|
||||
for (k = 0; k < o; k++)
|
||||
{
|
||||
#pragma omp ordered depend(sink: i-1,j,k) depend(sink: i,j-1,k-1) depend(sink: i-1,j-1,k+1)
|
||||
bar (i, j, k);
|
||||
#pragma omp ordered depend(source)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
baz ()
|
||||
{
|
||||
int i, j;
|
||||
#pragma omp parallel for ordered(2)
|
||||
for (i=0; i < 100; ++i)
|
||||
for (j=0; j < 100; ++j)
|
||||
{
|
||||
#pragma omp ordered depend(sink:i-1,j-3)
|
||||
bar (i, j, 0);
|
||||
#pragma omp ordered depend(source)
|
||||
}
|
||||
}
|
16
gcc/testsuite/c-c++-common/gomp/sink-2.c
Normal file
16
gcc/testsuite/c-c++-common/gomp/sink-2.c
Normal file
@ -0,0 +1,16 @@
|
||||
/* { dg-do compile } */
|
||||
|
||||
void bar (int *);
|
||||
|
||||
void
|
||||
foo ()
|
||||
{
|
||||
int i,j;
|
||||
#pragma omp parallel for ordered(1)
|
||||
for (i=0; i < 100; ++i)
|
||||
{
|
||||
#pragma omp ordered depend(sink:i-1)
|
||||
bar(&i);
|
||||
#pragma omp ordered depend(source)
|
||||
}
|
||||
}
|
20
gcc/testsuite/c-c++-common/gomp/sink-3.c
Normal file
20
gcc/testsuite/c-c++-common/gomp/sink-3.c
Normal file
@ -0,0 +1,20 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
/* Test that we can handle multiple undeclared sink variables
|
||||
gracefully. */
|
||||
|
||||
void bar (int *);
|
||||
|
||||
void
|
||||
foo ()
|
||||
{
|
||||
int i,j;
|
||||
#pragma omp parallel for ordered(1)
|
||||
for (i=0; i < 100; ++i)
|
||||
{
|
||||
#pragma omp ordered depend(sink:poo-1,paa+1) /* { dg-error "poo.*declared.*paa.*declared" } */
|
||||
bar(&i);
|
||||
#pragma omp ordered depend(source)
|
||||
}
|
||||
}
|
25
gcc/testsuite/c-c++-common/gomp/sink-4.c
Normal file
25
gcc/testsuite/c-c++-common/gomp/sink-4.c
Normal file
@ -0,0 +1,25 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp -fdump-tree-omplower" } */
|
||||
|
||||
/* Test that we adjust pointer offsets for sink variables
|
||||
correctly. */
|
||||
|
||||
typedef struct {
|
||||
char stuff[400];
|
||||
} foo;
|
||||
|
||||
void
|
||||
funk (foo *begin, foo *end)
|
||||
{
|
||||
foo *p;
|
||||
#pragma omp parallel for ordered(1)
|
||||
for (p=end; p > begin; p--)
|
||||
{
|
||||
#pragma omp ordered depend(sink:p+1)
|
||||
void bar ();
|
||||
bar();
|
||||
#pragma omp ordered depend(source)
|
||||
}
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "depend\\(sink:p\\+400\\)" 1 "omplower" } } */
|
16
gcc/testsuite/c-c++-common/gomp/udr-1.c
Normal file
16
gcc/testsuite/c-c++-common/gomp/udr-1.c
Normal file
@ -0,0 +1,16 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp" } */
|
||||
|
||||
struct S {};
|
||||
void foo (void *, void *);
|
||||
void bar (void *, void *);
|
||||
void baz (void *);
|
||||
#pragma omp declare reduction(+:struct S:foo (&omp_out, &omp_in))initializer(bar(&omp_priv, &omp_orig))
|
||||
|
||||
void
|
||||
test (void)
|
||||
{
|
||||
struct S a, b[10];
|
||||
#pragma omp parallel reduction(+:a)
|
||||
baz (&a);
|
||||
}
|
15
gcc/testsuite/c-c++-common/taskloop-1.c
Normal file
15
gcc/testsuite/c-c++-common/taskloop-1.c
Normal file
@ -0,0 +1,15 @@
|
||||
/* { dg-do compile } */
|
||||
|
||||
int e;
|
||||
int bar (int, int);
|
||||
void baz (int, int, int, int *, int *, int *);
|
||||
|
||||
void
|
||||
foo (int a, int b, int c, int d, int f, int g, int h, int j, int k, int l)
|
||||
{
|
||||
int i;
|
||||
#pragma omp taskloop if (a) final (b) untied default(none) mergeable \
|
||||
private(c) firstprivate (e) shared (d) num_tasks(f) collapse(1)
|
||||
for (i = bar (g, h) + j; i < k; i += l)
|
||||
baz (i, d, e++, &c, &d, &e);
|
||||
}
|
@ -9,22 +9,22 @@ struct T
|
||||
|
||||
void T::test()
|
||||
{
|
||||
#pragma omp parallel private(n) // { dg-error "T::n" }
|
||||
#pragma omp parallel private(n)
|
||||
n = 1;
|
||||
|
||||
#pragma omp parallel shared(n) // { dg-error "T::n" }
|
||||
n = 1;
|
||||
|
||||
#pragma omp parallel firstprivate(n) // { dg-error "T::n" }
|
||||
#pragma omp parallel firstprivate(n)
|
||||
n = 1;
|
||||
|
||||
#pragma omp sections lastprivate(n) // { dg-error "T::n" }
|
||||
#pragma omp sections lastprivate(n)
|
||||
{ n = 1; }
|
||||
|
||||
#pragma omp parallel reduction(+:n) // { dg-error "T::n" }
|
||||
#pragma omp parallel reduction(+:n)
|
||||
n = 1;
|
||||
|
||||
#pragma omp single copyprivate(n) // { dg-error "T::n" }
|
||||
#pragma omp single copyprivate(n)
|
||||
n = 1;
|
||||
|
||||
#pragma omp parallel copyin(n) // { dg-error "T::n" }
|
||||
|
@ -34,6 +34,9 @@ foo (int x)
|
||||
#pragma omp p for lastprivate (x, x) // { dg-error "more than once" }
|
||||
for (i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp p for linear (x, x) // { dg-error "more than once" }
|
||||
for (i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp single private (x) copyprivate (x) // { dg-error "more than once" }
|
||||
;
|
||||
#pragma omp p shared (bar) // { dg-error "is not a variable" }
|
||||
@ -46,7 +49,7 @@ foo (int x)
|
||||
;
|
||||
#pragma omp p reduction (*:s) // { dg-error "user defined reduction not found for" }
|
||||
;
|
||||
#pragma omp p reduction (-:a) // { dg-error "has invalid type for" }
|
||||
#pragma omp p reduction (-:a)
|
||||
;
|
||||
d = 0;
|
||||
#pragma omp p reduction (*:d)
|
||||
@ -80,6 +83,9 @@ foo (int x)
|
||||
;
|
||||
#pragma omp p reduction (*:t) // { dg-error "predetermined 'threadprivate'" }
|
||||
;
|
||||
#pragma omp p for linear (t) // { dg-error "predetermined 'threadprivate'" }
|
||||
for (i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp p shared (c) // { dg-error "predetermined 'shared'" }
|
||||
;
|
||||
#pragma omp p private (c) // { dg-error "predetermined 'shared'" }
|
||||
@ -91,4 +97,7 @@ foo (int x)
|
||||
;
|
||||
#pragma omp p reduction (*:c) // { dg-error "predetermined 'shared'" }
|
||||
;
|
||||
#pragma omp p for linear (c:2) // { dg-error "predetermined 'shared'" }
|
||||
for (i = 0; i < 10; i++)
|
||||
;
|
||||
}
|
||||
|
49
gcc/testsuite/g++.dg/gomp/declare-simd-3.C
Normal file
49
gcc/testsuite/g++.dg/gomp/declare-simd-3.C
Normal file
@ -0,0 +1,49 @@
|
||||
// { dg-do compile }
|
||||
|
||||
#pragma omp declare simd uniform(b) linear(c, d) linear(uval(e)) linear(ref(f))
|
||||
int f1 (int a, int b, int c, int &d, int &e, int &f)
|
||||
{
|
||||
a++;
|
||||
b++;
|
||||
c++;
|
||||
d++;
|
||||
e++;
|
||||
f++;
|
||||
return a + b + c + d + e + f;
|
||||
}
|
||||
|
||||
#pragma omp declare simd uniform(b) linear(c, d) linear(uval(e)) linear(ref(f))
|
||||
int f2 (int a, int b, int c, int &d, int &e, int &f)
|
||||
{
|
||||
asm volatile ("" : : "r" (&a));
|
||||
asm volatile ("" : : "r" (&b));
|
||||
asm volatile ("" : : "r" (&c));
|
||||
asm volatile ("" : : "r" (&d));
|
||||
asm volatile ("" : : "r" (&e));
|
||||
asm volatile ("" : : "r" (&f));
|
||||
a++;
|
||||
b++;
|
||||
c++;
|
||||
d++;
|
||||
e++;
|
||||
f++;
|
||||
return a + b + c + d + e + f;
|
||||
}
|
||||
|
||||
#pragma omp declare simd uniform(b) linear(c, d) linear(uval(e)) linear(ref(f))
|
||||
int f3 (const int a, const int b, const int c, const int &d, const int &e, const int &f)
|
||||
{
|
||||
return a + b + c + d + e + f;
|
||||
}
|
||||
|
||||
#pragma omp declare simd uniform(b) linear(c, d) linear(uval(e)) linear(ref(f))
|
||||
int f4 (const int a, const int b, const int c, const int &d, const int &e, const int &f)
|
||||
{
|
||||
asm volatile ("" : : "r" (&a));
|
||||
asm volatile ("" : : "r" (&b));
|
||||
asm volatile ("" : : "r" (&c));
|
||||
asm volatile ("" : : "r" (&d));
|
||||
asm volatile ("" : : "r" (&e));
|
||||
asm volatile ("" : : "r" (&f));
|
||||
return a + b + c + d + e + f;
|
||||
}
|
48
gcc/testsuite/g++.dg/gomp/linear-1.C
Normal file
48
gcc/testsuite/g++.dg/gomp/linear-1.C
Normal file
@ -0,0 +1,48 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-fopenmp" }
|
||||
|
||||
int i;
|
||||
|
||||
#pragma omp declare simd linear (ref (x) : 1) linear (uval (y) : 2)
|
||||
int bar (int &x, int &y, int z);
|
||||
|
||||
void
|
||||
foo (int &x, int &y)
|
||||
{
|
||||
#pragma omp simd linear (x: y + 1)
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp simd linear (val (x): y + 1) // { dg-error "modifier should not be specified in" }
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp simd linear (ref (x): y + 1) // { dg-error "modifier should not be specified in" }
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp simd linear (uval (x): y + 1) // { dg-error "modifier should not be specified in" }
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for linear (x: y + 1)
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for linear (val (x): y + 1) // { dg-error "modifier should not be specified in" }
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for linear (ref (x): y + 1) // { dg-error "modifier should not be specified in" }
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for linear (uval (x): y + 1) // { dg-error "modifier should not be specified in" }
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for simd linear (x: y + 1)
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for simd linear (val (x): y + 1) // { dg-error "modifier should not be specified in" }
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for simd linear (ref (x): y + 1) // { dg-error "modifier should not be specified in" }
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
#pragma omp for simd linear (uval (x): y + 1) // { dg-error "modifier should not be specified in" }
|
||||
for (i = 0; i < 10; i++)
|
||||
x += y + 1;
|
||||
}
|
252
gcc/testsuite/g++.dg/gomp/member-1.C
Normal file
252
gcc/testsuite/g++.dg/gomp/member-1.C
Normal file
@ -0,0 +1,252 @@
|
||||
struct T { T () {}; virtual ~T () {}; int t; };
|
||||
struct S : virtual public T { int a; void foo (); };
|
||||
template <typename T>
|
||||
struct U { U () {}; virtual ~U () {}; T t; };
|
||||
template <typename T>
|
||||
struct V : virtual public U<T> { T a; void foo (); };
|
||||
|
||||
void
|
||||
S::foo ()
|
||||
{
|
||||
#pragma omp parallel firstprivate (a, t)
|
||||
{
|
||||
int *q1 = &a;
|
||||
int *q2 = &this->a;
|
||||
int q3 = a;
|
||||
int q4 = this->a;
|
||||
int *q5 = &t;
|
||||
int *q6 = &this->t;
|
||||
int q7 = t;
|
||||
int q8 = this->t;
|
||||
int q9 = T::t;
|
||||
int q10 = this->T::t;
|
||||
int &q11 = a;
|
||||
int &q12 = this->a;
|
||||
int &q13 = t;
|
||||
int &q14 = this->t;
|
||||
int &q15 = S::a;
|
||||
int &q16 = this->S::a;
|
||||
int &q17 = T::t;
|
||||
int &q18 = this->T::t;
|
||||
}
|
||||
#pragma omp parallel private (a, t)
|
||||
{
|
||||
a = 7;
|
||||
S::a += 9;
|
||||
t = 10;
|
||||
T::t += 11;
|
||||
}
|
||||
#pragma omp parallel
|
||||
{
|
||||
#pragma omp sections lastprivate (S::a, T::t)
|
||||
{
|
||||
#pragma omp section
|
||||
{
|
||||
S::a = 6;
|
||||
T::t = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma omp parallel
|
||||
{
|
||||
#pragma omp for firstprivate (a, t) lastprivate (a, t)
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
int q19 = a + t;
|
||||
if (i == 9)
|
||||
{
|
||||
a = i;
|
||||
T::t = i + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma omp sections lastprivate (a, t)
|
||||
{
|
||||
#pragma omp section
|
||||
{
|
||||
a = 5;
|
||||
t = 6;
|
||||
}
|
||||
}
|
||||
#pragma omp for firstprivate (a, t) lastprivate (a, t)
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
int q20 = a + t;
|
||||
if (i == 9)
|
||||
{
|
||||
a = i;
|
||||
T::t = i + 2;
|
||||
}
|
||||
}
|
||||
#pragma omp parallel sections lastprivate (a, t)
|
||||
{
|
||||
#pragma omp section
|
||||
{
|
||||
a = 5;
|
||||
t = 6;
|
||||
}
|
||||
}
|
||||
#pragma omp parallel
|
||||
{
|
||||
#pragma omp task firstprivate (a, t)
|
||||
{
|
||||
S::a++;
|
||||
t++;
|
||||
}
|
||||
}
|
||||
#pragma omp parallel
|
||||
{
|
||||
#pragma omp taskloop firstprivate (a, t) lastprivate (t)
|
||||
for (int i = 0; i < a; i++)
|
||||
t++;
|
||||
}
|
||||
#pragma omp taskloop firstprivate (a, t) lastprivate (t)
|
||||
for (int i = 0; i < a; i++)
|
||||
t++;
|
||||
a = 1;
|
||||
t = 0;
|
||||
#pragma omp parallel sections reduction (*: S::a) reduction (+: t)
|
||||
{
|
||||
{
|
||||
a = 1;
|
||||
t = 2;
|
||||
}
|
||||
#pragma omp section
|
||||
{
|
||||
a = 2;
|
||||
t = 3;
|
||||
}
|
||||
#pragma omp section
|
||||
{
|
||||
a = 3;
|
||||
t = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
V<T>::foo ()
|
||||
{
|
||||
#pragma omp parallel firstprivate (a, U<T>::t)
|
||||
{
|
||||
int *q1 = &a;
|
||||
int *q2 = &this->a;
|
||||
int q3 = a;
|
||||
int q4 = this->a;
|
||||
int *q5 = &(U<T>::t);
|
||||
int *q6 = &this->U<T>::t;
|
||||
int q7 = U<T>::t;
|
||||
int q8 = this->U<T>::t;
|
||||
int q9 = U<T>::t;
|
||||
int q10 = this->U<T>::t;
|
||||
int &q11 = a;
|
||||
int &q12 = this->a;
|
||||
int &q13 = U<T>::t;
|
||||
int &q14 = this->U<T>::t;
|
||||
int &q15 = V::a;
|
||||
int &q16 = this->V::a;
|
||||
int &q17 = U<T>::t;
|
||||
int &q18 = this->U<T>::t;
|
||||
}
|
||||
#pragma omp parallel private (a, U<T>::t)
|
||||
{
|
||||
a = 7;
|
||||
V::a += 9;
|
||||
U<T>::t = 10;
|
||||
U<T>::t += 11;
|
||||
}
|
||||
#pragma omp parallel
|
||||
{
|
||||
#pragma omp sections lastprivate (V::a, U<T>::t)
|
||||
{
|
||||
#pragma omp section
|
||||
{
|
||||
V::a = 6;
|
||||
U<T>::t = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma omp parallel
|
||||
{
|
||||
#pragma omp for firstprivate (a, U<T>::t) lastprivate (a, U<T>::t)
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
int q19 = a + U<T>::t;
|
||||
if (i == 9)
|
||||
{
|
||||
a = i;
|
||||
U<T>::t = i + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma omp sections lastprivate (a, U<T>::t)
|
||||
{
|
||||
#pragma omp section
|
||||
{
|
||||
a = 5;
|
||||
U<T>::t = 6;
|
||||
}
|
||||
}
|
||||
#pragma omp for firstprivate (a, U<T>::t) lastprivate (a, U<T>::t)
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
int q20 = a + U<T>::t;
|
||||
if (i == 9)
|
||||
{
|
||||
a = i;
|
||||
U<T>::t = i + 2;
|
||||
}
|
||||
}
|
||||
#pragma omp parallel sections lastprivate (a, U<T>::t)
|
||||
{
|
||||
#pragma omp section
|
||||
{
|
||||
a = 5;
|
||||
U<T>::t = 6;
|
||||
}
|
||||
}
|
||||
#pragma omp parallel
|
||||
{
|
||||
#pragma omp task firstprivate (a, U<T>::t)
|
||||
{
|
||||
V::a++;
|
||||
U<T>::t++;
|
||||
}
|
||||
}
|
||||
#pragma omp parallel
|
||||
{
|
||||
#pragma omp taskloop firstprivate (a, U<T>::t) lastprivate (U<T>::t)
|
||||
for (int i = 0; i < a; i++)
|
||||
U<T>::t++;
|
||||
}
|
||||
#pragma omp taskloop firstprivate (a, U<T>::t) lastprivate (U<T>::t)
|
||||
for (int i = 0; i < a; i++)
|
||||
U<T>::t++;
|
||||
a = 1;
|
||||
U<T>::t = 0;
|
||||
#pragma omp parallel sections reduction (*: V::a) reduction (+: U<T>::t)
|
||||
{
|
||||
{
|
||||
a = 1;
|
||||
U<T>::t = 2;
|
||||
}
|
||||
#pragma omp section
|
||||
{
|
||||
a = 2;
|
||||
U<T>::t = 3;
|
||||
}
|
||||
#pragma omp section
|
||||
{
|
||||
a = 3;
|
||||
U<T>::t = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
bar ()
|
||||
{
|
||||
V<int> v;
|
||||
v.foo ();
|
||||
}
|
168
gcc/testsuite/g++.dg/gomp/member-2.C
Normal file
168
gcc/testsuite/g++.dg/gomp/member-2.C
Normal file
@ -0,0 +1,168 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-fopenmp" }
|
||||
|
||||
int d;
|
||||
|
||||
struct A
|
||||
{
|
||||
A () : a(2), b(3), c(d) {}
|
||||
A (int x) : a(2), b(x), c(d) {}
|
||||
int a;
|
||||
A (const A &);
|
||||
A &operator= (const A &);
|
||||
const A &operator= (const A &) const;
|
||||
mutable int b;
|
||||
int &c;
|
||||
};
|
||||
|
||||
struct B : public A
|
||||
{
|
||||
B () : h(5) {}
|
||||
~B ();
|
||||
B (const B &);
|
||||
A e;
|
||||
mutable A f;
|
||||
const A g;
|
||||
const int h;
|
||||
int m1 ();
|
||||
int m2 ();
|
||||
int m3 () const;
|
||||
int m4 () const;
|
||||
};
|
||||
|
||||
void foo (A &);
|
||||
|
||||
#pragma omp declare reduction (+:A:omp_out.b += omp_in.b) initializer (foo (omp_priv))
|
||||
|
||||
int
|
||||
B::m1 ()
|
||||
{
|
||||
#pragma omp parallel private (a, b, c, e, f, g)
|
||||
;
|
||||
#pragma omp parallel firstprivate (a, b, c, e, f, g)
|
||||
;
|
||||
#pragma omp parallel for lastprivate (a, b, c, e, f, g)
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp simd linear (a, b, c : 1)
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
a++;
|
||||
b++;
|
||||
c++;
|
||||
}
|
||||
#pragma omp parallel for reduction (+:a, b, c, e, f)
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
B::m2 ()
|
||||
{
|
||||
#pragma omp parallel private (h) // { dg-error "is predetermined .shared. for .private." }
|
||||
;
|
||||
#pragma omp parallel firstprivate (h)
|
||||
;
|
||||
#pragma omp parallel for lastprivate (h) // { dg-error "is predetermined .shared. for .lastprivate." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp simd linear (h : 1) // { dg-error "is predetermined .shared. for .linear." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp parallel for reduction (+:h) // { dg-error "is predetermined .shared. for .reduction." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp parallel for reduction (+:g) // { dg-error "has const type for .reduction." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp parallel shared (a) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (b) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (c) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (e) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (f) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (g) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (h) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
B::m3 () const
|
||||
{
|
||||
#pragma omp parallel private (b, c, e, f, g)
|
||||
;
|
||||
#pragma omp parallel firstprivate (b, c, e, f, g)
|
||||
;
|
||||
#pragma omp parallel for lastprivate (b, c, e, f, g)
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp simd linear (b, c : 1)
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
b++;
|
||||
c++;
|
||||
}
|
||||
#pragma omp parallel for reduction (+:b, c, f)
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
B::m4 () const
|
||||
{
|
||||
#pragma omp parallel private (a) // { dg-error "is predetermined .shared. for .private." }
|
||||
;
|
||||
#pragma omp parallel firstprivate (a)
|
||||
;
|
||||
#pragma omp parallel for lastprivate (a) // { dg-error "is predetermined .shared. for .lastprivate." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp simd linear (a : 1) // { dg-error "is predetermined .shared. for .linear." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp parallel for reduction (+:a) // { dg-error "is predetermined .shared. for .reduction." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp parallel private (h) // { dg-error "is predetermined .shared. for .private." }
|
||||
;
|
||||
#pragma omp parallel firstprivate (h)
|
||||
;
|
||||
#pragma omp parallel for lastprivate (h) // { dg-error "is predetermined .shared. for .lastprivate." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp simd linear (h : 1) // { dg-error "is predetermined .shared. for .linear." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp parallel for reduction (+:h) // { dg-error "is predetermined .shared. for .reduction." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp parallel for reduction (+:e) // { dg-error "has const type for .reduction." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp parallel for reduction (+:g) // { dg-error "has const type for .reduction." }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp parallel shared (a) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (b) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (c) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (e) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (f) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (g) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
#pragma omp parallel shared (h) // { dg-error "is not a variable in clause" }
|
||||
;
|
||||
return 0;
|
||||
}
|
36
gcc/testsuite/g++.dg/gomp/pr66571-2.C
Normal file
36
gcc/testsuite/g++.dg/gomp/pr66571-2.C
Normal file
@ -0,0 +1,36 @@
|
||||
// PR c++/66571
|
||||
// { dg-do compile }
|
||||
// { dg-options "-fopenmp" }
|
||||
|
||||
template <typename T>
|
||||
extern void bar (T, T, T, T);
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
foo (T a, T b, T c, T d)
|
||||
{
|
||||
#pragma omp parallel for simd private (a) firstprivate (b) lastprivate (c) linear (d:2)
|
||||
for (int i = 0; i < 10; i++)
|
||||
bar<T> (a, b, c, d), d += 2;
|
||||
#pragma omp parallel private (c)
|
||||
#pragma omp single copyprivate (c)
|
||||
bar<T> (a, b, c, d);
|
||||
T e = a;
|
||||
T f = b;
|
||||
T g = c;
|
||||
T h = d;
|
||||
#pragma omp parallel for simd private (e) firstprivate (f) lastprivate (g) linear (h:2)
|
||||
for (int i = 0; i < 10; i++)
|
||||
bar<T> (e, f, g, h), h += 2;
|
||||
#pragma omp parallel private (g)
|
||||
#pragma omp single copyprivate (g)
|
||||
bar<T> (e, f, g, h);
|
||||
}
|
||||
|
||||
void
|
||||
baz ()
|
||||
{
|
||||
int a = 0, b = 0, c = 0, d = 0;
|
||||
foo <int> (a, b, c, d);
|
||||
foo <int &> (a, b, c, d);
|
||||
}
|
@ -12,4 +12,8 @@ foo (T x)
|
||||
#pragma omp for collapse (x + 1) // { dg-error "collapse argument needs positive constant integer expression" }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp for ordered (x + 1) // { dg-error "ordered argument needs positive constant integer expression" }
|
||||
for (int i = 0; i < 10; i++)
|
||||
for (int j = 0; j < 10; j++)
|
||||
;
|
||||
}
|
||||
|
@ -17,6 +17,10 @@ foo (void)
|
||||
|
||||
#pragma omp task depend (inout: S[0:10]) // { dg-error "is not a variable in" }
|
||||
;
|
||||
|
||||
#pragma omp for reduction (+:S[0:10]) // { dg-error "is not a variable in" }
|
||||
for (int i = 0; i < 16; i++)
|
||||
;
|
||||
}
|
||||
|
||||
void
|
||||
|
26
gcc/testsuite/g++.dg/gomp/reference-1.C
Normal file
26
gcc/testsuite/g++.dg/gomp/reference-1.C
Normal file
@ -0,0 +1,26 @@
|
||||
// { dg-do compile }
|
||||
|
||||
struct S; // { dg-message "forward declaration" }
|
||||
void foo (S &);
|
||||
|
||||
void
|
||||
f1 (S &x) // { dg-error "has incomplete type" }
|
||||
{
|
||||
#pragma omp parallel private (x)
|
||||
foo (x);
|
||||
}
|
||||
|
||||
void
|
||||
f2 (S &x) // { dg-error "has incomplete type" }
|
||||
{
|
||||
#pragma omp parallel firstprivate (x)
|
||||
foo (x);
|
||||
}
|
||||
|
||||
void
|
||||
f3 (S &x) // { dg-error "has incomplete type" }
|
||||
{
|
||||
#pragma omp parallel for lastprivate (x)
|
||||
for (int i = 0; i < 10; i++)
|
||||
foo (x);
|
||||
}
|
22
gcc/testsuite/g++.dg/gomp/sink-1.C
Normal file
22
gcc/testsuite/g++.dg/gomp/sink-1.C
Normal file
@ -0,0 +1,22 @@
|
||||
/* { dg-do compile } */
|
||||
|
||||
void bar (int, int, int);
|
||||
|
||||
template<typename T>
|
||||
void baz ()
|
||||
{
|
||||
T i, j;
|
||||
#pragma omp parallel for ordered(2)
|
||||
for (i=0; i < 100; ++i)
|
||||
for (j=0; j < 100; ++j)
|
||||
{
|
||||
#pragma omp ordered depend(sink:i-3,j)
|
||||
bar (i, j, 0);
|
||||
#pragma omp ordered depend(source)
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
baz<int>();
|
||||
}
|
64
gcc/testsuite/g++.dg/gomp/sink-2.C
Normal file
64
gcc/testsuite/g++.dg/gomp/sink-2.C
Normal file
@ -0,0 +1,64 @@
|
||||
/* { dg-do compile } */
|
||||
|
||||
/* Tests iterators are allowed in ordered loops and that we keep track
|
||||
of the original iterator DECL for diagnostic purposes. */
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
/* Test plain iterator. */
|
||||
void foo1 ()
|
||||
{
|
||||
std::vector<int> v;
|
||||
for (int i=1; i<=5; i++) v.push_back(i);
|
||||
|
||||
std::vector<int>::const_iterator it;
|
||||
|
||||
#pragma omp parallel for ordered(1)
|
||||
for (it = v.begin(); it < v.end(); ++it)
|
||||
{
|
||||
#pragma omp ordered depend(sink:it-1)
|
||||
std::cout << *it << '\n';
|
||||
#pragma omp ordered depend(source)
|
||||
}
|
||||
}
|
||||
|
||||
/* Test non-dependent iterator in a template. */
|
||||
template <int N>
|
||||
void foo2 ()
|
||||
{
|
||||
std::vector<int> v;
|
||||
for (int i=1; i<=5; i++) v.push_back(i);
|
||||
|
||||
std::vector<int>::const_iterator it;
|
||||
#pragma omp parallel for ordered(1)
|
||||
for (it = v.begin(); it < v.end(); ++it)
|
||||
{
|
||||
#pragma omp ordered depend(sink:it-1)
|
||||
std::cout << *it << '\n';
|
||||
#pragma omp ordered depend(source)
|
||||
}
|
||||
}
|
||||
|
||||
/* Test dependent iterator in a template. */
|
||||
template <typename T>
|
||||
void foo3 ()
|
||||
{
|
||||
std::vector<T> v;
|
||||
for (int i=1; i<=5; i++) v.push_back(i);
|
||||
|
||||
typename std::vector<T>::const_iterator it;
|
||||
#pragma omp parallel for ordered(1)
|
||||
for (it = v.begin(); it < v.end(); ++it)
|
||||
{
|
||||
#pragma omp ordered depend(sink:it-1)
|
||||
std::cout << *it << '\n';
|
||||
#pragma omp ordered depend(source)
|
||||
}
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
foo2 <0> ();
|
||||
foo3 <int> ();
|
||||
}
|
33
gcc/testsuite/g++.dg/gomp/sink-3.C
Normal file
33
gcc/testsuite/g++.dg/gomp/sink-3.C
Normal file
@ -0,0 +1,33 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fopenmp -fdump-tree-gimple" } */
|
||||
|
||||
/* Test that we adjust pointer offsets for sink variables
|
||||
correctly. */
|
||||
|
||||
typedef struct {
|
||||
char stuff[400];
|
||||
} foo;
|
||||
|
||||
foo *end, *begin, *p;
|
||||
|
||||
template<int N>
|
||||
void
|
||||
funk ()
|
||||
{
|
||||
int i,j;
|
||||
#pragma omp parallel for ordered(1)
|
||||
for (p=end; p > begin; p--)
|
||||
{
|
||||
#pragma omp ordered depend(sink:p+1)
|
||||
void bar ();
|
||||
bar();
|
||||
#pragma omp ordered depend(source)
|
||||
}
|
||||
}
|
||||
|
||||
void foobar()
|
||||
{
|
||||
funk<3>();
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "depend\\(sink:p\\+400\\)" 1 "gimple" } } */
|
@ -10,8 +10,8 @@ const A a;
|
||||
void foo (A &p)
|
||||
{
|
||||
const A &q = a;
|
||||
#pragma omp task // { dg-error "has reference type" }
|
||||
#pragma omp task
|
||||
bar (p);
|
||||
#pragma omp task // { dg-error "has reference type" }
|
||||
#pragma omp task
|
||||
bar (q);
|
||||
}
|
||||
|
68
gcc/testsuite/g++.dg/gomp/this-1.C
Normal file
68
gcc/testsuite/g++.dg/gomp/this-1.C
Normal file
@ -0,0 +1,68 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-fopenmp" }
|
||||
|
||||
struct S
|
||||
{
|
||||
#pragma omp declare simd linear(this) // { dg-error "is not an function argument" }
|
||||
static void foo ();
|
||||
void bar ();
|
||||
};
|
||||
|
||||
void
|
||||
S::bar ()
|
||||
{
|
||||
#pragma omp parallel firstprivate (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp parallel for lastprivate (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp parallel shared (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp for linear (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp task depend(inout: this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp task depend(inout: this[0]) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp parallel private (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
{
|
||||
#pragma omp single copyprivate (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
template <int N>
|
||||
struct T
|
||||
{
|
||||
#pragma omp declare simd linear(this) // { dg-error "is not an function argument" }
|
||||
static void foo ();
|
||||
void bar ();
|
||||
};
|
||||
|
||||
template <int N>
|
||||
void
|
||||
T<N>::bar ()
|
||||
{
|
||||
#pragma omp parallel firstprivate (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp parallel for lastprivate (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp parallel shared (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp for linear (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
for (int i = 0; i < 10; i++)
|
||||
;
|
||||
#pragma omp task depend(inout: this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp task depend(inout: this[0]) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp parallel private (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
{
|
||||
#pragma omp single copyprivate (this) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
template struct T<0>;
|
42
gcc/testsuite/g++.dg/gomp/this-2.C
Normal file
42
gcc/testsuite/g++.dg/gomp/this-2.C
Normal file
@ -0,0 +1,42 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-fopenmp" }
|
||||
|
||||
struct S
|
||||
{
|
||||
void bar (int);
|
||||
};
|
||||
|
||||
void
|
||||
S::bar (int x)
|
||||
{
|
||||
#pragma omp target map (this, x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp target map (this[0], x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp target update to (this, x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
#pragma omp target update to (this[0], x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
#pragma omp target update from (this, x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
#pragma omp target update from (this[1], x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
}
|
||||
|
||||
template <int N>
|
||||
struct T
|
||||
{
|
||||
void bar (int);
|
||||
};
|
||||
|
||||
template <int N>
|
||||
void
|
||||
T<N>::bar (int x)
|
||||
{
|
||||
#pragma omp target map (this, x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp target map (this[0], x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
;
|
||||
#pragma omp target update to (this, x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
#pragma omp target update to (this[0], x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
#pragma omp target update from (this, x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
#pragma omp target update from (this[1], x) // { dg-error ".this. allowed in OpenMP only in .declare simd. clauses" }
|
||||
}
|
||||
|
||||
template struct T<0>;
|
55
gcc/testsuite/g++.dg/vect/simd-clone-2.cc
Normal file
55
gcc/testsuite/g++.dg/vect/simd-clone-2.cc
Normal file
@ -0,0 +1,55 @@
|
||||
// { dg-require-effective-target vect_simd_clones }
|
||||
// { dg-additional-options "-fopenmp-simd -fno-inline -DONE_FILE" }
|
||||
// { dg-additional-options "-mavx" { target avx_runtime } }
|
||||
|
||||
#include "../../gcc.dg/vect/tree-vect.h"
|
||||
|
||||
#ifdef ONE_FILE
|
||||
#include "simd-clone-3.cc"
|
||||
#else
|
||||
#include "simd-clone-2.h"
|
||||
#endif
|
||||
|
||||
T b __attribute__((aligned (32)));
|
||||
|
||||
void
|
||||
do_main ()
|
||||
{
|
||||
int i, r = 0;
|
||||
S a[64];
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
a[i].s = i;
|
||||
b.t[i] = i;
|
||||
}
|
||||
#pragma omp simd reduction(+:r)
|
||||
for (i = 0; i < 64; i++)
|
||||
r += a[16].f0 (i);
|
||||
if (r != 64 * 63 / 2 + 64 * 16)
|
||||
__builtin_abort ();
|
||||
r = 0;
|
||||
#pragma omp simd reduction(+:r)
|
||||
for (i = 0; i < 64; i++)
|
||||
r += a[32].f1 (i);
|
||||
if (r != 64 * 63 / 2 + 64 * 32)
|
||||
__builtin_abort ();
|
||||
r = 0;
|
||||
#pragma omp simd reduction(+:r)
|
||||
for (i = 0; i < 64; i++)
|
||||
r += a[i].f2 (i);
|
||||
if (r != 64 * 63)
|
||||
__builtin_abort ();
|
||||
r = 0;
|
||||
#pragma omp simd reduction(+:r)
|
||||
for (i = 0; i < 64; i++)
|
||||
r += b.f3 (i);
|
||||
if (r != 64 * 63 / 2)
|
||||
__builtin_abort ();
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
check_vect ();
|
||||
do_main ();
|
||||
}
|
17
gcc/testsuite/g++.dg/vect/simd-clone-2.h
Normal file
17
gcc/testsuite/g++.dg/vect/simd-clone-2.h
Normal file
@ -0,0 +1,17 @@
|
||||
struct S
|
||||
{
|
||||
int s;
|
||||
#pragma omp declare simd notinbranch
|
||||
int f0 (int x);
|
||||
#pragma omp declare simd notinbranch uniform(this)
|
||||
int f1 (int x);
|
||||
#pragma omp declare simd notinbranch linear(this:sizeof(this)/sizeof(this))
|
||||
int f2 (int x);
|
||||
};
|
||||
|
||||
struct T
|
||||
{
|
||||
int t[64];
|
||||
#pragma omp declare simd aligned(this:32) uniform(this) linear(x)
|
||||
int f3 (int x);
|
||||
};
|
34
gcc/testsuite/g++.dg/vect/simd-clone-3.cc
Normal file
34
gcc/testsuite/g++.dg/vect/simd-clone-3.cc
Normal file
@ -0,0 +1,34 @@
|
||||
// { dg-require-effective-target vect_simd_clones }
|
||||
// { dg-additional-options "-fopenmp-simd -fno-inline" }
|
||||
// { dg-additional-options "-mavx" { target avx_runtime } }
|
||||
// { dg-additional-sources "simd-clone-2.cc" }
|
||||
|
||||
#include "simd-clone-2.h"
|
||||
|
||||
#pragma omp declare simd notinbranch
|
||||
int
|
||||
S::f0 (int x)
|
||||
{
|
||||
return x + s;
|
||||
}
|
||||
|
||||
#pragma omp declare simd notinbranch uniform(this)
|
||||
int
|
||||
S::f1 (int x)
|
||||
{
|
||||
return x + s;
|
||||
}
|
||||
|
||||
#pragma omp declare simd notinbranch linear(this:sizeof(this)/sizeof(this))
|
||||
int
|
||||
S::f2 (int x)
|
||||
{
|
||||
return x + this->S::s;
|
||||
}
|
||||
|
||||
#pragma omp declare simd uniform(this) aligned(this:32) linear(x)
|
||||
int
|
||||
T::f3 (int x)
|
||||
{
|
||||
return t[x];
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user