summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJulia Koval <julia.koval@intel.com>2017-11-28 11:35:37 +0100
committerJulia Koval <jkoval@gcc.gnu.org>2017-11-28 11:35:37 +0100
commit5e9d6aa4c2fd245837ec26de1d01ee8eb7786af3 (patch)
tree193e05dc5baa657f44264efe9cf165e8572a0ccc /gcc
parent1be49a38e45a80d1ee6854f262c94abeb621dfda (diff)
Remove Cilk Plus support.
* Makefile.def (target_modules): Remove libcilkrts. * Makefile.in: Ditto. * configure: Ditto. * configure.ac: Ditto. contrib/ * contrib/gcc_update: Ditto. gcc/ * Makefile.in (cilkplus.def, cilk-builtins.def, c-family/cilk.o, c-family/c-cilkplus.o, c-family/array-notation-common.o, cilk-common.o, cilk.h, cilk-common.c): Remove. * builtin-types.def (BT_FN_INT_PTR_PTR_PTR_FTYPE_BT_INT_BT_PTR_BT_PTR_BT_PTR): Remove. * builtins.c (is_builtin_name): Remove cilkplus condition. (BUILT_IN_CILK_DETACH, BUILT_IN_CILK_POP_FRAME): Remove. * builtins.def (DEF_CILK_BUILTIN_STUB, DEF_CILKPLUS_BUILTIN, cilk-builtins.def, cilkplus.def): Remove. * cif-code.def (CILK_SPAWN): Remove. * cilk-builtins.def: Delete. * cilk-common.c: Ditto. * cilk.h: Ditto. * cilkplus.def: Ditto. * config/darwin.h (fcilkplus): Delete. * cppbuiltin.c: Ditto. * doc/extend.texi: Remove cilkplus doc. * doc/generic.texi: Ditto. * doc/invoke.texi: Ditto. * doc/passes.texi: Ditto. * gcc.c (fcilkplus): Remove. * gengtype.c (cilk.h): Remove. * gimple-pretty-print.c (dump_gimple_omp_for): Remove cilkplus support. * gimple.h (GF_OMP_FOR_KIND_CILKFOR, GF_OMP_FOR_KIND_CILKSIMD): Remove. * gimplify.c (gimplify_return_expr, maybe_fold_stmt, gimplify_call_expr, is_gimple_stmt, gimplify_modify_expr, gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses, gimplify_omp_for, gimplify_expr): Remove cilkplus conditions. * ipa-fnsummary.c (ipa_dump_fn_summary, compute_fn_summary, inline_read_section): Ditto. * ipa-inline-analysis.c (cilk.h): Remove. * ira.c (ira_setup_eliminable_regset): Remove cilkplus support. * lto-wrapper.c (merge_and_complain, append_compiler_options, append_linker_options): Remove condition for fcilkplus. * lto/lto-lang.c (cilk.h): Remove. (lto_init): Remove condition for fcilkplus. * omp-expand.c (expand_cilk_for_call): Delete. (expand_omp_taskreg, expand_omp_for_static_chunk, expand_omp_for): Remove cilkplus conditions. (expand_cilk_for): Delete. * omp-general.c (omp_extract_for_data): Remove cilkplus support. * omp-low.c (scan_sharing_clauses, create_omp_child_function, execute_lower_omp, diagnose_sb_0): Ditto. * omp-simd-clone.c (simd_clone_clauses_extract): Ditto. * tree-core.h (OMP_CLAUSE__CILK_FOR_COUNT_): Delete. * tree-nested.c: Ditto. * tree-pretty-print.c (dump_omp_clause): Remove cilkplus support. (dump_generic_node): Ditto. * tree.c (OMP_CLAUSE__CILK_FOR_COUNT_): Delete. * tree.def (cilk_simd, cilk_for, cilk_spawn_stmt, cilk_sync_stmt): Delete. * tree.h (CILK_SPAWN_FN, EXPR_CILK_SPAWN): Delete. gcc/c-family/ * array-notation-common.c: Delete. * c-cilkplus.c: Ditto. * c-common.c (_Cilk_spawn, _Cilk_sync, _Cilk_for): Remove. * c-common.def (ARRAY_NOTATION_REF): Remove. * c-common.h (RID_CILK_SPAWN, build_array_notation_expr, build_array_notation_ref, C_ORT_CILK, c_check_cilk_loop, c_validate_cilk_plus_loop, cilkplus_an_parts, cilk_ignorable_spawn_rhs_op, cilk_recognize_spawn): Remove. * c-gimplify.c (CILK_SPAWN_STMT): Remove. * c-omp.c: Remove CILK_SIMD check. * c-pragma.c: Ditto. * c-pragma.h: Remove CILK related pragmas. * c-pretty-print.c (c_pretty_printer::postfix_expression): Remove ARRAY_NOTATION_REF condition. (c_pretty_printer::expression): Ditto. * c.opt (fcilkplus): Remove. * cilk.c: Delete. gcc/c/ * Make-lang.in (c/c-array-notation.o): Remove. * c-array-notation.c: Delete. * c-decl.c: Remove cilkplus condition. * c-parser.c (c_parser_cilk_simd, c_parser_cilk_for, c_parser_cilk_verify_simd, c_parser_array_notation, c_parser_cilk_clause_vectorlength, c_parser_cilk_grainsize, c_parser_cilk_simd_fn_vector_attrs, c_finish_cilk_simd_fn_tokens): Delete. (c_parser_declaration_or_fndef): Remove cilkplus condition. (c_parser_direct_declarator_inner): Ditto. (CILK_SIMD_FN_CLAUSE_MASK): Delete. (c_parser_attributes, c_parser_compound_statement, c_parser_statement_after_labels, c_parser_if_statement, c_parser_switch_statement, c_parser_while_statement, c_parser_do_statement, c_parser_for_statement, c_parser_unary_expression, c_parser_postfix_expression, c_parser_postfix_expression_after_primary, c_parser_pragma, c_parser_omp_clause_name, c_parser_omp_all_clauses, c_parser_omp_for_loop, c_finish_omp_declare_simd): Remove cilkplus support. * c-typeck.c (build_array_ref, build_function_call_vec, convert_arguments, lvalue_p, build_compound_expr, c_finish_return, c_finish_if_stmt, c_finish_loop, build_binary_op): Remove cilkplus support. gcc/cp/ * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete. * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus. * constexpr.c (potential_constant_expression_1): Ditto. * cp-array-notation.c: Delete. * cp-cilkplus.c: Ditto. * cp-cilkplus.h: Ditto. * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove cilkplus condition. * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete. * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete. * decl.c (grokfndecl, finish_function): Remove cilkplus condition. * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition. * lambda.c (cp-cilkplus.h): Remove. * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for, cp_parser_cilk_simd_vectorlength): Delete. (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body, cp_parser_postfix_expression, cp_parser_postfix_open_square_expression, cp_parser_statement, cp_parser_jump_statement, cp_parser_direct_declarator, cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list, cp_parser_omp_clause_name, cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear, cp_parser_omp_all_clauses, cp_parser_omp_flush, cp_parser_omp_for_cond, cp_parser_omp_for_incr, cp_parser_omp_for_loop_init, cp_parser_omp_for_loop, cp_parser_omp_declare_simd): Remove cilkplus support. (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info, cp_parser_cilk_grainsize): Remove. (cp_parser_pragma, c_parse_file): Remove cilkplus support. (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear, cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses, cp_parser_cilk_simd, cp_parser_cilk_for): Remove. * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove. * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove cilkplus support. * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body, finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr, finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove cilkplus support. * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon. * typeck.c (cp_build_array_ref, cp_build_compound_expr, check_return_expr): Remove cilkplus support. gcc/testsuite/ * c-c++-common/attr-simd-3.c: Delete. * c-c++-common/cilk-plus/AN/an-if.c: Delete. * c-c++-common/cilk-plus/AN/array_test1.c: Delete. * c-c++-common/cilk-plus/AN/array_test2.c: Delete. * c-c++-common/cilk-plus/AN/array_test_ND.c: Delete. * c-c++-common/cilk-plus/AN/builtin_fn_custom.c: Delete. * c-c++-common/cilk-plus/AN/builtin_fn_mutating.c: Delete. * c-c++-common/cilk-plus/AN/builtin_func_double.c: Delete. * c-c++-common/cilk-plus/AN/builtin_func_double2.c: Delete. * c-c++-common/cilk-plus/AN/comma_exp.c: Delete. * c-c++-common/cilk-plus/AN/conditional.c: Delete. * c-c++-common/cilk-plus/AN/decl-ptr-colon.c: Delete. * c-c++-common/cilk-plus/AN/dimensionless-arrays.c: Delete. * c-c++-common/cilk-plus/AN/exec-once.c: Delete. * c-c++-common/cilk-plus/AN/exec-once2.c: Delete. * c-c++-common/cilk-plus/AN/fn_ptr-2.c: Delete. * c-c++-common/cilk-plus/AN/fn_ptr.c: Delete. * c-c++-common/cilk-plus/AN/fp_triplet_values.c: Delete. * c-c++-common/cilk-plus/AN/gather-scatter-errors.c: Delete. * c-c++-common/cilk-plus/AN/gather_scatter.c: Delete. * c-c++-common/cilk-plus/AN/if_test.c: Delete. * c-c++-common/cilk-plus/AN/if_test_errors.c: Delete. * c-c++-common/cilk-plus/AN/misc.c: Delete. * c-c++-common/cilk-plus/AN/n-ptr-test.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors2.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors3.c: Delete. * c-c++-common/cilk-plus/AN/parser_errors4.c: Delete. * c-c++-common/cilk-plus/AN/pr57457-2.c: Delete. * c-c++-common/cilk-plus/AN/pr57457.c: Delete. * c-c++-common/cilk-plus/AN/pr57490.c: Delete. * c-c++-common/cilk-plus/AN/pr57541-2.c: Delete. * c-c++-common/cilk-plus/AN/pr57541.c: Delete. * c-c++-common/cilk-plus/AN/pr57577.c: Delete. * c-c++-common/cilk-plus/AN/pr58942.c: Delete. * c-c++-common/cilk-plus/AN/pr61191.c: Delete. * c-c++-common/cilk-plus/AN/pr61455-2.c: Delete. * c-c++-common/cilk-plus/AN/pr61455.c: Delete. * c-c++-common/cilk-plus/AN/pr61962.c: Delete. * c-c++-common/cilk-plus/AN/pr61963.c: Delete. * c-c++-common/cilk-plus/AN/pr62008.c: Delete. * c-c++-common/cilk-plus/AN/pr63884.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch2.c: Delete. * c-c++-common/cilk-plus/AN/rank_mismatch3.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit2.c: Delete. * c-c++-common/cilk-plus/AN/sec_implicit_ex.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c: Delete. * c-c++-common/cilk-plus/AN/sec_reduce_return.c: Delete. * c-c++-common/cilk-plus/AN/side-effects-1.c: Delete. * c-c++-common/cilk-plus/AN/test_builtin_return.c: Delete. * c-c++-common/cilk-plus/AN/test_sec_limits.c: Delete. * c-c++-common/cilk-plus/AN/tst_lngth.c: Delete. * c-c++-common/cilk-plus/AN/vla.c: Delete. * c-c++-common/cilk-plus/CK/Wparentheses-1.c: Delete. * c-c++-common/cilk-plus/CK/cilk-for-2.c: Delete. * c-c++-common/cilk-plus/CK/cilk-for-3.c: Delete. * c-c++-common/cilk-plus/CK/cilk-fors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_errors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_grain.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c: Delete. * c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c: Delete. * c-c++-common/cilk-plus/CK/compound_cilk_spawn.c: Delete. * c-c++-common/cilk-plus/CK/concec_cilk_spawn.c: Delete. * c-c++-common/cilk-plus/CK/errors.c: Delete. * c-c++-common/cilk-plus/CK/fib.c: Delete. * c-c++-common/cilk-plus/CK/fib_init_expr_xy.c: Delete. * c-c++-common/cilk-plus/CK/fib_no_return.c: Delete. * c-c++-common/cilk-plus/CK/fib_no_sync.c: Delete. * c-c++-common/cilk-plus/CK/invalid_spawns.c: Delete. * c-c++-common/cilk-plus/CK/invalid_sync.c: Delete.c * c-c++-common/cilk-plus/CK/nested_cilk_for.c: Delete. * c-c++-common/cilk-plus/CK/no_args_error.c: Delete. * c-c++-common/cilk-plus/CK/pr59631.c: Delete. * c-c++-common/cilk-plus/CK/pr60197-2.c: Delete. * c-c++-common/cilk-plus/CK/pr60197.c: Delete. * c-c++-common/cilk-plus/CK/pr60469.c: Delete. * c-c++-common/cilk-plus/CK/pr60586.c: Delete. * c-c++-common/cilk-plus/CK/pr63307.c: Delete. * c-c++-common/cilk-plus/CK/pr69826-1.c: Delete. * c-c++-common/cilk-plus/CK/pr69826-2.c: Delete. * c-c++-common/cilk-plus/CK/pr79428-4.c: Delete. * c-c++-common/cilk-plus/CK/pr79428-7.c: Delete. * c-c++-common/cilk-plus/CK/spawn_in_return.c: Delete. * c-c++-common/cilk-plus/CK/spawnee_inline.c: Delete. * c-c++-common/cilk-plus/CK/spawner_inline.c: Delete. * c-c++-common/cilk-plus/CK/spawning_arg.c: Delete. * c-c++-common/cilk-plus/CK/steal_check.c: Delete. * c-c++-common/cilk-plus/CK/sync_wo_spawn.c: Delete. * c-c++-common/cilk-plus/CK/test__cilk.c: Delete. * c-c++-common/cilk-plus/CK/varargs_test.c: Delete. * c-c++-common/cilk-plus/PS/Wparentheses-1.c: Delete. * c-c++-common/cilk-plus/PS/body.c: Delete. * c-c++-common/cilk-plus/PS/clauses1.c: Delete. * c-c++-common/cilk-plus/PS/clauses2.c: Delete. * c-c++-common/cilk-plus/PS/clauses3.c: Delete. * c-c++-common/cilk-plus/PS/clauses4.c: Delete. * c-c++-common/cilk-plus/PS/for1.c: Delete. * c-c++-common/cilk-plus/PS/for2.c: Delete. * c-c++-common/cilk-plus/PS/for3.c: Delete. * c-c++-common/cilk-plus/PS/pr69363.c: Delete. * c-c++-common/cilk-plus/PS/reduction-1.c: Delete. * c-c++-common/cilk-plus/PS/reduction-2.c: Delete. * c-c++-common/cilk-plus/PS/reduction-3.c: Delete. * c-c++-common/cilk-plus/PS/run-1.c: Delete. * c-c++-common/cilk-plus/PS/safelen.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength-2.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength-3.c: Delete. * c-c++-common/cilk-plus/PS/vectorlength.c: Delete. * c-c++-common/cilk-plus/SE/ef_error.c: Delete. * c-c++-common/cilk-plus/SE/ef_error2.c: Delete. * c-c++-common/cilk-plus/SE/ef_error3.c: Delete. * c-c++-common/cilk-plus/SE/ef_test.c: Delete. * c-c++-common/cilk-plus/SE/ef_test2.c: Delete. * c-c++-common/cilk-plus/SE/vlength_errors.c: Delete. * g++.dg/cilk-plus/AN/array_function.c: Delete. * g++.dg/cilk-plus/AN/array_test1_tplt.c: Delete. * g++.dg/cilk-plus/AN/array_test2_tplt.c: Delete. * g++.dg/cilk-plus/AN/array_test_ND_tplt.c: Delete. * g++.dg/cilk-plus/AN/braced_list.c: Delete. * g++.dg/cilk-plus/AN/builtin_fn_custom_tplt.c: Delete. * g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.c: Delete. * g++.dg/cilk-plus/AN/fp_triplet_values_tplt.c: Delete. * g++.dg/cilk-plus/AN/postincr_test.c: Delete. * g++.dg/cilk-plus/AN/preincr_test.c: Delete. * g++.dg/cilk-plus/CK/catch_exc.c: Delete. * g++.dg/cilk-plus/CK/cf3.c: Delete. * g++.dg/cilk-plus/CK/cilk-for-tplt.c: Delete. * g++.dg/cilk-plus/CK/const_spawn.c: Delete. * g++.dg/cilk-plus/CK/fib-opr-overload.c: Delete. * g++.dg/cilk-plus/CK/fib-tplt.c: Delete. * g++.dg/cilk-plus/CK/for1.c: Delete. * g++.dg/cilk-plus/CK/lambda_spawns.c: Delete. * g++.dg/cilk-plus/CK/lambda_spawns_tplt.c: Delete. * g++.dg/cilk-plus/CK/pr60586.c: Delete. * g++.dg/cilk-plus/CK/pr66326.c: Delete. * g++.dg/cilk-plus/CK/pr68001.c: Delete. * g++.dg/cilk-plus/CK/pr68997.c: Delete. * g++.dg/cilk-plus/CK/pr69024.c: Delete. * g++.dg/cilk-plus/CK/pr69048.c: Delete. * g++.dg/cilk-plus/CK/pr69267.c: Delete. * g++.dg/cilk-plus/CK/pr80038.c: Delete. * g++.dg/cilk-plus/CK/stl_iter.c: Delete. * g++.dg/cilk-plus/CK/stl_rev_iter.c: Delete. * g++.dg/cilk-plus/CK/stl_test.c: Delete. * g++.dg/cilk-plus/cilk-plus.exp * g++.dg/cilk-plus/ef_test.C: Delete. * g++.dg/cilk-plus/for.C: Delete. * g++.dg/cilk-plus/for2.C: Delete. * g++.dg/cilk-plus/for3.C: Delete. * g++.dg/cilk-plus/for4.C: Delete. * g++.dg/cilk-plus/pr60967.C: Delete. * g++.dg/cilk-plus/pr69028.C: Delete. * g++.dg/cilk-plus/pr70565.C: Delete. * g++.dg/pr57662.C: Delete. * gcc.dg/cilk-plus/cilk-plus.exp * gcc.dg/cilk-plus/for1.c: Delete. * gcc.dg/cilk-plus/for2.c: Delete. * gcc.dg/cilk-plus/jump-openmp.c: Delete. * gcc.dg/cilk-plus/jump.c: Delete. * gcc.dg/cilk-plus/pr69798-1.c: Delete. * gcc.dg/cilk-plus/pr69798-2.c: Delete. * gcc.dg/cilk-plus/pr78306.c: Delete. * gcc.dg/cilk-plus/pr79116.c: Delete. * gcc.dg/graphite/id-28.c: Delete. * lib/cilk-plus-dg.exp: Delete. * lib/target-supports.exp (cilkplus_runtime): Delete. Co-Authored-By: Sebastian Peryt <sebastian.peryt@intel.com> From-SVN: r255195
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog60
-rw-r--r--gcc/Makefile.in12
-rw-r--r--gcc/builtin-types.def2
-rw-r--r--gcc/builtins.c13
-rw-r--r--gcc/builtins.def19
-rw-r--r--gcc/c-family/ChangeLog22
-rw-r--r--gcc/c-family/array-notation-common.c689
-rw-r--r--gcc/c-family/c-cilkplus.c175
-rw-r--r--gcc/c-family/c-common.c7
-rw-r--r--gcc/c-family/c-common.def7
-rw-r--r--gcc/c-family/c-common.h94
-rw-r--r--gcc/c-family/c-gimplify.c20
-rw-r--r--gcc/c-family/c-omp.c9
-rw-r--r--gcc/c-family/c-pragma.c22
-rw-r--r--gcc/c-family/c-pragma.h20
-rw-r--r--gcc/c-family/c-pretty-print.c12
-rw-r--r--gcc/c-family/c.opt4
-rw-r--r--gcc/c-family/cilk.c1363
-rw-r--r--gcc/c/ChangeLog28
-rw-r--r--gcc/c/Make-lang.in2
-rw-r--r--gcc/c/c-array-notation.c1407
-rw-r--r--gcc/c/c-decl.c7
-rw-r--r--gcc/c/c-parser.c992
-rw-r--r--gcc/c/c-typeck.c156
-rw-r--r--gcc/cif-code.def4
-rw-r--r--gcc/cilk-builtins.def35
-rw-r--r--gcc/cilk-common.c571
-rw-r--r--gcc/cilk.h109
-rw-r--r--gcc/cilkplus.def59
-rw-r--r--gcc/config/darwin.h1
-rw-r--r--gcc/cp/ChangeLog49
-rw-r--r--gcc/cp/Make-lang.in2
-rw-r--r--gcc/cp/call.c35
-rw-r--r--gcc/cp/constexpr.c7
-rw-r--r--gcc/cp/cp-array-notation.c1470
-rw-r--r--gcc/cp/cp-cilkplus.c240
-rw-r--r--gcc/cp/cp-cilkplus.h28
-rw-r--r--gcc/cp/cp-gimplify.c35
-rw-r--r--gcc/cp/cp-objcp-common.c1
-rw-r--r--gcc/cp/cp-tree.h5
-rw-r--r--gcc/cp/decl.c6
-rw-r--r--gcc/cp/error.c22
-rw-r--r--gcc/cp/lambda.c1
-rw-r--r--gcc/cp/parser.c819
-rw-r--r--gcc/cp/parser.h2
-rw-r--r--gcc/cp/pt.c26
-rw-r--r--gcc/cp/semantics.c188
-rw-r--r--gcc/cp/tree.c1
-rw-r--r--gcc/cp/typeck.c34
-rw-r--r--gcc/cppbuiltin.c2
-rw-r--r--gcc/doc/extend.texi30
-rw-r--r--gcc/doc/generic.texi24
-rw-r--r--gcc/doc/invoke.texi12
-rw-r--r--gcc/doc/passes.texi63
-rw-r--r--gcc/doc/sourcebuild.texi3
-rw-r--r--gcc/gcc.c9
-rw-r--r--gcc/gengtype.c2
-rw-r--r--gcc/gimple-pretty-print.c25
-rw-r--r--gcc/gimple.h2
-rw-r--r--gcc/gimplify.c54
-rw-r--r--gcc/ipa-fnsummary.c8
-rw-r--r--gcc/ipa-fnsummary.h5
-rw-r--r--gcc/ipa-inline-analysis.c1
-rw-r--r--gcc/ira.c3
-rw-r--r--gcc/lto-wrapper.c4
-rw-r--r--gcc/lto/lto-lang.c4
-rw-r--r--gcc/omp-expand.c250
-rw-r--r--gcc/omp-general.c6
-rw-r--r--gcc/omp-low.c90
-rw-r--r--gcc/omp-simd-clone.c10
-rw-r--r--gcc/testsuite/ChangeLog173
-rw-r--r--gcc/testsuite/c-c++-common/attr-simd-3.c5
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/an-if.c51
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c84
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c128
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c102
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c70
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c70
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c124
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c77
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c55
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c44
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/decl-ptr-colon.c19
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/dimensionless-arrays.c10
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c44
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c87
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr-2.c14
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c21
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c28
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c19
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c60
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c306
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/if_test_errors.c56
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c112
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/n-ptr-test.c48
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c11
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c13
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c13
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c11
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457-2.c15
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457.c39
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr57490.c28
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541-2.c15
-rwxr-xr-xgcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c21
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr57577.c12
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr58942.c8
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c11
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455-2.c13
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455.c9
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c14
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c9
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr62008.c10
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/pr63884.c10
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c18
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c27
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch3.c19
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c11
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c11
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c29
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c21
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c17
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c29
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/side-effects-1.c26
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c73
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/test_sec_limits.c18
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/tst_lngth.c19
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c20
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/Wparentheses-1.c69
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-for-2.c393
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-for-3.c19
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-fors.c87
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_errors.c53
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain.c35
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c48
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c35
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/compound_cilk_spawn.c26
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/concec_cilk_spawn.c20
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/errors.c56
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/fib.c54
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/fib_init_expr_xy.c68
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/fib_no_return.c73
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/fib_no_sync.c67
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c14
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_sync.cc9
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/nested_cilk_for.c79
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/no_args_error.c11
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr59631.c15
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197-2.c35
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c66
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr60469.c18
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr60586.c28
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr63307.c4
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr69826-1.c25
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr69826-2.c6
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-4.c3
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-7.c3
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/spawn_in_return.c8
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/spawnee_inline.c80
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/spawner_inline.c67
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c52
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c54
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/sync_wo_spawn.c9
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/test__cilk.c10
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/CK/varargs_test.c47
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/Wparentheses-1.c41
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/body.c34
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/clauses1.c80
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/clauses2.c17
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/clauses3.c39
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/clauses4.c36
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/for1.c132
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/for2.c8
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/for3.c14
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/pr69363.c13
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-1.c38
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-2.c36
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-3.c41
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/run-1.c28
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/safelen.c13
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-2.c12
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-3.c13
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength.c21
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error.c32
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error2.c15
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error3.c13
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/SE/ef_test.c78
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/SE/ef_test2.c16
-rw-r--r--gcc/testsuite/c-c++-common/cilk-plus/SE/vlength_errors.c59
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/AN/array_function.cc8
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/AN/array_test1_tplt.cc118
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/AN/array_test2_tplt.cc141
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/AN/array_test_ND_tplt.cc115
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/AN/braced_list.cc13
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/AN/builtin_fn_custom_tplt.cc126
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.cc136
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/AN/fp_triplet_values_tplt.c36
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/AN/postincr_test.cc107
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/AN/preincr_test.cc106
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc81
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/cf3.cc96
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/cilk-for-tplt.cc25
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/const_spawn.cc78
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/fib-opr-overload.cc94
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/fib-tplt.cc53
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/for1.cc376
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/lambda_spawns.cc238
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/lambda_spawns_tplt.cc174
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/pr60586.cc89
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/pr66326.cc32
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/pr68001.cc18
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/pr68997.cc68
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/pr69024.cc38
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/pr69048.cc14
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/pr69267.cc10
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/pr80038.cc47
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/stl_iter.cc50
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/stl_rev_iter.cc68
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/CK/stl_test.cc50
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/cilk-plus.exp71
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/ef_test.C37
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/for.C26
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/for2.C43
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/for3.C18
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/for4.C22
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/pr60967.C9
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/pr69028.C13
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/pr70565.C9
-rw-r--r--gcc/testsuite/g++.dg/pr57662.C3
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp63
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/for1.c12
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/for2.c11
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c49
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/jump.c27
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/pr69798-1.c73
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/pr69798-2.c72
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/pr78306.c30
-rw-r--r--gcc/testsuite/gcc.dg/cilk-plus/pr79116.c9
-rw-r--r--gcc/testsuite/gcc.dg/graphite/id-28.c73
-rw-r--r--gcc/testsuite/lib/cilk-plus-dg.exp105
-rw-r--r--gcc/testsuite/lib/target-supports.exp37
-rw-r--r--gcc/tree-core.h9
-rw-r--r--gcc/tree-nested.c2
-rw-r--r--gcc/tree-pretty-print.c46
-rw-r--r--gcc/tree.c3
-rw-r--r--gcc/tree.def15
-rw-r--r--gcc/tree.h9
246 files changed, 451 insertions, 17531 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 641dc072afd..a86c833d4bb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,63 @@
+2017-11-28 Julia Koval <julia.koval@intel.com>
+ Sebastian Peryt <sebastian.peryt@intel.com>
+
+ * Makefile.in (cilkplus.def, cilk-builtins.def, c-family/cilk.o,
+ c-family/c-cilkplus.o, c-family/array-notation-common.o,
+ cilk-common.o, cilk.h, cilk-common.c): Remove.
+ * builtin-types.def
+ (BT_FN_INT_PTR_PTR_PTR_FTYPE_BT_INT_BT_PTR_BT_PTR_BT_PTR): Remove.
+ * builtins.c (is_builtin_name): Remove cilkplus condition.
+ (BUILT_IN_CILK_DETACH, BUILT_IN_CILK_POP_FRAME): Remove.
+ * builtins.def (DEF_CILK_BUILTIN_STUB, DEF_CILKPLUS_BUILTIN,
+ cilk-builtins.def, cilkplus.def): Remove.
+ * cif-code.def (CILK_SPAWN): Remove.
+ * cilk-builtins.def: Delete.
+ * cilk-common.c: Ditto.
+ * cilk.h: Ditto.
+ * cilkplus.def: Ditto.
+ * config/darwin.h (fcilkplus): Delete.
+ * cppbuiltin.c: Ditto.
+ * doc/extend.texi: Remove cilkplus doc.
+ * doc/generic.texi: Ditto.
+ * doc/invoke.texi: Ditto.
+ * doc/passes.texi: Ditto.
+ * gcc.c (fcilkplus): Remove.
+ * gengtype.c (cilk.h): Remove.
+ * gimple-pretty-print.c (dump_gimple_omp_for): Remove cilkplus
+ support.
+ * gimple.h (GF_OMP_FOR_KIND_CILKFOR, GF_OMP_FOR_KIND_CILKSIMD):
+ Remove.
+ * gimplify.c (gimplify_return_expr, maybe_fold_stmt,
+ gimplify_call_expr,
+ is_gimple_stmt, gimplify_modify_expr, gimplify_scan_omp_clauses,
+ gimplify_adjust_omp_clauses, gimplify_omp_for, gimplify_expr): Remove
+ cilkplus conditions.
+ * ipa-fnsummary.c (ipa_dump_fn_summary, compute_fn_summary,
+ inline_read_section): Ditto.
+ * ipa-inline-analysis.c (cilk.h): Remove.
+ * ira.c (ira_setup_eliminable_regset): Remove cilkplus support.
+ * lto-wrapper.c (merge_and_complain, append_compiler_options,
+ append_linker_options): Remove condition for fcilkplus.
+ * lto/lto-lang.c (cilk.h): Remove.
+ (lto_init): Remove condition for fcilkplus.
+ * omp-expand.c (expand_cilk_for_call): Delete.
+ (expand_omp_taskreg, expand_omp_for_static_chunk,
+ expand_omp_for): Remove cilkplus
+ conditions.
+ (expand_cilk_for): Delete.
+ * omp-general.c (omp_extract_for_data): Remove cilkplus support.
+ * omp-low.c (scan_sharing_clauses, create_omp_child_function,
+ execute_lower_omp, diagnose_sb_0): Ditto.
+ * omp-simd-clone.c (simd_clone_clauses_extract): Ditto.
+ * tree-core.h (OMP_CLAUSE__CILK_FOR_COUNT_): Delete.
+ * tree-nested.c: Ditto.
+ * tree-pretty-print.c (dump_omp_clause): Remove cilkplus support.
+ (dump_generic_node): Ditto.
+ * tree.c (OMP_CLAUSE__CILK_FOR_COUNT_): Delete.
+ * tree.def (cilk_simd, cilk_for, cilk_spawn_stmt, cilk_sync_stmt):
+ Delete.
+ * tree.h (CILK_SPAWN_FN, EXPR_CILK_SPAWN): Delete.
+
2017-11-28 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* config/aarch64/aarch64.md (div<mode>3): Change check to TARGET_FLOAT.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index c428eaab023..f821b00d742 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -923,7 +923,7 @@ RTL_H = $(RTL_BASE_H) $(FLAGS_H) genrtl.h
READ_MD_H = $(OBSTACK_H) $(HASHTAB_H) read-md.h
PARAMS_H = params.h params-enum.h params.def
BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def \
- gtm-builtins.def sanitizer.def cilkplus.def cilk-builtins.def \
+ gtm-builtins.def sanitizer.def \
hsa-builtins.def
INTERNAL_FN_DEF = internal-fn.def
INTERNAL_FN_H = internal-fn.h $(INTERNAL_FN_DEF)
@@ -1195,9 +1195,8 @@ C_COMMON_OBJS = c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o \
c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o \
c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o \
c-family/c-semantics.o c-family/c-ada-spec.o \
- c-family/c-cilkplus.o \
- c-family/array-notation-common.o c-family/cilk.o c-family/c-ubsan.o \
- c-family/c-attribs.o c-family/c-warn.o c-family/known-headers.o
+ c-family/c-ubsan.o c-family/known-headers.o \
+ c-family/c-attribs.o c-family/c-warn.o
# Language-independent object files.
# We put the *-match.o and insn-*.o files first so that a parallel make
@@ -1246,7 +1245,6 @@ OBJS = \
cgraphbuild.o \
cgraphunit.o \
cgraphclones.o \
- cilk-common.o \
combine.o \
combine-stack-adj.o \
compare-elim.o \
@@ -2508,8 +2506,8 @@ s-match: build/genmatch$(build_exeext) $(srcdir)/match.pd cfn-operators.pd
GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(host_xm_file_list) \
$(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
- $(srcdir)/wide-int.h $(srcdir)/alias.h $(srcdir)/cilk.h \
- $(srcdir)/cilk-common.c $(srcdir)/coverage.c $(srcdir)/rtl.h \
+ $(srcdir)/wide-int.h $(srcdir)/alias.h \
+ $(srcdir)/coverage.c $(srcdir)/rtl.h \
$(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/tree-core.h \
$(srcdir)/libfuncs.h $(SYMTAB_H) \
$(srcdir)/real.h $(srcdir)/function.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def
index 877f2aef424..bb50e604e19 100644
--- a/gcc/builtin-types.def
+++ b/gcc/builtin-types.def
@@ -520,8 +520,6 @@ DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG,
BT_INT, BT_CONST_STRING, BT_CONST_STRING, BT_VALIST_ARG)
DEF_FUNCTION_TYPE_3 (BT_FN_INT_FILEPTR_CONST_STRING_VALIST_ARG,
BT_INT, BT_FILEPTR, BT_CONST_STRING, BT_VALIST_ARG)
-DEF_FUNCTION_TYPE_3 (BT_FN_INT_PTR_PTR_PTR,
- BT_INT, BT_PTR, BT_PTR, BT_PTR)
DEF_FUNCTION_TYPE_3 (BT_FN_INT_INT_UINT_UINT,
BT_INT, BT_INT, BT_UINT, BT_UINT)
DEF_FUNCTION_TYPE_3 (BT_FN_UINT_UINT_UINT_UINT,
diff --git a/gcc/builtins.c b/gcc/builtins.c
index b9744592017..afc975e6dee 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -63,7 +63,6 @@ along with GCC; see the file COPYING3. If not see
#include "stringpool.h"
#include "attribs.h"
#include "asan.h"
-#include "cilk.h"
#include "tree-chkp.h"
#include "rtl-chkp.h"
#include "internal-fn.h"
@@ -203,10 +202,6 @@ is_builtin_name (const char *name)
return true;
if (strncmp (name, "__atomic_", 9) == 0)
return true;
- if (flag_cilkplus
- && (!strcmp (name, "__cilkrts_detach")
- || !strcmp (name, "__cilkrts_pop_frame")))
- return true;
return false;
}
@@ -7626,14 +7621,6 @@ expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode,
expand_builtin_set_thread_pointer (exp);
return const0_rtx;
- case BUILT_IN_CILK_DETACH:
- expand_builtin_cilk_detach (exp);
- return const0_rtx;
-
- case BUILT_IN_CILK_POP_FRAME:
- expand_builtin_cilk_pop_frame (exp);
- return const0_rtx;
-
case BUILT_IN_CHKP_INIT_PTR_BOUNDS:
case BUILT_IN_CHKP_NULL_PTR_BOUNDS:
case BUILT_IN_CHKP_COPY_PTR_BOUNDS:
diff --git a/gcc/builtins.def b/gcc/builtins.def
index 26118f1766b..3fdd2dc222c 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -221,7 +221,6 @@ along with GCC; see the file COPYING3. If not see
(flag_openacc \
|| flag_openmp \
|| flag_tree_parallelize_loops > 1 \
- || flag_cilkplus \
|| flag_offload_abi != OFFLOAD_ABI_UNSET))
#undef DEF_HSA_BUILTIN
@@ -237,13 +236,6 @@ along with GCC; see the file COPYING3. If not see
(false))
#endif
-/* Builtin used by implementation of Cilk Plus. Most of these are decomposed
- by the compiler but a few are implemented in libcilkrts. */
-#undef DEF_CILK_BUILTIN_STUB
-#define DEF_CILK_BUILTIN_STUB(ENUM, NAME) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, BT_LAST, BT_LAST, false, false, \
- false, ATTR_LAST, false, false)
-
/* Builtin used by the implementation of GNU TM. These
functions are mapped to the actual implementation of the STM library. */
#undef DEF_TM_BUILTIN
@@ -263,11 +255,6 @@ along with GCC; see the file COPYING3. If not see
| SANITIZE_UNDEFINED_NONDEFAULT) \
|| flag_sanitize_coverage))
-#undef DEF_CILKPLUS_BUILTIN
-#define DEF_CILKPLUS_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
- DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, BT_FN_INT_VAR, BT_LAST, \
- false, false, false, ATTRS, false, flag_cilkplus)
-
/* Builtin used by the implementation of Pointer Bounds Checker. */
#undef DEF_CHKP_BUILTIN
#define DEF_CHKP_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
@@ -1033,18 +1020,12 @@ DEF_GCC_BUILTIN (BUILT_IN_LINE, "LINE", BT_FN_INT, ATTR_NOTHROW_LEAF_LIST)
/* Heterogeneous Systems Architecture. */
#include "hsa-builtins.def"
-/* Cilk keywords builtins. */
-#include "cilk-builtins.def"
-
/* GTM builtins. */
#include "gtm-builtins.def"
/* Sanitizer builtins. */
#include "sanitizer.def"
-/* Cilk Plus builtins. */
-#include "cilkplus.def"
-
/* Pointer Bounds Checker builtins. */
#include "chkp-builtins.def"
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 08d8cec9443..ce966bbaa4c 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,25 @@
+2017-11-28 Julia Koval <julia.koval@intel.com>
+ Sebastian Peryt <sebastian.peryt@intel.com>
+
+ * array-notation-common.c: Delete.
+ * c-cilkplus.c: Ditto.
+ * c-common.c (_Cilk_spawn, _Cilk_sync, _Cilk_for): Remove.
+ * c-common.def (ARRAY_NOTATION_REF): Remove.
+ * c-common.h (RID_CILK_SPAWN, build_array_notation_expr,
+ build_array_notation_ref, C_ORT_CILK, c_check_cilk_loop,
+ c_validate_cilk_plus_loop, cilkplus_an_parts,
+ cilk_ignorable_spawn_rhs_op,
+ cilk_recognize_spawn): Remove.
+ * c-gimplify.c (CILK_SPAWN_STMT): Remove.
+ * c-omp.c: Remove CILK_SIMD check.
+ * c-pragma.c: Ditto.
+ * c-pragma.h: Remove CILK related pragmas.
+ * c-pretty-print.c (c_pretty_printer::postfix_expression): Remove
+ ARRAY_NOTATION_REF condition.
+ (c_pretty_printer::expression): Ditto.
+ * c.opt (fcilkplus): Remove.
+ * cilk.c: Delete.
+
2017-11-21 Marc Glisse <marc.glisse@inria.fr>
* c-pretty-print.c (pp_c_additive_expression,
diff --git a/gcc/c-family/array-notation-common.c b/gcc/c-family/array-notation-common.c
deleted file mode 100644
index a4809948e20..00000000000
--- a/gcc/c-family/array-notation-common.c
+++ /dev/null
@@ -1,689 +0,0 @@
-/* This file is part of the Intel(R) Cilk(TM) Plus support
- This file contains the builtin functions for Array
- notations.
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
- Contributed by Balaji V. Iyer <balaji.v.iyer@intel.com>,
- Intel Corporation
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "options.h"
-#include "c-family/c-common.h"
-#include "tree-iterator.h"
-#include "stringpool.h"
-#include "attribs.h"
-
-/* Returns true if the function call in FNDECL is __sec_implicit_index. */
-
-bool
-is_sec_implicit_index_fn (tree fndecl)
-{
- if (!fndecl)
- return false;
-
- if (TREE_CODE (fndecl) == ADDR_EXPR)
- fndecl = TREE_OPERAND (fndecl, 0);
-
- return
- (TREE_CODE (fndecl) == FUNCTION_DECL
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CILKPLUS_SEC_IMPLICIT_INDEX);
-}
-
-/* Returns the first and only argument for FN, which should be a
- sec_implicit_index function. FN's location in the source file is as
- indicated by LOCATION. The argument to FN must be a constant integer
- expression, otherwise returns -1. */
-
-HOST_WIDE_INT
-extract_sec_implicit_index_arg (location_t location, tree fn)
-{
- tree fn_arg;
- HOST_WIDE_INT return_int = 0;
-
- if (TREE_CODE (fn) == CALL_EXPR)
- {
- fn_arg = CALL_EXPR_ARG (fn, 0);
- if (TREE_CODE (fn_arg) == INTEGER_CST)
- return_int = int_cst_value (fn_arg);
- else
- {
- /* If the location is unknown, and if fn has a location, then use that
- information so that the user has a better idea where the error
- could be. */
- if (location == UNKNOWN_LOCATION && EXPR_HAS_LOCATION (fn))
- location = EXPR_LOCATION (fn);
- error_at (location, "__sec_implicit_index parameter must be an "
- "integer constant expression");
- return -1;
- }
- }
- return return_int;
-}
-
-/* Returns true if there is a length mismatch among exprssions that are at the
- same dimension and one the same side of the equal sign. The Array notation
- lengths (LIST->LENGTH) is passed in as a 2D vector of trees. */
-
-bool
-length_mismatch_in_expr_p (location_t loc, vec<vec<an_parts> >list)
-{
- size_t ii, jj;
- tree length = NULL_TREE;
-
- size_t x = list.length ();
- size_t y = list[0].length ();
-
- for (jj = 0; jj < y; jj++)
- {
- length = NULL_TREE;
- for (ii = 0; ii < x; ii++)
- {
- if (!length)
- length = list[ii][jj].length;
- else if (TREE_CODE (length) == INTEGER_CST)
- {
- /* If length is a INTEGER, and list[ii][jj] is an integer then
- check if they are equal. If they are not equal then return
- true. */
- if (TREE_CODE (list[ii][jj].length) == INTEGER_CST
- && !tree_int_cst_equal (list[ii][jj].length, length))
- {
- error_at (loc, "length mismatch in expression");
- return true;
- }
- }
- else
- /* We set the length node as the current node just in case it turns
- out to be an integer. */
- length = list[ii][jj].length;
- }
- }
- return false;
-}
-
-/* Given an FNDECL of type FUNCTION_DECL or ADDR_EXPR, return the corresponding
- BUILT_IN_CILKPLUS_SEC_REDUCE_* being called. If none, return
- BUILT_IN_NONE. */
-
-enum built_in_function
-is_cilkplus_reduce_builtin (tree fndecl)
-{
- if (!fndecl)
- return BUILT_IN_NONE;
- if (TREE_CODE (fndecl) == ADDR_EXPR)
- fndecl = TREE_OPERAND (fndecl, 0);
-
- if (TREE_CODE (fndecl) == FUNCTION_DECL
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
- switch (DECL_FUNCTION_CODE (fndecl))
- {
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUL:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING:
- return DECL_FUNCTION_CODE (fndecl);
- default:
- break;
- }
-
- return BUILT_IN_NONE;
-}
-
-/* This function will recurse into EXPR finding any
- ARRAY_NOTATION_EXPRs and calculate the overall rank of EXPR,
- storing it in *RANK. LOC is the location of the original expression.
-
- ORIG_EXPR is the original expression used to display if any rank
- mismatch errors are found.
-
- Upon entry, *RANK must be either 0, or the rank of a parent
- expression that must have the same rank as the one being
- calculated. It is illegal to have multiple array notation with different
- rank in the same expression (see examples below for clarification).
-
- If there were any rank mismatches while calculating the rank, an
- error will be issued, and FALSE will be returned. Otherwise, TRUE
- is returned.
-
- If IGNORE_BUILTIN_FN is TRUE, ignore array notation specific
- built-in functions (__sec_reduce_*, etc).
-
- Here are some examples of array notations and their rank:
-
- Expression RANK
- 5 0
- X (a variable) 0
- *Y (a pointer) 0
- A[5] 0
- B[5][10] 0
- A[:] 1
- B[0:10] 1
- C[0:10:2] 1
- D[5][0:10:2] 1 (since D[5] is considered "scalar")
- D[5][:][10] 1
- E[:] + 5 1
- F[:][:][:] + 5 + X 3
- F[:][:][:] + E[:] + 5 + X RANKMISMATCH-ERROR since rank (E[:]) = 1 and
- rank (F[:][:][:]) = 3. They must be equal
- or have a rank of zero.
- F[:][5][10] + E[:] * 5 + *Y 1
-
- int func (int);
- func (A[:]) 1
- func (B[:][:][:][:]) 4
-
- int func2 (int, int)
- func2 (A[:], B[:][:][:][:]) RANKMISMATCH-ERROR -- Since Rank (A[:]) = 1
- and Rank (B[:][:][:][:]) = 4
-
- A[:] + func (B[:][:][:][:]) RANKMISMATCH-ERROR
- func2 (A[:], B[:]) + func (A) 1
-
- */
-
-bool
-find_rank (location_t loc, tree orig_expr, tree expr, bool ignore_builtin_fn,
- size_t *rank)
-{
- tree ii_tree;
- size_t ii = 0, current_rank = 0;
-
- if (TREE_CODE (expr) == ARRAY_NOTATION_REF)
- {
- ii_tree = expr;
- while (ii_tree)
- {
- if (TREE_CODE (ii_tree) == ARRAY_NOTATION_REF)
- {
- current_rank++;
- ii_tree = ARRAY_NOTATION_ARRAY (ii_tree);
- }
- else if (handled_component_p (ii_tree)
- || INDIRECT_REF_P (ii_tree))
- ii_tree = TREE_OPERAND (ii_tree, 0);
- else if (TREE_CODE (ii_tree) == PARM_DECL
- || VAR_P (ii_tree))
- break;
- else
- gcc_unreachable ();
- }
- if (*rank == 0)
- /* In this case, all the expressions this function has encountered thus
- far have been scalars or expressions with zero rank. Please see
- header comment for examples of such expression. */
- *rank = current_rank;
- else if (*rank != current_rank)
- {
- /* In this case, find rank is being recursed through a set of
- expression of the form A <OPERATION> B, where A and B both have
- array notations in them and the rank of A is not equal to rank of
- B.
- A simple example of such case is the following: X[:] + Y[:][:] */
- *rank = current_rank;
- return false;
- }
- }
- else if (TREE_CODE (expr) == STATEMENT_LIST)
- {
- tree_stmt_iterator ii_tsi;
- for (ii_tsi = tsi_start (expr); !tsi_end_p (ii_tsi);
- tsi_next (&ii_tsi))
- if (!find_rank (loc, orig_expr, *tsi_stmt_ptr (ii_tsi),
- ignore_builtin_fn, rank))
- return false;
- }
- else
- {
- if (TREE_CODE (expr) == CALL_EXPR)
- {
- tree func_name = CALL_EXPR_FN (expr);
- tree prev_arg = NULL_TREE, arg;
- call_expr_arg_iterator iter;
- size_t prev_rank = 0;
- if (TREE_CODE (func_name) == ADDR_EXPR)
- if (!ignore_builtin_fn)
- if (is_cilkplus_reduce_builtin (func_name))
- /* If it is a built-in function, then we know it returns a
- scalar. */
- return true;
- if (!find_rank (loc, orig_expr, func_name, ignore_builtin_fn, rank))
- return false;
- FOR_EACH_CALL_EXPR_ARG (arg, iter, expr)
- {
- if (!find_rank (loc, orig_expr, arg, ignore_builtin_fn, rank))
- {
- if (prev_arg && EXPR_HAS_LOCATION (prev_arg)
- && prev_rank != *rank)
- error_at (EXPR_LOCATION (prev_arg),
- "rank mismatch between %qE and %qE", prev_arg,
- arg);
- else if (prev_arg && prev_rank != *rank)
- /* Here the original expression is printed as a "heads-up"
- to the programmer. This is because since there is no
- location information for the offending argument, the
- error could be in some internally generated code that is
- not visible for the programmer. Thus, the correct fix
- may lie in the original expression. */
- error_at (loc, "rank mismatch in expression %qE",
- orig_expr);
- return false;
- }
- prev_arg = arg;
- prev_rank = *rank;
- }
- }
- else
- {
- tree prev_arg = NULL_TREE;
- for (ii = 0; ii < TREE_CODE_LENGTH (TREE_CODE (expr)); ii++)
- {
- if (TREE_OPERAND (expr, ii)
- && !find_rank (loc, orig_expr, TREE_OPERAND (expr, ii),
- ignore_builtin_fn, rank))
- {
- if (prev_arg && EXPR_HAS_LOCATION (prev_arg))
- error_at (EXPR_LOCATION (prev_arg),
- "rank mismatch between %qE and %qE", prev_arg,
- TREE_OPERAND (expr, ii));
- return false;
- }
- prev_arg = TREE_OPERAND (expr, ii);
- }
- }
- }
- return true;
-}
-
-/* Extracts all array notations in NODE and stores them in ARRAY_LIST. If
- IGNORE_BUILTIN_FN is set, then array notations inside array notation
- specific built-in functions are ignored. The NODE can be constants,
- VAR_DECL, PARM_DECLS, STATEMENT_LISTS or full expressions. */
-
-void
-extract_array_notation_exprs (tree node, bool ignore_builtin_fn,
- vec<tree, va_gc> **array_list)
-{
- size_t ii = 0;
-
- if (!node)
- return;
- if (TREE_CODE (node) == ARRAY_NOTATION_REF)
- {
- vec_safe_push (*array_list, node);
- return;
- }
- if (TREE_CODE (node) == DECL_EXPR)
- {
- tree x = DECL_EXPR_DECL (node);
- if (DECL_INITIAL (x))
- extract_array_notation_exprs (DECL_INITIAL (x),
- ignore_builtin_fn,
- array_list);
- }
- else if (TREE_CODE (node) == STATEMENT_LIST)
- {
- tree_stmt_iterator ii_tsi;
- for (ii_tsi = tsi_start (node); !tsi_end_p (ii_tsi); tsi_next (&ii_tsi))
- extract_array_notation_exprs (*tsi_stmt_ptr (ii_tsi),
- ignore_builtin_fn, array_list);
- }
- else if (TREE_CODE (node) == CALL_EXPR)
- {
- tree arg;
- call_expr_arg_iterator iter;
- if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (node)))
- {
- if (ignore_builtin_fn)
- return;
- else
- {
- vec_safe_push (*array_list, node);
- return;
- }
- }
- if (is_sec_implicit_index_fn (CALL_EXPR_FN (node)))
- {
- vec_safe_push (*array_list, node);
- return;
- }
- /* This will extract array notations in function pointers. */
- extract_array_notation_exprs (CALL_EXPR_FN (node), ignore_builtin_fn,
- array_list);
- FOR_EACH_CALL_EXPR_ARG (arg, iter, node)
- extract_array_notation_exprs (arg, ignore_builtin_fn, array_list);
- }
- else
- for (ii = 0; ii < TREE_CODE_LENGTH (TREE_CODE (node)); ii++)
- if (TREE_OPERAND (node, ii))
- extract_array_notation_exprs (TREE_OPERAND (node, ii),
- ignore_builtin_fn, array_list);
- return;
-}
-
-/* LIST contains all the array notations found in *ORIG and ARRAY_OPERAND
- contains the expanded ARRAY_REF. E.g., if LIST[<some_index>] contains
- an array_notation expression, then ARRAY_OPERAND[<some_index>] contains its
- expansion. If *ORIG matches LIST[<some_index>] then *ORIG is set to
- ARRAY_OPERAND[<some_index>]. This function recursively steps through
- all the sub-trees of *ORIG, if it is larger than a single
- ARRAY_NOTATION_REF. */
-
-void
-replace_array_notations (tree *orig, bool ignore_builtin_fn,
- vec<tree, va_gc> *list,
- vec<tree, va_gc> *array_operand)
-{
- size_t ii = 0;
- extern tree build_c_cast (location_t, tree, tree);
- tree node = NULL_TREE, node_replacement = NULL_TREE;
-
- if (vec_safe_length (list) == 0)
- return;
-
- if (TREE_CODE (*orig) == ARRAY_NOTATION_REF)
- {
- for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
- if (*orig == node)
- {
- node_replacement = (*array_operand)[ii];
- *orig = node_replacement;
- }
- }
- else if (TREE_CODE (*orig) == STATEMENT_LIST)
- {
- tree_stmt_iterator ii_tsi;
- for (ii_tsi = tsi_start (*orig); !tsi_end_p (ii_tsi); tsi_next (&ii_tsi))
- replace_array_notations (tsi_stmt_ptr (ii_tsi), ignore_builtin_fn, list,
- array_operand);
- }
- else if (TREE_CODE (*orig) == CALL_EXPR)
- {
- tree arg;
- call_expr_arg_iterator iter;
- if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (*orig)))
- {
- if (!ignore_builtin_fn)
- {
- for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
- if (*orig == node)
- {
- node_replacement = (*array_operand)[ii];
- *orig = node_replacement;
- }
- }
- return;
- }
- if (is_sec_implicit_index_fn (CALL_EXPR_FN (*orig)))
- {
- for (ii = 0; vec_safe_iterate (list, ii, &node); ii++)
- if (*orig == node)
- {
- node_replacement = (*array_operand)[ii];
- *orig = build_c_cast (EXPR_LOCATION (*orig),
- TREE_TYPE (*orig), node_replacement);
- }
- return;
- }
- /* Fixes array notations in array notations in function pointers. */
- replace_array_notations (&CALL_EXPR_FN (*orig), ignore_builtin_fn, list,
- array_operand);
- ii = 0;
- FOR_EACH_CALL_EXPR_ARG (arg, iter, *orig)
- {
- replace_array_notations (&arg, ignore_builtin_fn, list,
- array_operand);
- CALL_EXPR_ARG (*orig, ii) = arg;
- ii++;
- }
- }
- else
- {
- for (ii = 0; ii < (size_t) TREE_CODE_LENGTH (TREE_CODE (*orig)); ii++)
- if (TREE_OPERAND (*orig, ii))
- replace_array_notations (&TREE_OPERAND (*orig, ii), ignore_builtin_fn,
- list, array_operand);
- }
- return;
-}
-
-/* Callback for walk_tree. Find all the scalar expressions in *TP and push
- them in DATA struct, typecasted to (void *). If *WALK_SUBTREES is set to 0
- then do not go into the *TP's subtrees. Since this function steps through
- all the subtrees, *TP and TP can be NULL_TREE and NULL, respectively. The
- function returns NULL_TREE unconditionally. */
-
-tree
-find_inv_trees (tree *tp, int *walk_subtrees, void *data)
-{
- struct inv_list *i_list = (struct inv_list *) data;
- unsigned int ii = 0;
-
- if (!tp || !*tp)
- return NULL_TREE;
- if (TREE_CONSTANT (*tp))
- return NULL_TREE; /* No need to save constant to a variable. */
- if (TREE_CODE (*tp) != COMPOUND_EXPR && !contains_array_notation_expr (*tp))
- {
- vec_safe_push (i_list->list_values, *tp);
- *walk_subtrees = 0;
- }
- else if (TREE_CODE (*tp) == ARRAY_NOTATION_REF
- || TREE_CODE (*tp) == ARRAY_REF
- || TREE_CODE (*tp) == CALL_EXPR)
- /* No need to step through the internals of array notation. */
- *walk_subtrees = 0;
- else
- {
- *walk_subtrees = 1;
-
- /* This function is used by C and C++ front-ends. In C++, additional
- tree codes such as TARGET_EXPR must be eliminated. These codes are
- passed into additional_tcodes and are walked through and checked. */
- for (ii = 0; ii < vec_safe_length (i_list->additional_tcodes); ii++)
- if (TREE_CODE (*tp) == (*(i_list->additional_tcodes))[ii])
- *walk_subtrees = 0;
- }
- return NULL_TREE;
-}
-
-/* Callback for walk_tree. Replace all the scalar expressions in *TP with the
- appropriate replacement stored in the struct *DATA (typecasted to void*).
- The subtrees are not touched if *WALK_SUBTREES is set to zero. */
-
-tree
-replace_inv_trees (tree *tp, int *walk_subtrees, void *data)
-{
- size_t ii = 0;
- tree t, r;
- struct inv_list *i_list = (struct inv_list *) data;
-
- if (vec_safe_length (i_list->list_values))
- {
- for (ii = 0; vec_safe_iterate (i_list->list_values, ii, &t); ii++)
- if (simple_cst_equal (*tp, t) == 1)
- {
- vec_safe_iterate (i_list->replacement, ii, &r);
- gcc_assert (r != NULL_TREE);
- *tp = r;
- *walk_subtrees = 0;
- }
- }
- else
- *walk_subtrees = 0;
- return NULL_TREE;
-}
-
-/* Returns true if EXPR or any of its subtrees contain ARRAY_NOTATION_EXPR
- node. */
-
-bool
-contains_array_notation_expr (tree expr)
-{
- vec<tree, va_gc> *array_list = NULL;
-
- if (!expr)
- return false;
- if (TREE_CODE (expr) == FUNCTION_DECL)
- if (is_cilkplus_reduce_builtin (expr))
- return true;
-
- extract_array_notation_exprs (expr, false, &array_list);
- if (vec_safe_length (array_list) == 0)
- return false;
- else
- return true;
-}
-
-/* This function will check if OP is a CALL_EXPR that is a built-in array
- notation function. If so, then we will return its type to be the type of
- the array notation inside. */
-
-tree
-find_correct_array_notation_type (tree op)
-{
- tree fn_arg, return_type = NULL_TREE;
-
- if (op)
- {
- return_type = TREE_TYPE (op); /* This is the default case. */
- if (TREE_CODE (op) == CALL_EXPR)
- if (is_cilkplus_reduce_builtin (CALL_EXPR_FN (op)))
- {
- fn_arg = CALL_EXPR_ARG (op, 0);
- if (fn_arg)
- return_type = TREE_TYPE (fn_arg);
- }
- }
- return return_type;
-}
-
-/* Extracts all the array notation triplet information from LIST and stores
- them in the following fields of the 2-D array NODE(size x rank):
- START, LENGTH and STRIDE, holding the starting index, length, and stride,
- respectively. In addition, it also sets two bool fields, IS_VECTOR and
- COUNT_DOWN, in NODE indicating whether a certain value at a certain field
- is a vector and if the array is accessed from high to low. */
-
-void
-cilkplus_extract_an_triplets (vec<tree, va_gc> *list, size_t size, size_t rank,
- vec<vec<struct cilkplus_an_parts> > *node)
-{
- vec<vec<tree> > array_exprs = vNULL;
-
- node->safe_grow_cleared (size);
- array_exprs.safe_grow_cleared (size);
-
- if (rank > 0)
- for (size_t ii = 0; ii < size; ii++)
- {
- (*node)[ii].safe_grow_cleared (rank);
- array_exprs[ii].safe_grow_cleared (rank);
- }
- for (size_t ii = 0; ii < size; ii++)
- {
- size_t jj = 0;
- tree ii_tree = (*list)[ii];
- while (ii_tree)
- {
- if (TREE_CODE (ii_tree) == ARRAY_NOTATION_REF)
- {
- array_exprs[ii][jj] = ii_tree;
- jj++;
- ii_tree = ARRAY_NOTATION_ARRAY (ii_tree);
- }
- else if (TREE_CODE (ii_tree) == ARRAY_REF)
- ii_tree = TREE_OPERAND (ii_tree, 0);
- else
- break;
- }
- }
- for (size_t ii = 0; ii < size; ii++)
- if (TREE_CODE ((*list)[ii]) == ARRAY_NOTATION_REF)
- for (size_t jj = 0; jj < rank; jj++)
- {
- tree ii_tree = array_exprs[ii][jj];
- (*node)[ii][jj].is_vector = true;
- (*node)[ii][jj].value = ARRAY_NOTATION_ARRAY (ii_tree);
- (*node)[ii][jj].start
- = fold_build1 (CONVERT_EXPR, integer_type_node,
- ARRAY_NOTATION_START (ii_tree));
- (*node)[ii][jj].length
- = fold_build1 (CONVERT_EXPR, integer_type_node,
- ARRAY_NOTATION_LENGTH (ii_tree));
- (*node)[ii][jj].stride
- = fold_build1 (CONVERT_EXPR, integer_type_node,
- ARRAY_NOTATION_STRIDE (ii_tree));
- }
-
- release_vec_vec (array_exprs);
-}
-
-/* Replaces all the __sec_implicit_arg functions in LIST with the induction
- variable stored in VAR at the appropriate location pointed by the
- __sec_implicit_arg's first parameter. Emits an error if the parameter is
- not between 0 and RANK. */
-
-vec <tree, va_gc> *
-fix_sec_implicit_args (location_t loc, vec <tree, va_gc> *list,
- vec<an_loop_parts> an_loop_info, size_t rank,
- tree orig_stmt)
-{
- vec <tree, va_gc> *array_operand = NULL;
- for (size_t ii = 0; ii < vec_safe_length (list); ii++)
- if (TREE_CODE ((*list)[ii]) == CALL_EXPR
- && is_sec_implicit_index_fn (CALL_EXPR_FN ((*list)[ii])))
- {
- int idx = extract_sec_implicit_index_arg (loc, (*list)[ii]);
- if (idx < 0)
- /* In this case, the returning function would have emitted an
- error thus it is not necessary to do so again. */
- return NULL;
- else if (idx < (int) rank)
- vec_safe_push (array_operand, an_loop_info[idx].var);
- else
- {
- error_at (loc, "__sec_implicit_index argument %d must be "
- "less than the rank of %qE", idx, orig_stmt);
- return NULL;
- }
- }
- else
- /* Save the existing value into the array operand. */
- vec_safe_push (array_operand, (*list)[ii]);
- return array_operand;
-}
-
-/* Returns true if NAME is an IDENTIFIER_NODE with identifier "vector",
- "__vector", or "__vector__". */
-
-bool
-is_cilkplus_vector_p (tree name)
-{
- return flag_cilkplus && is_attribute_p ("vector", name);
-}
diff --git a/gcc/c-family/c-cilkplus.c b/gcc/c-family/c-cilkplus.c
deleted file mode 100644
index a537193798d..00000000000
--- a/gcc/c-family/c-cilkplus.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/* This file contains routines to construct and validate Cilk Plus
- constructs within the C and C++ front ends.
-
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
- Contributed by Aldy Hernandez <aldyh@redhat.com>.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "c-common.h"
-
-/* Validate the body of a _Cilk_for construct or a <#pragma simd> for
- loop.
-
- Returns true if there were no errors, false otherwise. */
-
-bool
-c_check_cilk_loop (location_t loc, tree decl)
-{
- if (TREE_THIS_VOLATILE (decl))
- {
- error_at (loc, "iteration variable cannot be volatile");
- return false;
- }
- return true;
-}
-
-/* Calculate number of iterations of CILK_FOR. */
-
-tree
-cilk_for_number_of_iterations (tree cilk_for)
-{
- tree t, v, n1, n2, step, type, init, cond, incr, itype;
- enum tree_code cond_code;
- location_t loc = EXPR_LOCATION (cilk_for);
-
- init = TREE_VEC_ELT (OMP_FOR_INIT (cilk_for), 0);
- v = TREE_OPERAND (init, 0);
- cond = TREE_VEC_ELT (OMP_FOR_COND (cilk_for), 0);
- incr = TREE_VEC_ELT (OMP_FOR_INCR (cilk_for), 0);
- type = TREE_TYPE (v);
-
- gcc_assert (TREE_CODE (TREE_TYPE (v)) == INTEGER_TYPE
- || TREE_CODE (TREE_TYPE (v)) == POINTER_TYPE);
- n1 = TREE_OPERAND (init, 1);
- cond_code = TREE_CODE (cond);
- n2 = TREE_OPERAND (cond, 1);
- switch (cond_code)
- {
- case LT_EXPR:
- case GT_EXPR:
- case NE_EXPR:
- break;
- case LE_EXPR:
- if (POINTER_TYPE_P (TREE_TYPE (n2)))
- n2 = fold_build_pointer_plus_hwi_loc (loc, n2, 1);
- else
- n2 = fold_build2_loc (loc, PLUS_EXPR, TREE_TYPE (n2), n2,
- build_int_cst (TREE_TYPE (n2), 1));
- cond_code = LT_EXPR;
- break;
- case GE_EXPR:
- if (POINTER_TYPE_P (TREE_TYPE (n2)))
- n2 = fold_build_pointer_plus_hwi_loc (loc, n2, -1);
- else
- n2 = fold_build2_loc (loc, MINUS_EXPR, TREE_TYPE (n2), n2,
- build_int_cst (TREE_TYPE (n2), 1));
- cond_code = GT_EXPR;
- break;
- default:
- gcc_unreachable ();
- }
-
- step = NULL_TREE;
- switch (TREE_CODE (incr))
- {
- case PREINCREMENT_EXPR:
- case POSTINCREMENT_EXPR:
- step = build_int_cst (TREE_TYPE (v), 1);
- break;
- case PREDECREMENT_EXPR:
- case POSTDECREMENT_EXPR:
- step = build_int_cst (TREE_TYPE (v), -1);
- break;
- case MODIFY_EXPR:
- t = TREE_OPERAND (incr, 1);
- gcc_assert (TREE_OPERAND (t, 0) == v);
- switch (TREE_CODE (t))
- {
- case PLUS_EXPR:
- step = TREE_OPERAND (t, 1);
- break;
- case POINTER_PLUS_EXPR:
- step = fold_convert (ssizetype, TREE_OPERAND (t, 1));
- break;
- case MINUS_EXPR:
- step = TREE_OPERAND (t, 1);
- step = fold_build1_loc (loc, NEGATE_EXPR, TREE_TYPE (step), step);
- break;
- default:
- gcc_unreachable ();
- }
- break;
- default:
- gcc_unreachable ();
- }
-
- itype = type;
- if (POINTER_TYPE_P (itype))
- itype = signed_type_for (itype);
- if (cond_code == NE_EXPR)
- {
- /* For NE_EXPR, we need to find out if the iterator increases
- or decreases from whether step is positive or negative. */
- tree stype = itype;
- if (TYPE_UNSIGNED (stype))
- stype = signed_type_for (stype);
- cond = fold_build2_loc (loc, GE_EXPR, boolean_type_node,
- fold_convert_loc (loc, stype, step),
- build_int_cst (stype, 0));
- t = fold_build3_loc (loc, COND_EXPR, itype, cond,
- build_int_cst (itype, -1),
- build_int_cst (itype, 1));
- }
- else
- t = build_int_cst (itype, (cond_code == LT_EXPR ? -1 : 1));
- t = fold_build2_loc (loc, PLUS_EXPR, itype,
- fold_convert_loc (loc, itype, step), t);
- t = fold_build2_loc (loc, PLUS_EXPR, itype, t,
- fold_convert_loc (loc, itype, n2));
- t = fold_build2_loc (loc, MINUS_EXPR, itype, t,
- fold_convert_loc (loc, itype, n1));
- if (TYPE_UNSIGNED (itype) && cond_code == GT_EXPR)
- t = fold_build2_loc (loc, TRUNC_DIV_EXPR, itype,
- fold_build1_loc (loc, NEGATE_EXPR, itype, t),
- fold_build1_loc (loc, NEGATE_EXPR, itype,
- fold_convert_loc (loc, itype,
- step)));
- else if (TYPE_UNSIGNED (itype) && cond_code == NE_EXPR)
- {
- tree t1
- = fold_build2_loc (loc, TRUNC_DIV_EXPR, itype, t,
- fold_convert_loc (loc, itype, step));
- tree t2
- = fold_build2_loc (loc, TRUNC_DIV_EXPR, itype,
- fold_build1_loc (loc, NEGATE_EXPR, itype, t),
- fold_build1_loc (loc, NEGATE_EXPR, itype,
- fold_convert_loc (loc, itype,
- step)));
- t = fold_build3_loc (loc, COND_EXPR, itype, cond, t1, t2);
- }
- else
- t = fold_build2_loc (loc, TRUNC_DIV_EXPR, itype, t,
- fold_convert_loc (loc, itype, step));
- cond = fold_build2_loc (loc, cond_code, boolean_type_node, n1, n2);
- t = fold_build3_loc (loc, COND_EXPR, itype, cond, t,
- build_int_cst (itype, 0));
- return t;
-}
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 9970e611c7c..8256165730d 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -338,9 +338,6 @@ const struct c_common_resword c_common_reswords[] =
{ "_Atomic", RID_ATOMIC, D_CONLY },
{ "_Bool", RID_BOOL, D_CONLY },
{ "_Complex", RID_COMPLEX, 0 },
- { "_Cilk_spawn", RID_CILK_SPAWN, 0 },
- { "_Cilk_sync", RID_CILK_SYNC, 0 },
- { "_Cilk_for", RID_CILK_FOR, 0 },
{ "_Imaginary", RID_IMAGINARY, D_CONLY },
{ "_Float16", RID_FLOAT16, D_CONLY },
{ "_Float32", RID_FLOAT32, D_CONLY },
@@ -3935,9 +3932,6 @@ c_define_builtins (tree va_list_ref_type_node, tree va_list_arg_type_node)
targetm.init_builtins ();
build_common_builtin_nodes ();
-
- if (flag_cilkplus)
- cilk_init_builtins ();
}
/* Like get_identifier, but avoid warnings about null arguments when
@@ -7569,7 +7563,6 @@ c_common_init_ts (void)
{
MARK_TS_TYPED (C_MAYBE_CONST_EXPR);
MARK_TS_TYPED (EXCESS_PRECISION_EXPR);
- MARK_TS_TYPED (ARRAY_NOTATION_REF);
}
/* Build a user-defined numeric literal out of an integer constant type VALUE
diff --git a/gcc/c-family/c-common.def b/gcc/c-family/c-common.def
index aeec2714538..2d894728b04 100644
--- a/gcc/c-family/c-common.def
+++ b/gcc/c-family/c-common.def
@@ -55,13 +55,6 @@ DEFTREECODE (USERDEF_LITERAL, "userdef_literal", tcc_exceptional, 3)
or for the purpose of -Wsizeof-pointer-memaccess warning. */
DEFTREECODE (SIZEOF_EXPR, "sizeof_expr", tcc_expression, 1)
-/* Array Notation expression.
- Operand 0 is the array.
- Operand 1 is the starting array index.
- Operand 2 contains the number of elements you need to access.
- Operand 3 is the stride. */
-DEFTREECODE (ARRAY_NOTATION_REF, "array_notation_ref", tcc_reference, 4)
-
/*
Local variables:
mode:c
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 3cf4b0aa104..5e55e5efba6 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -184,9 +184,6 @@ enum rid
/* C++ transactional memory. */
RID_ATOMIC_NOEXCEPT, RID_ATOMIC_CANCEL, RID_SYNCHRONIZED,
- /* Cilk Plus keywords. */
- RID_CILK_SPAWN, RID_CILK_SYNC, RID_CILK_FOR,
-
/* Objective-C ("AT" reserved words - they are only keywords when
they follow '@') */
RID_AT_ENCODE, RID_AT_END,
@@ -586,9 +583,6 @@ extern void push_cleanup (tree, tree, bool);
extern tree build_modify_expr (location_t, tree, tree, enum tree_code,
location_t, tree, tree);
-extern tree build_array_notation_expr (location_t, tree, tree, enum tree_code,
- location_t, tree, tree);
-extern tree build_array_notation_ref (location_t, tree, tree, tree, tree, tree);
extern tree build_indirect_ref (location_t, tree, ref_operator);
extern bool has_c_linkage (const_tree decl);
@@ -1255,9 +1249,8 @@ enum c_omp_clause_split
enum c_omp_region_type
{
C_ORT_OMP = 1 << 0,
- C_ORT_CILK = 1 << 1,
- C_ORT_ACC = 1 << 2,
- C_ORT_DECLARE_SIMD = 1 << 3,
+ C_ORT_ACC = 1 << 1,
+ C_ORT_DECLARE_SIMD = 1 << 2,
C_ORT_OMP_DECLARE_SIMD = C_ORT_OMP | C_ORT_DECLARE_SIMD
};
@@ -1364,23 +1357,6 @@ enum stv_conv {
extern enum stv_conv scalar_to_vector (location_t loc, enum tree_code code,
tree op0, tree op1, bool);
-/* In c-cilkplus.c */
-extern tree c_validate_cilk_plus_loop (tree *, int *, void *);
-extern bool c_check_cilk_loop (location_t, tree);
-
-/* These #defines allow users to access different operands of the
- array notation tree. */
-
-#define ARRAY_NOTATION_CHECK(NODE) TREE_CHECK (NODE, ARRAY_NOTATION_REF)
-#define ARRAY_NOTATION_ARRAY(NODE) \
- TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 0)
-#define ARRAY_NOTATION_START(NODE) \
- TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 1)
-#define ARRAY_NOTATION_LENGTH(NODE) \
- TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 2)
-#define ARRAY_NOTATION_STRIDE(NODE) \
- TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 3)
-
/* This structure holds all the scalar values and its appropriate variable
replacment. It is mainly used by the function that pulls all the invariant
parts that should be executed only once, which comes with array notation
@@ -1392,76 +1368,12 @@ struct inv_list
vec<enum tree_code, va_gc> *additional_tcodes;
};
-/* This structure holds all the important components that can be extracted
- from an ARRAY_NOTATION_REF expression. It is used to pass array notation
- information between the functions that are responsible for expansion. */
-typedef struct cilkplus_an_parts
-{
- tree value;
- tree start;
- tree length;
- tree stride;
- bool is_vector;
-} an_parts;
-
-/* This structure holds the components necessary to create the loop around
- the ARRAY_REF that is created using the ARRAY_NOTATION information. */
-
-typedef struct cilkplus_an_loop_parts
-{
- tree var; /* Loop induction variable. */
- tree incr; /* Loop increment/decrement expression. */
- tree cmp; /* Loop condition. */
- tree ind_init; /* Initialization of the loop induction variable. */
-} an_loop_parts;
-
-/* In array-notation-common.c. */
-extern HOST_WIDE_INT extract_sec_implicit_index_arg (location_t, tree);
-extern bool is_sec_implicit_index_fn (tree);
-extern void array_notation_init_builtins (void);
-extern struct c_expr fix_array_notation_expr (location_t, enum tree_code,
- struct c_expr);
-extern bool contains_array_notation_expr (tree);
-extern tree expand_array_notation_exprs (tree);
-extern tree fix_conditional_array_notations (tree);
-extern tree find_correct_array_notation_type (tree);
-extern bool length_mismatch_in_expr_p (location_t, vec<vec<an_parts> >);
-extern enum built_in_function is_cilkplus_reduce_builtin (tree);
-extern bool find_rank (location_t, tree, tree, bool, size_t *);
-extern void extract_array_notation_exprs (tree, bool, vec<tree, va_gc> **);
-extern void replace_array_notations (tree *, bool, vec<tree, va_gc> *,
- vec<tree, va_gc> *);
extern tree find_inv_trees (tree *, int *, void *);
extern tree replace_inv_trees (tree *, int *, void *);
-extern tree find_correct_array_notation_type (tree op);
-extern void cilkplus_extract_an_triplets (vec<tree, va_gc> *, size_t, size_t,
- vec<vec<an_parts> > *);
-extern vec <tree, va_gc> *fix_sec_implicit_args
- (location_t, vec <tree, va_gc> *, vec<an_loop_parts>, size_t, tree);
-extern bool is_cilkplus_vector_p (tree);
-
-/* In cilk.c. */
-extern tree insert_cilk_frame (tree);
-extern void cilk_init_builtins (void);
-extern int gimplify_cilk_spawn (tree *);
-extern void cilk_install_body_with_frame_cleanup (tree, tree, void *);
-extern bool cilk_detect_spawn_and_unwrap (tree *);
-extern bool cilk_set_spawn_marker (location_t, tree);
-extern tree build_cilk_sync (void);
-extern tree build_cilk_spawn (location_t, tree);
-extern tree make_cilk_frame (tree);
-extern tree create_cilk_function_exit (tree, bool, bool);
-extern void cilk_outline (tree, tree *, void *);
-extern bool contains_cilk_spawn_stmt (tree);
-extern tree cilk_for_number_of_iterations (tree);
-extern bool check_no_cilk (tree, const char *, const char *,
- location_t loc = UNKNOWN_LOCATION);
+
extern bool reject_gcc_builtin (const_tree, location_t = UNKNOWN_LOCATION);
extern bool valid_array_size_p (location_t, tree, tree);
-extern bool cilk_ignorable_spawn_rhs_op (tree);
-extern bool cilk_recognize_spawn (tree, tree *);
-
/* In c-warn.c. */
extern void constant_expression_warning (tree);
extern void constant_expression_error (tree);
diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c
index 91f9bf9c7a3..152eb8ad29e 100644
--- a/gcc/c-family/c-gimplify.c
+++ b/gcc/c-family/c-gimplify.c
@@ -36,7 +36,6 @@ along with GCC; see the file COPYING3. If not see
#include "gimplify.h"
#include "langhooks.h"
#include "dumpfile.h"
-#include "cilk.h"
#include "c-ubsan.h"
/* The gimplification pass converts the language-dependent trees
@@ -277,25 +276,6 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
break;
}
- case CILK_SPAWN_STMT:
- gcc_assert(fn_contains_cilk_spawn_p (cfun)
- && cilk_detect_spawn_and_unwrap (expr_p));
-
- if (!seen_error ())
- return (enum gimplify_status) gimplify_cilk_spawn (expr_p);
- return GS_ERROR;
-
- case MODIFY_EXPR:
- case INIT_EXPR:
- case CALL_EXPR:
- if (fn_contains_cilk_spawn_p (cfun)
- && cilk_detect_spawn_and_unwrap (expr_p)
- /* If an error is found, the spawn wrapper is removed and the
- original expression (MODIFY/INIT/CALL_EXPR) is processes as
- it is supposed to be. */
- && !seen_error ())
- return (enum gimplify_status) gimplify_cilk_spawn (expr_p);
-
default:;
}
diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c
index 8e045093adb..5c5d7a73fdd 100644
--- a/gcc/c-family/c-omp.c
+++ b/gcc/c-family/c-omp.c
@@ -536,10 +536,6 @@ c_finish_omp_for (location_t locus, enum tree_code code, tree declv,
bool fail = false;
int i;
- if ((code == CILK_SIMD || code == CILK_FOR)
- && !c_check_cilk_loop (locus, TREE_VEC_ELT (declv, 0)))
- fail = true;
-
gcc_assert (TREE_VEC_LENGTH (declv) == TREE_VEC_LENGTH (initv));
gcc_assert (TREE_VEC_LENGTH (declv) == TREE_VEC_LENGTH (condv));
gcc_assert (TREE_VEC_LENGTH (declv) == TREE_VEC_LENGTH (incrv));
@@ -671,8 +667,7 @@ c_finish_omp_for (location_t locus, enum tree_code code, tree declv,
{
if (!INTEGRAL_TYPE_P (TREE_TYPE (decl)))
{
- if (code != CILK_SIMD && code != CILK_FOR)
- cond_ok = false;
+ cond_ok = false;
}
else if (operand_equal_p (TREE_OPERAND (cond, 1),
TYPE_MIN_VALUE (TREE_TYPE (decl)),
@@ -684,7 +679,7 @@ c_finish_omp_for (location_t locus, enum tree_code code, tree declv,
0))
TREE_SET_CODE (cond, TREE_CODE (cond) == NE_EXPR
? LT_EXPR : GE_EXPR);
- else if (code != CILK_SIMD && code != CILK_FOR)
+ else
cond_ok = false;
}
diff --git a/gcc/c-family/c-pragma.c b/gcc/c-family/c-pragma.c
index f7b59b34807..daa9e5ade38 100644
--- a/gcc/c-family/c-pragma.c
+++ b/gcc/c-family/c-pragma.c
@@ -1343,20 +1343,6 @@ c_pp_lookup_pragma (unsigned int id, const char **space, const char **name)
return;
}
- if (id == PRAGMA_CILK_SIMD)
- {
- *space = NULL;
- *name = "simd";
- return;
- }
-
- if (id == PRAGMA_CILK_GRAINSIZE)
- {
- *space = "cilk";
- *name = "grainsize";
- return;
- }
-
if (id >= PRAGMA_FIRST_EXTERNAL
&& (id < PRAGMA_FIRST_EXTERNAL + registered_pp_pragmas.length ()))
{
@@ -1532,10 +1518,6 @@ init_pragma (void)
omp_pragmas_simd[i].id, true, true);
}
- if (flag_cilkplus)
- cpp_register_deferred_pragma (parse_in, NULL, "simd", PRAGMA_CILK_SIMD,
- true, false);
-
if (!flag_preprocess_only)
cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess",
PRAGMA_GCC_PCH_PREPROCESS, false, false);
@@ -1544,10 +1526,6 @@ init_pragma (void)
cpp_register_deferred_pragma (parse_in, "GCC", "ivdep", PRAGMA_IVDEP, false,
false);
- if (flag_cilkplus)
- cpp_register_deferred_pragma (parse_in, "cilk", "grainsize",
- PRAGMA_CILK_GRAINSIZE, true, false);
-
#ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
c_register_pragma_with_expansion (0, "pack", handle_pragma_pack);
#else
diff --git a/gcc/c-family/c-pragma.h b/gcc/c-family/c-pragma.h
index a79036e97e2..e035b3a8eca 100644
--- a/gcc/c-family/c-pragma.h
+++ b/gcc/c-family/c-pragma.h
@@ -67,12 +67,6 @@ enum pragma_kind {
PRAGMA_OMP_THREADPRIVATE,
PRAGMA_OMP_TEAMS,
- /* Top level clause to handle all Cilk Plus pragma simd clauses. */
- PRAGMA_CILK_SIMD,
-
- /* This pragma handles setting of grainsize for a _Cilk_for. */
- PRAGMA_CILK_GRAINSIZE,
-
PRAGMA_GCC_PCH_PREPROCESS,
PRAGMA_IVDEP,
@@ -134,20 +128,8 @@ enum pragma_omp_clause {
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,
- PRAGMA_CILK_CLAUSE_VECTORLENGTH,
- PRAGMA_CILK_CLAUSE_NONE = PRAGMA_OMP_CLAUSE_NONE,
- PRAGMA_CILK_CLAUSE_LINEAR = PRAGMA_OMP_CLAUSE_LINEAR,
- PRAGMA_CILK_CLAUSE_PRIVATE = PRAGMA_OMP_CLAUSE_PRIVATE,
- PRAGMA_CILK_CLAUSE_FIRSTPRIVATE = PRAGMA_OMP_CLAUSE_FIRSTPRIVATE,
- PRAGMA_CILK_CLAUSE_LASTPRIVATE = PRAGMA_OMP_CLAUSE_LASTPRIVATE,
- PRAGMA_CILK_CLAUSE_REDUCTION = PRAGMA_OMP_CLAUSE_REDUCTION,
- PRAGMA_CILK_CLAUSE_UNIFORM = PRAGMA_OMP_CLAUSE_UNIFORM,
-
/* Clauses for OpenACC. */
- PRAGMA_OACC_CLAUSE_ASYNC = PRAGMA_CILK_CLAUSE_VECTORLENGTH + 1,
+ PRAGMA_OACC_CLAUSE_ASYNC,
PRAGMA_OACC_CLAUSE_AUTO,
PRAGMA_OACC_CLAUSE_COPY,
PRAGMA_OACC_CLAUSE_COPYOUT,
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index 15e13ea5a2f..de5ab4b5435 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -1482,17 +1482,6 @@ c_pretty_printer::postfix_expression (tree e)
pp_c_right_bracket (this);
break;
- case ARRAY_NOTATION_REF:
- postfix_expression (ARRAY_NOTATION_ARRAY (e));
- pp_c_left_bracket (this);
- expression (ARRAY_NOTATION_START (e));
- pp_colon (this);
- expression (ARRAY_NOTATION_LENGTH (e));
- pp_colon (this);
- expression (ARRAY_NOTATION_STRIDE (e));
- pp_c_right_bracket (this);
- break;
-
case CALL_EXPR:
{
call_expr_arg_iterator iter;
@@ -2192,7 +2181,6 @@ c_pretty_printer::expression (tree e)
case POSTINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
case ARRAY_REF:
- case ARRAY_NOTATION_REF:
case CALL_EXPR:
case COMPONENT_REF:
case BIT_FIELD_REF:
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index d857dfc3792..b2548105736 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -1330,9 +1330,9 @@ Driver
static-libmpxwrappers
Driver
-fcilkplus
+fcilkplus Undocumented
C ObjC C++ ObjC++ LTO Report Var(flag_cilkplus) Init(0)
-Enable Cilk Plus.
+Deprecated in GCC 8. This switch has no effect.
fconcepts
C++ ObjC++ Var(flag_concepts)
diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c
deleted file mode 100644
index e6df498e471..00000000000
--- a/gcc/c-family/cilk.c
+++ /dev/null
@@ -1,1363 +0,0 @@
-/* This file is part of the Intel(R) Cilk(TM) Plus support
- This file contains the CilkPlus Intrinsics
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
- Contributed by Balaji V. Iyer <balaji.v.iyer@intel.com>,
- Intel Corporation
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "function.h"
-#include "c-family/c-common.h"
-#include "gimple-expr.h"
-#include "stringpool.h"
-#include "cgraph.h"
-#include "diagnostic.h"
-#include "gimplify.h"
-#include "tree-iterator.h"
-#include "tree-inline.h"
-#include "toplev.h"
-#include "calls.h"
-#include "cilk.h"
-
-enum add_variable_type {
- /* Reference to previously-defined variable. */
- ADD_READ,
- /* Definition of a new variable in inner-scope. */
- ADD_BIND,
- /* Write to possibly previously-defined variable. */
- ADD_WRITE
-};
-
-enum cilk_block_type {
- /* Indicates a _Cilk_spawn block. 30 was an arbitary number picked for
- ease of debugging. */
- CILK_BLOCK_SPAWN = 30,
- /* Indicates _Cilk_for statement block. */
- CILK_BLOCK_FOR
-};
-
-struct wrapper_data
-{
- /* Kind of function to be created. */
- enum cilk_block_type type;
- /* Signature of helper function. */
- tree fntype;
- /* Containing function. */
- tree context;
- /* Disposition of all variables in the inner statement. */
- hash_map<tree, tree> *decl_map;
- /* True if this function needs a static chain. */
- bool nested;
- /* Arguments to be passed to wrapper function, currently a list. */
- tree arglist;
- /* Argument types, a list. */
- tree argtypes;
- /* Incoming parameters. */
- tree parms;
- /* Outer BLOCK object. */
- tree block;
-};
-
-static tree contains_cilk_spawn_stmt_walker (tree *tp, int *, void *);
-static void extract_free_variables (tree, struct wrapper_data *,
- enum add_variable_type);
-static HOST_WIDE_INT cilk_wrapper_count;
-
-/* Marks the CALL_EXPR or FUNCTION_DECL, FCALL, as a spawned function call
- and the current function as a spawner. Emit error if the function call
- is outside a function or if a non function-call is spawned. */
-
-inline bool
-cilk_set_spawn_marker (location_t loc, tree fcall)
-{
- if (!current_function_decl)
- {
- error_at (loc, "%<_Cilk_spawn%> may only be used inside a function");
- return false;
- }
- else if (fcall == error_mark_node)
- /* Error reporting here is not necessary here since if FCALL is an
- error_mark_node, the function marking it as error would have reported
- it. */
- return false;
- else if (TREE_CODE (fcall) != CALL_EXPR
- /* In C++, TARGET_EXPR is generated when we have an overloaded
- '=' operator. */
- && TREE_CODE (fcall) != TARGET_EXPR)
- {
- error_at (loc, "only function calls can be spawned");
- return false;
- }
- else
- {
- cfun->calls_cilk_spawn = true;
- if (TREE_CODE (fcall) == CALL_EXPR)
- EXPR_CILK_SPAWN (fcall) = 1;
- else /* TREE_CODE (fcall) == TARGET_EXPR */
- EXPR_CILK_SPAWN (TREE_OPERAND (fcall, 1)) = 1;
- return true;
- }
-}
-
-/* This function will output the exit conditions for a spawn call. */
-
-tree
-create_cilk_function_exit (tree frame, bool detaches, bool needs_sync)
-{
- tree epi = alloc_stmt_list ();
-
- if (needs_sync)
- append_to_statement_list (build_cilk_sync (), &epi);
- tree func_ptr = build1 (ADDR_EXPR, cilk_frame_ptr_type_decl, frame);
- tree pop_frame = build_call_expr (cilk_pop_fndecl, 1, func_ptr);
- tree worker = cilk_dot (frame, CILK_TI_FRAME_WORKER, 0);
- tree current = cilk_arrow (worker, CILK_TI_WORKER_CUR, 0);
- tree parent = cilk_dot (frame, CILK_TI_FRAME_PARENT, 0);
- tree set_current = build2 (MODIFY_EXPR, void_type_node, current, parent);
- append_to_statement_list (set_current, &epi);
- append_to_statement_list (pop_frame, &epi);
- tree call = build_call_expr (cilk_leave_fndecl, 1, func_ptr);
- if (!detaches)
- {
- tree flags = cilk_dot (frame, CILK_TI_FRAME_FLAGS, false);
- tree flags_cmp_expr = fold_build2 (NE_EXPR, TREE_TYPE (flags), flags,
- build_int_cst (TREE_TYPE (flags),
- CILK_FRAME_VERSION));
- call = fold_build3 (COND_EXPR, void_type_node, flags_cmp_expr,
- call, build_empty_stmt (EXPR_LOCATION (flags)));
- }
- append_to_statement_list (call, &epi);
- return epi;
-}
-
-/* Trying to get the correct cfun for the FUNCTION_DECL indicated by OUTER. */
-
-static void
-pop_cfun_to (tree outer)
-{
- pop_cfun ();
- current_function_decl = outer;
- gcc_assert (cfun == DECL_STRUCT_FUNCTION (current_function_decl));
- gcc_assert (cfun->decl == current_function_decl);
-}
-
-/* This function does whatever is necessary to make the compiler emit a newly
- generated function, FNDECL. */
-
-static void
-call_graph_add_fn (tree fndecl)
-{
- const tree outer = current_function_decl;
- struct function *f = DECL_STRUCT_FUNCTION (fndecl);
- gcc_assert (TREE_CODE (fndecl) == FUNCTION_DECL);
-
- f->is_cilk_function = 1;
- f->curr_properties = cfun->curr_properties;
- gcc_assert (cfun == DECL_STRUCT_FUNCTION (outer));
- gcc_assert (cfun->decl == outer);
-
- push_cfun (f);
- cgraph_node::create (fndecl);
- pop_cfun_to (outer);
-}
-
-/* Return true if this is a tree which is allowed to contain a spawn as
- operand 0.
- A spawn call may be wrapped in a series of unary operations such
- as conversions. These conversions need not be "useless"
- to be disregarded because they are retained in the spawned
- statement. They are bypassed only to look for a spawn
- within.
- A comparison to constant is simple enough to allow, and
- is used to convert to bool. */
-
-bool
-cilk_ignorable_spawn_rhs_op (tree exp)
-{
- enum tree_code code = TREE_CODE (exp);
- switch (TREE_CODE_CLASS (code))
- {
- case tcc_expression:
- return code == ADDR_EXPR;
- case tcc_comparison:
- /* We need the spawn as operand 0 for now. That's where it
- appears in the only case we really care about, conversion
- to bool. */
- return (TREE_CODE (TREE_OPERAND (exp, 1)) == INTEGER_CST);
- case tcc_unary:
- case tcc_reference:
- return true;
- default:
- return false;
- }
-}
-
-/* Helper function for walk_tree. If *TP is a CILK_SPAWN_STMT, then unwrap
- this "wrapper." The function returns NULL_TREE regardless. */
-
-static tree
-unwrap_cilk_spawn_stmt (tree *tp, int *walk_subtrees, void *)
-{
- if (TREE_CODE (*tp) == CILK_SPAWN_STMT)
- {
- *tp = CILK_SPAWN_FN (*tp);
- *walk_subtrees = 0;
- }
- return NULL_TREE;
-}
-
-/* Returns true when EXP is a CALL_EXPR with _Cilk_spawn in front. Unwraps
- CILK_SPAWN_STMT wrapper from the CALL_EXPR in *EXP0 statement. */
-
-bool
-cilk_recognize_spawn (tree exp, tree *exp0)
-{
- bool spawn_found = false;
- if (TREE_CODE (exp) == CILK_SPAWN_STMT)
- {
- /* Remove the CALL_EXPR from CILK_SPAWN_STMT wrapper. */
- exp = CILK_SPAWN_FN (exp);
- walk_tree (exp0, unwrap_cilk_spawn_stmt, NULL, NULL);
- spawn_found = true;
- }
- /* _Cilk_spawn can't be wrapped in expression such as PLUS_EXPR. */
- else if (contains_cilk_spawn_stmt (exp))
- {
- location_t loc = EXPR_LOCATION (exp);
- if (loc == UNKNOWN_LOCATION)
- {
- tree stmt = walk_tree (&exp,
- contains_cilk_spawn_stmt_walker,
- NULL,
- NULL);
- gcc_assert (stmt != NULL_TREE);
- loc = EXPR_LOCATION (stmt);
- }
- error_at (loc, "invalid use of %<_Cilk_spawn%>");
- }
- return spawn_found;
-}
-
-/* Returns true if *EXP0 is a recognized form of spawn. Recognized forms are,
- after conversion to void, a call expression at outer level or an assignment
- at outer level with the right hand side being a spawned call.
- In addition to this, it also unwraps the CILK_SPAWN_STMT cover from the
- CALL_EXPR that is being spawned.
- Note that `=' in C++ may turn into a CALL_EXPR rather than a MODIFY_EXPR. */
-
-bool
-cilk_detect_spawn_and_unwrap (tree *exp0)
-{
- tree exp = *exp0;
-
- if (!TREE_SIDE_EFFECTS (exp))
- return false;
-
- /* Strip off any conversion to void. It does not affect whether spawn
- is supported here. */
- if (TREE_CODE (exp) == CONVERT_EXPR && VOID_TYPE_P (TREE_TYPE (exp)))
- exp = TREE_OPERAND (exp, 0);
-
- if (TREE_CODE (exp) == MODIFY_EXPR || TREE_CODE (exp) == INIT_EXPR)
- exp = TREE_OPERAND (exp, 1);
-
- while (cilk_ignorable_spawn_rhs_op (exp))
- exp = TREE_OPERAND (exp, 0);
-
- if (TREE_CODE (exp) == TARGET_EXPR)
- if (TARGET_EXPR_INITIAL (exp)
- && TREE_CODE (TARGET_EXPR_INITIAL (exp)) != AGGR_INIT_EXPR)
- exp = TARGET_EXPR_INITIAL (exp);
-
- /* Happens with C++ TARGET_EXPR. */
- if (exp == NULL_TREE)
- return false;
-
- while (TREE_CODE (exp) == CLEANUP_POINT_EXPR || TREE_CODE (exp) == EXPR_STMT)
- exp = TREE_OPERAND (exp, 0);
-
- /* Now we should have a CALL_EXPR with a CILK_SPAWN_STMT wrapper around
- it, or return false. */
- if (cilk_recognize_spawn (exp, exp0))
- return true;
- return false;
-}
-
-/* This function will build and return a FUNCTION_DECL using information
- from *WD. */
-
-static tree
-create_cilk_helper_decl (struct wrapper_data *wd)
-{
- char name[20];
- if (wd->type == CILK_BLOCK_FOR)
- sprintf (name, "_cilk_for_" HOST_WIDE_INT_PRINT_DEC, cilk_wrapper_count++);
- else if (wd->type == CILK_BLOCK_SPAWN)
- sprintf (name, "_cilk_spn_" HOST_WIDE_INT_PRINT_DEC, cilk_wrapper_count++);
- else
- gcc_unreachable ();
-
- clean_symbol_name (name);
-
- tree fndecl = build_decl (DECL_SOURCE_LOCATION (current_function_decl),
- FUNCTION_DECL, get_identifier (name), wd->fntype);
-
- TREE_PUBLIC (fndecl) = 0;
- TREE_STATIC (fndecl) = 1;
- TREE_USED (fndecl) = 1;
- DECL_ARTIFICIAL (fndecl) = 0;
- DECL_IGNORED_P (fndecl) = 0;
- DECL_EXTERNAL (fndecl) = 0;
-
- DECL_CONTEXT (fndecl) = wd->context;
- tree block = make_node (BLOCK);
- DECL_INITIAL (fndecl) = block;
- TREE_USED (block) = 1;
- BLOCK_SUPERCONTEXT (block) = fndecl;
- gcc_assert (!DECL_SAVED_TREE (fndecl));
-
- /* Inlining would defeat the purpose of this wrapper.
- Either it secretly switches stack frames or it allocates
- a stable stack frame to hold function arguments even if
- the parent stack frame is stolen. */
- DECL_UNINLINABLE (fndecl) = 1;
-
- tree result_decl = build_decl (UNKNOWN_LOCATION, RESULT_DECL, NULL_TREE,
- void_type_node);
- DECL_ARTIFICIAL (result_decl) = 0;
- DECL_IGNORED_P (result_decl) = 1;
- DECL_CONTEXT (result_decl) = fndecl;
- DECL_RESULT (fndecl) = result_decl;
-
- return fndecl;
-}
-
-struct cilk_decls
-{
- tree key;
- tree *val;
-};
-
-/* A function used by traversal to fill vector of decls for further work. */
-
-bool
-fill_decls_vec (tree const &key0, tree *val0, auto_vec<struct cilk_decls> *v)
-{
- tree t1 = key0;
- struct cilk_decls dp;
-
- if (DECL_P (t1))
- {
- dp.key = t1;
- dp.val = val0;
- v->safe_push (dp);
- }
- return true;
-}
-
-/* Function that actually creates necessary parm lists. */
-
-static void
-create_parm_list (struct wrapper_data *wd, tree *val0, tree arg)
-{
- tree val = *val0;
- tree parm;
-
- if (val == error_mark_node || val == arg)
- return;
-
- if (TREE_CODE (val) == PAREN_EXPR)
- {
- /* We should not reach here with a register receiver.
- We may see a register variable modified in the
- argument list. Because register variables are
- worker-local we don't need to work hard to support
- them in code that spawns. */
- if (VAR_P (arg) && DECL_HARD_REGISTER (arg))
- {
- error_at (EXPR_LOCATION (arg),
- "explicit register variable %qD may not be modified in "
- "spawn", arg);
- arg = null_pointer_node;
- }
- else
- arg = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (arg)), arg);
-
- val = TREE_OPERAND (val, 0);
- *val0 = val;
- gcc_assert (INDIRECT_REF_P (val));
- parm = TREE_OPERAND (val, 0);
- STRIP_NOPS (parm);
- }
- else
- parm = val;
- TREE_CHAIN (parm) = wd->parms;
- wd->parms = parm;
- wd->argtypes = tree_cons (NULL_TREE, TREE_TYPE (parm), wd->argtypes);
- wd->arglist = tree_cons (NULL_TREE, arg, wd->arglist);
-}
-
-/* Sorting decls in a vector. */
-
-static int
-compare_decls (const void *a, const void *b)
-{
- const struct cilk_decls *t1 = (const struct cilk_decls *) a;
- const struct cilk_decls *t2 = (const struct cilk_decls *) b;
-
- if (DECL_UID (t1->key) > DECL_UID (t2->key))
- return 1;
- else if (DECL_UID (t1->key) < DECL_UID (t2->key))
- return -1;
- else
- return 0;
-}
-
-/* This function is used to build a wrapper of a certain type. */
-
-static void
-build_wrapper_type (struct wrapper_data *wd)
-{
- unsigned int j;
- struct cilk_decls * c;
- auto_vec<struct cilk_decls> vd;
- wd->arglist = NULL_TREE;
- wd->parms = NULL_TREE;
- wd->argtypes = void_list_node;
-
- gcc_assert (wd->type != CILK_BLOCK_FOR);
- wd->decl_map->traverse<auto_vec<struct cilk_decls> *, fill_decls_vec> (&vd);
- vd.qsort (compare_decls);
-
- FOR_EACH_VEC_ELT (vd, j, c)
- create_parm_list (wd, c->val, c->key);
-
- /* Now build a function.
- Its return type is void (all side effects are via explicit parameters).
- Its parameters are WRAPPER_PARMS with type WRAPPER_TYPES.
- Actual arguments in the caller are WRAPPER_ARGS. */
- wd->fntype = build_function_type (void_type_node, wd->argtypes);
-}
-
-/* This function checks all the CALL_EXPRs in *TP found by cilk_outline. */
-
-static tree
-check_outlined_calls (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
- void *data)
-{
- bool *throws = (bool *) data;
- tree t = *tp;
- int flags;
-
- if (TREE_CODE (t) != CALL_EXPR)
- return 0;
- flags = call_expr_flags (t);
-
- if (!(flags & ECF_NOTHROW) && flag_exceptions)
- *throws = true;
- if (flags & ECF_RETURNS_TWICE)
- error_at (EXPR_LOCATION (t),
- "cannot spawn call to function that returns twice");
- return 0;
-}
-
-/* Each DECL in the source code (spawned statement) is passed to this function
- once. Each instance of the DECL is replaced with the result of this
- function.
-
- The parameters of the wrapper should have been entered into the map already.
- This function only deals with variables with scope limited to the
- spawned expression. */
-
-static tree
-copy_decl_for_cilk (tree decl, copy_body_data *id)
-{
- switch (TREE_CODE (decl))
- {
- case VAR_DECL:
- return copy_decl_no_change (decl, id);
-
- case LABEL_DECL:
- error_at (EXPR_LOCATION (decl), "invalid use of label %q+D in "
- "%<_Cilk_spawn%>",
- decl);
- return error_mark_node;
-
- case RESULT_DECL:
- case PARM_DECL:
- /* RESULT_DECL and PARM_DECL has already been entered into the map. */
- default:
- gcc_unreachable ();
- return error_mark_node;
- }
-}
-
-/* Alter a tree STMT from OUTER_FN to form the body of INNER_FN. */
-
-void
-cilk_outline (tree inner_fn, tree *stmt_p, void *w)
-{
- struct wrapper_data *wd = (struct wrapper_data *) w;
- const tree outer_fn = wd->context;
- const bool nested = (wd->type == CILK_BLOCK_FOR);
- copy_body_data id;
- bool throws;
- auto_vec<struct cilk_decls> vd;
- unsigned int j;
- struct cilk_decls * c;
-
- DECL_STATIC_CHAIN (outer_fn) = 1;
-
- memset (&id, 0, sizeof (id));
- /* Copy from the function containing the spawn... */
- id.src_fn = outer_fn;
-
- /* ...to the wrapper. */
- id.dst_fn = inner_fn;
- id.src_cfun = DECL_STRUCT_FUNCTION (outer_fn);
-
- /* There shall be no RETURN in spawn helper. */
- id.retvar = 0;
- id.decl_map = wd->decl_map;
- id.copy_decl = nested ? copy_decl_no_change : copy_decl_for_cilk;
- id.block = DECL_INITIAL (inner_fn);
- id.transform_lang_insert_block = NULL;
-
- id.transform_new_cfg = true;
- id.transform_call_graph_edges = CB_CGE_MOVE;
- id.remap_var_for_cilk = true;
- id.regimplify = true; /* unused? */
-
- insert_decl_map (&id, wd->block, DECL_INITIAL (inner_fn));
-
- wd->decl_map->traverse<auto_vec<struct cilk_decls> *, fill_decls_vec> (&vd);
- vd.qsort (compare_decls);
- /* We don't want the private variables any more. */
- FOR_EACH_VEC_ELT (vd, j, c)
- if (*(c->val) == error_mark_node)
- *(c->val) = nested ? copy_decl_no_change (c->key, &id)
- : copy_decl_for_cilk (c->key, &id);
-
- walk_tree (stmt_p, copy_tree_body_r, (void *) &id, NULL);
-
- /* See if this function can throw or calls something that should
- not be spawned. The exception part is only necessary if
- flag_exceptions && !flag_non_call_exceptions. */
- throws = false ;
- (void) walk_tree_without_duplicates (stmt_p, check_outlined_calls, &throws);
-}
-
-/* Generate the body of a wrapper function that assigns the
- result of the expression RHS into RECEIVER. RECEIVER must
- be NULL if this is not a spawn -- the wrapper will return
- a value. If this is a spawn, the wrapper will return void. */
-
-static tree
-create_cilk_wrapper_body (tree stmt, struct wrapper_data *wd)
-{
- const tree outer = current_function_decl;
- tree fndecl;
- tree p;
-
- /* Build the type of the wrapper and its argument list from the
- variables that it requires. */
- build_wrapper_type (wd);
-
- /* Emit a function that takes WRAPPER_PARMS incoming and applies ARGS
- (modified) to the wrapped function. Return the wrapper and modified ARGS
- to the caller to generate a function call. */
- fndecl = create_cilk_helper_decl (wd);
- push_struct_function (fndecl);
- if (wd->nested && (wd->type == CILK_BLOCK_FOR))
- {
- gcc_assert (TREE_VALUE (wd->arglist) == NULL_TREE);
- TREE_VALUE (wd->arglist) = build2 (FDESC_EXPR, ptr_type_node,
- fndecl, integer_one_node);
- }
- DECL_ARGUMENTS (fndecl) = wd->parms;
-
- for (p = wd->parms; p; p = TREE_CHAIN (p))
- DECL_CONTEXT (p) = fndecl;
-
- /* The statement containing the spawn expression might create temporaries with
- destructors defined; if so we need to add a CLEANUP_POINT_EXPR to ensure
- the expression is properly gimplified. */
- stmt = fold_build_cleanup_point_expr (void_type_node, stmt);
-
- gcc_assert (!DECL_SAVED_TREE (fndecl));
- cilk_install_body_with_frame_cleanup (fndecl, stmt, (void *) wd);
- gcc_assert (DECL_SAVED_TREE (fndecl));
-
- pop_cfun_to (outer);
-
- /* Recognize the new function. */
- call_graph_add_fn (fndecl);
- return fndecl;
-}
-
-/* Initializes the wrapper data structure. */
-
-static void
-init_wd (struct wrapper_data *wd, enum cilk_block_type type)
-{
- wd->type = type;
- wd->fntype = NULL_TREE;
- wd->context = current_function_decl;
- wd->decl_map = new hash_map<tree, tree>;
- /* _Cilk_for bodies are always nested. Others start off as
- normal functions. */
- wd->nested = (type == CILK_BLOCK_FOR);
- wd->arglist = NULL_TREE;
- wd->argtypes = NULL_TREE;
- wd->block = NULL_TREE;
-}
-
-/* Clears the wrapper data structure. */
-
-static void
-free_wd (struct wrapper_data *wd)
-{
- delete wd->decl_map;
- wd->nested = false;
- wd->arglist = NULL_TREE;
- wd->argtypes = NULL_TREE;
- wd->parms = NULL_TREE;
-}
-
-
- /* Given a variable in an expression to be extracted into
- a helper function, declare the helper function parameter
- to receive it.
-
- On entry the value of the (key, value) pair may be
-
- (*, error_mark_node) -- Variable is private to helper function,
- do nothing.
-
- (var, var) -- Reference to outer scope (function or global scope).
-
- (var, integer 0) -- Capture by value, save newly-declared PARM_DECL
- for value in value slot.
-
- (var, integer 1) -- Capture by reference, declare pointer to type
- as new PARM_DECL and store (spawn_stmt (indirect_ref (parm)).
-
- (var, ???) -- Pure output argument, handled similarly to above.
-*/
-
-bool
-declare_one_free_variable (tree var0, tree *map0)
-{
- const_tree var = var0;
- tree map = *map0;
- tree var_type = TREE_TYPE (var), arg_type;
- bool by_reference;
- tree parm;
-
- gcc_assert (DECL_P (var));
-
- /* Ignore truly local variables. */
- if (map == error_mark_node)
- return true;
- /* Ignore references to the parent function. */
- if (map == var)
- return true;
-
- gcc_assert (TREE_CODE (map) == INTEGER_CST);
-
- /* A value is passed by reference if:
-
- 1. It is addressable, so that a copy may not be made.
- 2. It is modified in the spawned statement.
- In the future this function may want to arrange
- a warning if the spawned statement is a loop body
- because an output argument would indicate a race.
- Note: Earlier passes must have marked the variable addressable.
- 3. It is expensive to copy. */
- by_reference =
- (TREE_ADDRESSABLE (var_type)
- /* Arrays must be passed by reference. This is required for C
- semantics -- arrays are not first class objects. Other
- aggregate types can and should be passed by reference if
- they are not passed to the spawned function. We aren't yet
- distinguishing safe uses in argument calculation from unsafe
- uses as outgoing function arguments, so we make a copy to
- stabilize the value. */
- || TREE_CODE (var_type) == ARRAY_TYPE
- || (tree) map == integer_one_node);
-
- if (by_reference)
- var_type = build_qualified_type (build_pointer_type (var_type),
- TYPE_QUAL_RESTRICT);
- gcc_assert (!TREE_ADDRESSABLE (var_type));
-
- /* Maybe promote to int. */
- if (INTEGRAL_TYPE_P (var_type) && COMPLETE_TYPE_P (var_type)
- && tree_int_cst_lt (TYPE_SIZE (var_type), TYPE_SIZE (integer_type_node)))
- arg_type = integer_type_node;
- else
- arg_type = var_type;
-
- parm = build_decl (UNKNOWN_LOCATION, PARM_DECL, NULL_TREE, var_type);
- DECL_ARG_TYPE (parm) = arg_type;
- DECL_ARTIFICIAL (parm) = 0;
- TREE_READONLY (parm) = 1;
-
- if (by_reference)
- {
- parm = build1 (INDIRECT_REF, TREE_TYPE (var_type), parm);
- parm = build1 (PAREN_EXPR, void_type_node, parm);
- }
- *map0 = parm;
- return true;
-}
-
-/* Returns a wrapper function for a _Cilk_spawn. */
-
-static tree
-create_cilk_wrapper (tree exp, tree *args_out)
-{
- struct wrapper_data wd;
- tree fndecl;
- unsigned int j;
- struct cilk_decls * c;
- auto_vec<struct cilk_decls> vd;
-
- init_wd (&wd, CILK_BLOCK_SPAWN);
-
- if (TREE_CODE (exp) == CONVERT_EXPR)
- exp = TREE_OPERAND (exp, 0);
-
- /* Special handling for top level INIT_EXPR. Usually INIT_EXPR means the
- variable is defined in the spawned expression and can be private to the
- spawn helper. A top level INIT_EXPR defines a variable to be initialized
- by spawn and the variable must remain in the outer function. */
- if (TREE_CODE (exp) == INIT_EXPR)
- {
- extract_free_variables (TREE_OPERAND (exp, 0), &wd, ADD_WRITE);
- extract_free_variables (TREE_OPERAND (exp, 1), &wd, ADD_READ);
- /* TREE_TYPE should be void. Be defensive. */
- if (TREE_TYPE (exp) != void_type_node)
- extract_free_variables (TREE_TYPE (exp), &wd, ADD_READ);
- }
- else
- extract_free_variables (exp, &wd, ADD_READ);
- wd.decl_map->traverse<auto_vec<struct cilk_decls> *, fill_decls_vec> (&vd);
- vd.qsort (compare_decls);
- FOR_EACH_VEC_ELT (vd, j, c)
- declare_one_free_variable (c->key, c->val);
-
- wd.block = TREE_BLOCK (exp);
- if (!wd.block)
- wd.block = DECL_INITIAL (current_function_decl);
-
- /* Now fvars maps the old variable to incoming variable. Update
- the expression and arguments to refer to the new names. */
- fndecl = create_cilk_wrapper_body (exp, &wd);
- *args_out = wd.arglist;
-
- free_wd (&wd);
-
- return fndecl;
-}
-
-/* Transform *SPAWN_P, a spawned CALL_EXPR, to gimple. *SPAWN_P can be a
- CALL_EXPR, INIT_EXPR or MODIFY_EXPR. Returns GS_OK if everything is fine,
- and GS_UNHANDLED, otherwise. */
-
-int
-gimplify_cilk_spawn (tree *spawn_p)
-{
- tree expr = *spawn_p;
- tree function, call1, call2, new_args;
- tree ii_args = NULL_TREE;
- int total_args = 0, ii = 0;
- tree *arg_array;
- tree setjmp_cond_expr = NULL_TREE;
- tree setjmp_expr, spawn_expr, setjmp_value = NULL_TREE;
-
- cfun->calls_cilk_spawn = 1;
- cfun->is_cilk_function = 1;
-
- /* Remove CLEANUP_POINT_EXPR and EXPR_STMT from *spawn_p. */
- while (TREE_CODE (expr) == CLEANUP_POINT_EXPR
- || TREE_CODE (expr) == EXPR_STMT)
- expr = TREE_OPERAND (expr, 0);
-
- new_args = NULL;
- function = create_cilk_wrapper (expr, &new_args);
-
- /* This should give the number of parameters. */
- total_args = list_length (new_args);
- if (total_args)
- arg_array = XNEWVEC (tree, total_args);
- else
- arg_array = NULL;
-
- ii_args = new_args;
- for (ii = 0; ii < total_args; ii++)
- {
- arg_array[ii] = TREE_VALUE (ii_args);
- ii_args = TREE_CHAIN (ii_args);
- }
-
- TREE_USED (function) = 1;
- rest_of_decl_compilation (function, 0, 0);
-
- call1 = cilk_call_setjmp (cfun->cilk_frame_decl);
-
- if (arg_array == NULL || *arg_array == NULL_TREE)
- call2 = build_call_expr (function, 0);
- else
- call2 = build_call_expr_loc_array (EXPR_LOCATION (*spawn_p), function,
- total_args, arg_array);
- *spawn_p = alloc_stmt_list ();
- tree f_ptr_type = build_pointer_type (TREE_TYPE (cfun->cilk_frame_decl));
- tree frame_ptr = build1 (ADDR_EXPR, f_ptr_type, cfun->cilk_frame_decl);
- tree save_fp = build_call_expr (cilk_save_fp_fndecl, 1, frame_ptr);
- append_to_statement_list (save_fp, spawn_p);
- setjmp_value = create_tmp_var (TREE_TYPE (call1));
- setjmp_expr = fold_build2 (MODIFY_EXPR, void_type_node, setjmp_value, call1);
-
- append_to_statement_list_force (setjmp_expr, spawn_p);
-
- setjmp_cond_expr = fold_build2 (EQ_EXPR, TREE_TYPE (call1), setjmp_value,
- build_int_cst (TREE_TYPE (call1), 0));
- spawn_expr = fold_build3 (COND_EXPR, void_type_node, setjmp_cond_expr,
- call2, build_empty_stmt (EXPR_LOCATION (call1)));
- append_to_statement_list (spawn_expr, spawn_p);
-
- free (arg_array);
- return GS_OK;
-}
-
-/* Make the frames necessary for a spawn call. */
-
-tree
-make_cilk_frame (tree fn)
-{
- struct function *f = DECL_STRUCT_FUNCTION (fn);
- tree decl;
-
- if (f->cilk_frame_decl)
- return f->cilk_frame_decl;
-
- decl = build_decl (EXPR_LOCATION (fn), VAR_DECL, NULL_TREE,
- cilk_frame_type_decl);
- DECL_CONTEXT (decl) = fn;
- DECL_SEEN_IN_BIND_EXPR_P (decl) = 1;
- f->cilk_frame_decl = decl;
- return decl;
-}
-
-/* Add a new variable, VAR to a variable list in WD->DECL_MAP. HOW indicates
- whether the variable is previously defined, currently defined, or a variable
- that is being written to. */
-
-static void
-add_variable (struct wrapper_data *wd, tree var, enum add_variable_type how)
-{
- tree *valp = wd->decl_map->get (var);
- if (valp)
- {
- tree val = (tree) *valp;
- /* If the variable is local, do nothing. */
- if (val == error_mark_node)
- return;
- /* If the variable was entered with itself as value,
- meaning it belongs to an outer scope, do not alter
- the value. */
- if (val == var)
- return;
- /* A statement expression may cause a variable to be
- bound twice, once in BIND_EXPR and again in a
- DECL_EXPR. That case caused a return in the
- test above. Any other duplicate definition is
- an error. */
- gcc_assert (how != ADD_BIND);
- if (how != ADD_WRITE)
- return;
- /* This variable might have been entered as read but is now written. */
- *valp = var;
- wd->nested = true;
- return;
- }
- else
- {
- tree val = NULL_TREE;
-
- /* Nested function rewriting silently discards hard register
- assignments for function scope variables, and they wouldn't
- work anyway. Warn here. This misses one case: if the
- register variable is used as the loop bound or increment it
- has already been added to the map. */
- if ((how != ADD_BIND) && VAR_P (var)
- && !DECL_EXTERNAL (var) && DECL_HARD_REGISTER (var))
- warning (0, "register assignment ignored for %qD used in Cilk block",
- var);
-
- switch (how)
- {
- /* ADD_BIND means always make a fresh new variable. */
- case ADD_BIND:
- val = error_mark_node;
- break;
- /* ADD_READ means
- 1. For cilk_for, refer to the outer scope definition as-is
- 2. For a spawned block, take a scalar in an rgument
- and otherwise refer to the outer scope definition as-is.
- 3. For a spawned call, take a scalar in an argument. */
- case ADD_READ:
- switch (wd->type)
- {
- case CILK_BLOCK_FOR:
- val = var;
- break;
- case CILK_BLOCK_SPAWN:
- if (TREE_ADDRESSABLE (var))
- {
- val = var;
- wd->nested = true;
- break;
- }
- val = integer_zero_node;
- break;
- }
- break;
- case ADD_WRITE:
- switch (wd->type)
- {
- case CILK_BLOCK_FOR:
- val = var;
- wd->nested = true;
- break;
- case CILK_BLOCK_SPAWN:
- if (TREE_ADDRESSABLE (var))
- val = integer_one_node;
- else
- {
- val = var;
- wd->nested = true;
- }
- break;
- }
- }
- wd->decl_map->put (var, val);
- }
-}
-
-/* Find the variables referenced in an expression T. This does not avoid
- duplicates because a variable may be read in one context and written in
- another. HOW describes the context in which the reference is seen. If
- NESTED is true a nested function is being generated and variables in the
- original context should not be remapped. */
-
-static void
-extract_free_variables (tree t, struct wrapper_data *wd,
- enum add_variable_type how)
-{
- if (t == NULL_TREE)
- return;
-
- enum tree_code code = TREE_CODE (t);
- bool is_expr = IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code));
-
- if (is_expr)
- extract_free_variables (TREE_TYPE (t), wd, ADD_READ);
-
- switch (code)
- {
- case ERROR_MARK:
- case IDENTIFIER_NODE:
- case VOID_CST:
- case INTEGER_CST:
- case REAL_CST:
- case FIXED_CST:
- case STRING_CST:
- case BLOCK:
- case PLACEHOLDER_EXPR:
- case FIELD_DECL:
- case VOID_TYPE:
- case REAL_TYPE:
- /* These do not contain variable references. */
- return;
-
- case SSA_NAME:
- /* Currently we don't see SSA_NAME. */
- extract_free_variables (SSA_NAME_VAR (t), wd, how);
- return;
-
- case LABEL_DECL:
- /* This might be a reference to a label outside the Cilk block,
- which is an error, or a reference to a label in the Cilk block
- that we haven't seen yet. We can't tell. Ignore it. An
- invalid use will cause an error later in copy_decl_for_cilk. */
- return;
-
- case RESULT_DECL:
- if (wd->type != CILK_BLOCK_SPAWN)
- TREE_ADDRESSABLE (t) = 1;
- /* FALLTHRU */
- case VAR_DECL:
- case PARM_DECL:
- if (!is_global_var (t))
- add_variable (wd, t, how);
- return;
-
- case NON_LVALUE_EXPR:
- case CONVERT_EXPR:
- case NOP_EXPR:
- extract_free_variables (TREE_OPERAND (t, 0), wd, ADD_READ);
- return;
-
- case VEC_INIT_EXPR:
- case INIT_EXPR:
- extract_free_variables (TREE_OPERAND (t, 0), wd, ADD_BIND);
- extract_free_variables (TREE_OPERAND (t, 1), wd, ADD_READ);
- return;
-
- case MODIFY_EXPR:
- case PREDECREMENT_EXPR:
- case PREINCREMENT_EXPR:
- case POSTDECREMENT_EXPR:
- case POSTINCREMENT_EXPR:
- /* These write their result. */
- extract_free_variables (TREE_OPERAND (t, 0), wd, ADD_WRITE);
- extract_free_variables (TREE_OPERAND (t, 1), wd, ADD_READ);
- return;
-
- case ADDR_EXPR:
- /* This might modify its argument, and the value needs to be
- passed by reference in any case to preserve identity and
- type if is a promoting type. In the case of a nested loop
- just notice that we touch the variable. It will already
- be addressable, and marking it modified will cause a spurious
- warning about writing the control variable. */
- if (wd->type != CILK_BLOCK_SPAWN)
- extract_free_variables (TREE_OPERAND (t, 0), wd, ADD_READ);
- else
- extract_free_variables (TREE_OPERAND (t, 0), wd, ADD_WRITE);
- return;
-
- case ARRAY_REF:
- /* Treating ARRAY_REF and BIT_FIELD_REF identically may
- mark the array as written but the end result is correct
- because the array is passed by pointer anyway. */
- case BIT_FIELD_REF:
- /* Propagate the access type to the object part of which
- is being accessed here. As for ADDR_EXPR, don't do this
- in a nested loop, unless the access is to a fixed index. */
- if (wd->type != CILK_BLOCK_FOR || TREE_CONSTANT (TREE_OPERAND (t, 1)))
- extract_free_variables (TREE_OPERAND (t, 0), wd, how);
- else
- extract_free_variables (TREE_OPERAND (t, 0), wd, ADD_READ);
- extract_free_variables (TREE_OPERAND (t, 1), wd, ADD_READ);
- extract_free_variables (TREE_OPERAND (t, 2), wd, ADD_READ);
- return;
-
- case TREE_LIST:
- extract_free_variables (TREE_PURPOSE (t), wd, ADD_READ);
- extract_free_variables (TREE_VALUE (t), wd, ADD_READ);
- extract_free_variables (TREE_CHAIN (t), wd, ADD_READ);
- return;
-
- case TREE_VEC:
- {
- int len = TREE_VEC_LENGTH (t);
- int i;
- for (i = 0; i < len; i++)
- extract_free_variables (TREE_VEC_ELT (t, i), wd, ADD_READ);
- return;
- }
-
- case VECTOR_CST:
- {
- unsigned ii = 0;
- for (ii = 0; ii < VECTOR_CST_NELTS (t); ii++)
- extract_free_variables (VECTOR_CST_ELT (t, ii), wd, ADD_READ);
- break;
- }
-
- case COMPLEX_CST:
- extract_free_variables (TREE_REALPART (t), wd, ADD_READ);
- extract_free_variables (TREE_IMAGPART (t), wd, ADD_READ);
- return;
-
- case BIND_EXPR:
- {
- tree decl;
- for (decl = BIND_EXPR_VARS (t); decl; decl = TREE_CHAIN (decl))
- {
- add_variable (wd, decl, ADD_BIND);
- /* A self-referential initialization is no problem because
- we already entered the variable into the map as local. */
- extract_free_variables (DECL_INITIAL (decl), wd, ADD_READ);
- extract_free_variables (DECL_SIZE (decl), wd, ADD_READ);
- extract_free_variables (DECL_SIZE_UNIT (decl), wd, ADD_READ);
- }
- extract_free_variables (BIND_EXPR_BODY (t), wd, ADD_READ);
- return;
- }
-
- case STATEMENT_LIST:
- {
- tree_stmt_iterator i;
- for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
- extract_free_variables (*tsi_stmt_ptr (i), wd, ADD_READ);
- return;
- }
-
- case TARGET_EXPR:
- {
- extract_free_variables (TREE_OPERAND (t, 0), wd, ADD_BIND);
- extract_free_variables (TREE_OPERAND (t, 1), wd, ADD_READ);
- extract_free_variables (TREE_OPERAND (t, 2), wd, ADD_READ);
- if (TREE_OPERAND (t, 3) != TREE_OPERAND (t, 1))
- extract_free_variables (TREE_OPERAND (t, 3), wd, ADD_READ);
- return;
- }
-
- case RETURN_EXPR:
- if (TREE_NO_WARNING (t))
- {
- gcc_assert (errorcount);
- return;
- }
- return;
-
- case DECL_EXPR:
- if (TREE_CODE (DECL_EXPR_DECL (t)) != TYPE_DECL)
- extract_free_variables (DECL_EXPR_DECL (t), wd, ADD_BIND);
- return;
-
- case INTEGER_TYPE:
- case ENUMERAL_TYPE:
- case BOOLEAN_TYPE:
- extract_free_variables (TYPE_MIN_VALUE (t), wd, ADD_READ);
- extract_free_variables (TYPE_MAX_VALUE (t), wd, ADD_READ);
- return;
-
- case POINTER_TYPE:
- extract_free_variables (TREE_TYPE (t), wd, ADD_READ);
- break;
-
- case ARRAY_TYPE:
- extract_free_variables (TREE_TYPE (t), wd, ADD_READ);
- extract_free_variables (TYPE_DOMAIN (t), wd, ADD_READ);
- return;
-
- case RECORD_TYPE:
- extract_free_variables (TYPE_FIELDS (t), wd, ADD_READ);
- return;
-
- case METHOD_TYPE:
- extract_free_variables (TYPE_ARG_TYPES (t), wd, ADD_READ);
- extract_free_variables (TYPE_METHOD_BASETYPE (t), wd, ADD_READ);
- return;
-
- case AGGR_INIT_EXPR:
- {
- int len = 0;
- int ii = 0;
- extract_free_variables (TREE_OPERAND (t, 1), wd, ADD_READ);
- if (TREE_CODE (TREE_OPERAND (t, 0)) == INTEGER_CST)
- {
- len = TREE_INT_CST_LOW (TREE_OPERAND (t, 0));
-
- for (ii = 3; ii < len; ii++)
- extract_free_variables (TREE_OPERAND (t, ii), wd, ADD_READ);
- extract_free_variables (TREE_TYPE (t), wd, ADD_READ);
- }
- break;
- }
-
- case CALL_EXPR:
- {
- int len = 0;
- int ii = 0;
- if (TREE_CODE (TREE_OPERAND (t, 0)) == INTEGER_CST)
- {
- len = TREE_INT_CST_LOW (TREE_OPERAND (t, 0));
-
- for (ii = 0; ii < len; ii++)
- extract_free_variables (TREE_OPERAND (t, ii), wd, ADD_READ);
- extract_free_variables (TREE_TYPE (t), wd, ADD_READ);
- }
- break;
- }
-
- case CONSTRUCTOR:
- {
- unsigned HOST_WIDE_INT idx = 0;
- constructor_elt *ce;
- for (idx = 0; vec_safe_iterate (CONSTRUCTOR_ELTS (t), idx, &ce); idx++)
- extract_free_variables (ce->value, wd, ADD_READ);
- break;
- }
-
- default:
- if (is_expr)
- {
- int i, len;
-
- /* Walk over all the sub-trees of this operand. */
- len = TREE_CODE_LENGTH (code);
-
- /* Go through the subtrees. We need to do this in forward order so
- that the scope of a FOR_EXPR is handled properly. */
- for (i = 0; i < len; ++i)
- extract_free_variables (TREE_OPERAND (t, i), wd, ADD_READ);
- }
- }
-}
-
-/* Add appropriate frames needed for a Cilk spawned function call, FNDECL.
- Returns the __cilkrts_stack_frame * variable. */
-
-tree
-insert_cilk_frame (tree fndecl)
-{
- tree addr, body, enter, out, orig_body;
- location_t loc = EXPR_LOCATION (fndecl);
-
- if (!cfun || cfun->decl != fndecl)
- push_cfun (DECL_STRUCT_FUNCTION (fndecl));
-
- tree decl = cfun->cilk_frame_decl;
- if (!decl)
- {
- tree *saved_tree = &DECL_SAVED_TREE (fndecl);
- decl = make_cilk_frame (fndecl);
- add_local_decl (cfun, decl);
-
- addr = build1 (ADDR_EXPR, cilk_frame_ptr_type_decl, decl);
- enter = build_call_expr (cilk_enter_fndecl, 1, addr);
- out = create_cilk_function_exit (cfun->cilk_frame_decl, false, true);
-
- /* The new body will be:
- __cilkrts_enter_frame_1 (&sf);
- try {
- orig_body;
- }
- finally {
- __cilkrts_pop_frame (&sf);
- __cilkrts_leave_frame (&sf);
- } */
-
- body = alloc_stmt_list ();
- orig_body = *saved_tree;
-
- if (TREE_CODE (orig_body) == BIND_EXPR)
- orig_body = BIND_EXPR_BODY (orig_body);
-
- append_to_statement_list (enter, &body);
- append_to_statement_list (build_stmt (loc, TRY_FINALLY_EXPR, orig_body,
- out), &body);
- if (TREE_CODE (*saved_tree) == BIND_EXPR)
- BIND_EXPR_BODY (*saved_tree) = body;
- else
- *saved_tree = body;
- }
- return decl;
-}
-
-/* Wraps CALL, a CALL_EXPR, into a CILK_SPAWN_STMT tree and returns it. */
-
-tree
-build_cilk_spawn (location_t loc, tree call)
-{
- if (!cilk_set_spawn_marker (loc, call))
- return error_mark_node;
- tree spawn_stmt = build1 (CILK_SPAWN_STMT, TREE_TYPE (call), call);
- TREE_SIDE_EFFECTS (spawn_stmt) = 1;
- return spawn_stmt;
-}
-
-/* Returns a tree of type CILK_SYNC_STMT. */
-
-tree
-build_cilk_sync (void)
-{
- tree sync = build0 (CILK_SYNC_STMT, void_type_node);
- TREE_SIDE_EFFECTS (sync) = 1;
- return sync;
-}
-
-/* Helper for contains_cilk_spawn_stmt, callback for walk_tree. Return
- non-null tree if TP contains CILK_SPAWN_STMT. */
-
-static tree
-contains_cilk_spawn_stmt_walker (tree *tp, int *, void *)
-{
- if (TREE_CODE (*tp) == CILK_SPAWN_STMT)
- return *tp;
- else
- return NULL_TREE;
-}
-
-/* Returns true if EXPR or any of its subtrees contain CILK_SPAWN_STMT
- node. */
-
-bool
-contains_cilk_spawn_stmt (tree expr)
-{
- return walk_tree (&expr, contains_cilk_spawn_stmt_walker, NULL, NULL)
- != NULL_TREE;
-}
-
-/* Return a error location for EXPR if LOC is not set. */
-
-static location_t
-get_error_location (tree expr, location_t loc)
-{
- if (loc == UNKNOWN_LOCATION)
- {
- if (TREE_CODE (expr) == MODIFY_EXPR)
- expr = TREE_OPERAND (expr, 0);
- loc = EXPR_LOCATION (expr);
- }
- return loc;
-}
-
-/* Check that no array notation or spawn statement is in EXPR.
- If not true generate an error at LOC for ARRAY_GMSGID or
- SPAWN_MSGID. */
-
-bool
-check_no_cilk (tree expr, const char *array_msgid, const char *spawn_msgid,
- location_t loc)
-{
- if (!flag_cilkplus)
- return false;
- if (contains_array_notation_expr (expr))
- {
- loc = get_error_location (expr, loc);
- error_at (loc, array_msgid);
- return true;
- }
- if (walk_tree (&expr, contains_cilk_spawn_stmt_walker, NULL, NULL))
- {
- loc = get_error_location (expr, loc);
- error_at (loc, spawn_msgid);
- return true;
- }
- return false;
-}
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index cb1cd308cea..ff730438258 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,31 @@
+2017-11-28 Julia Koval <julia.koval@intel.com>
+ Sebastian Peryt <sebastian.peryt@intel.com>
+
+ * Make-lang.in (c/c-array-notation.o): Remove.
+ * c-array-notation.c: Delete.
+ * c-decl.c: Remove cilkplus condition.
+ * c-parser.c (c_parser_cilk_simd, c_parser_cilk_for,
+ c_parser_cilk_verify_simd, c_parser_array_notation,
+ c_parser_cilk_clause_vectorlength, c_parser_cilk_grainsize,
+ c_parser_cilk_simd_fn_vector_attrs,
+ c_finish_cilk_simd_fn_tokens): Delete.
+ (c_parser_declaration_or_fndef): Remove cilkplus condition.
+ (c_parser_direct_declarator_inner): Ditto.
+ (CILK_SIMD_FN_CLAUSE_MASK): Delete.
+ (c_parser_attributes, c_parser_compound_statement,
+ c_parser_statement_after_labels, c_parser_if_statement,
+ c_parser_switch_statement, c_parser_while_statement,
+ c_parser_do_statement, c_parser_for_statement,
+ c_parser_unary_expression, c_parser_postfix_expression,
+ c_parser_postfix_expression_after_primary,
+ c_parser_pragma, c_parser_omp_clause_name, c_parser_omp_all_clauses,
+ c_parser_omp_for_loop, c_finish_omp_declare_simd): Remove cilkplus
+ support.
+ * c-typeck.c (build_array_ref, build_function_call_vec,
+ convert_arguments,
+ lvalue_p, build_compound_expr, c_finish_return, c_finish_if_stmt,
+ c_finish_loop, build_binary_op): Remove cilkplus support.
+
2017-11-28 Jakub Jelinek <jakub@redhat.com>
* c-typeck.c (c_start_case): Build SWITCH_EXPR using build2 instead
diff --git a/gcc/c/Make-lang.in b/gcc/c/Make-lang.in
index b194f227646..55da6784993 100644
--- a/gcc/c/Make-lang.in
+++ b/gcc/c/Make-lang.in
@@ -51,7 +51,7 @@ CFLAGS-c/gccspec.o += $(DRIVER_DEFINES)
# Language-specific object files for C and Objective C.
C_AND_OBJC_OBJS = attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o \
c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o \
- c/c-array-notation.o c/c-fold.o c/gimple-parser.o \
+ c/c-fold.o c/gimple-parser.o \
$(C_COMMON_OBJS) $(C_TARGET_OBJS)
# Language-specific object files for C.
diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c
deleted file mode 100644
index 40f1cfdabb8..00000000000
--- a/gcc/c/c-array-notation.c
+++ /dev/null
@@ -1,1407 +0,0 @@
-/* This file is part of the Intel(R) Cilk(TM) Plus support
- This file contains routines to handle Array Notation expression
- handling routines in the C Compiler.
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
- Contributed by Balaji V. Iyer <balaji.v.iyer@intel.com>,
- Intel Corporation.
-
- This file is part of GCC.
-
- GCC is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GCC is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3. If not see
- <http://www.gnu.org/licenses/>. */
-
-/* The Array Notation Transformation Technique:
-
- An array notation expression has 4 major components:
- 1. The array name
- 2. Start Index
- 3. Number of elements we need to access (we call it length)
- 4. Stride
-
- For example, A[0:5:2], implies that we are accessing A[0], A[2], A[4],
- A[6] and A[8]. The user is responsible to make sure the access length does
- not step outside the array's size.
-
- In this section, I highlight the overall method on how array notations are
- broken up into C/C++ code. Almost all the functions follows this overall
- technique:
-
- Let's say we have an array notation in a statement like this:
-
- A[St1:Ln:Str1] = B[St2:Ln:Str2] + <NON ARRAY_NOTATION_STMT>
-
- where St{1,2} = Starting index,
- Ln = Number of elements we need to access,
- and Str{1,2} = the stride.
- Note: The length of both the array notation expressions must be the same.
-
- The above expression is broken into the following
- (with the help of c_finish_loop function from c-typeck.c):
-
- Tmp_Var = 0;
- goto compare_label:
- body_label:
-
- A[St1+Tmp_Var*Str1] = B[St1+Tmp_Var*Str2] + <NON ARRAY_NOTATION_STMT>;
- Tmp_Var++;
-
- compare_label:
- if (Tmp_Var < Ln)
- goto body_label;
- else
- goto exit_label;
- exit_label:
-
-*/
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "c-tree.h"
-#include "gimple-expr.h"
-#include "tree-iterator.h"
-
-/* If *VALUE is not of type INTEGER_CST, PARM_DECL or VAR_DECL, then map it
- to a variable and then set *VALUE to the new variable. */
-
-static inline void
-make_triplet_val_inv (location_t loc, tree *value)
-{
- tree var, new_exp;
- if (TREE_CODE (*value) != INTEGER_CST
- && TREE_CODE (*value) != PARM_DECL
- && !VAR_P (*value))
- {
- var = build_decl (loc, VAR_DECL, NULL_TREE, integer_type_node);
- new_exp = build_modify_expr (loc, var, TREE_TYPE (var), NOP_EXPR, loc,
- *value, TREE_TYPE (*value));
- add_stmt (new_exp);
- *value = var;
- }
-}
-
-/* Populates the INCR and CMP vectors with the increment (of type POSTINCREMENT
- or POSTDECREMENT) and comparison (of TYPE GT_EXPR or LT_EXPR) expressions,
- using data from LENGTH, COUNT_DOWN, and VAR. INCR and CMP vectors are of
- size RANK. */
-
-static void
-create_cmp_incr (location_t loc, vec<an_loop_parts> *node, size_t rank,
- vec<vec<an_parts> > an_info)
-{
- for (size_t ii = 0; ii < rank; ii++)
- {
- tree var = (*node)[ii].var;
- tree length = an_info[0][ii].length;
- (*node)[ii].incr = build_unary_op (loc, POSTINCREMENT_EXPR, var, false);
- (*node)[ii].cmp = build2 (LT_EXPR, boolean_type_node, var, length);
- }
-}
-
-/* Returns a vector of size RANK that contains an array ref that is derived from
- array notation triplet parameters stored in VALUE, START, STRIDE. IS_VECTOR
- is used to check if the data stored at its corresponding location is an
- array notation. VAR is the induction variable passed in by the caller.
-
- For example: For an array notation A[5:10:2], the vector start will be
- of size 1 holding '5', stride of same size as start but holding the value of
- as 2, is_vector as true and count_down as false. Let's assume VAR is 'x'
- This function returns a vector of size 1 with the following data:
- A[5 + (x * 2)] .
-*/
-
-static vec<tree, va_gc> *
-create_array_refs (location_t loc, vec<vec<an_parts> > an_info,
- vec<an_loop_parts> an_loop_info, size_t size, size_t rank)
-{
- tree ind_mult, ind_incr;
- vec<tree, va_gc> *array_operand = NULL;
- for (size_t ii = 0; ii < size; ii++)
- if (an_info[ii][0].is_vector)
- {
- tree array_opr = an_info[ii][rank - 1].value;
- for (int s_jj = rank - 1; s_jj >= 0; s_jj--)
- {
- tree var = an_loop_info[s_jj].var;
- tree stride = an_info[ii][s_jj].stride;
- tree start = an_info[ii][s_jj].start;
- ind_mult = build2 (MULT_EXPR, TREE_TYPE (var), var, stride);
- ind_incr = build2 (PLUS_EXPR, TREE_TYPE (var), start, ind_mult);
- array_opr = build_array_ref (loc, array_opr, ind_incr);
- }
- vec_safe_push (array_operand, array_opr);
- }
- else
- /* This is just a dummy node to make sure both the list sizes for both
- array list and array operand list are the same. */
- vec_safe_push (array_operand, integer_one_node);
- return array_operand;
-}
-
-/* Replaces all the scalar expressions in *NODE. Returns a STATEMENT_LIST that
- holds the NODE along with variables that holds the results of the invariant
- expressions. */
-
-tree
-replace_invariant_exprs (tree *node)
-{
- size_t ix = 0;
- tree node_list = NULL_TREE;
- tree t = NULL_TREE, new_var = NULL_TREE, new_node;
- struct inv_list data;
-
- data.list_values = NULL;
- data.replacement = NULL;
- data.additional_tcodes = NULL;
- walk_tree (node, find_inv_trees, (void *)&data, NULL);
-
- if (vec_safe_length (data.list_values))
- {
- node_list = push_stmt_list ();
- for (ix = 0; vec_safe_iterate (data.list_values, ix, &t); ix++)
- {
- new_var = build_decl (EXPR_LOCATION (t), VAR_DECL, NULL_TREE,
- TREE_TYPE (t));
- gcc_assert (new_var != NULL_TREE && new_var != error_mark_node);
- new_node = build2 (MODIFY_EXPR, TREE_TYPE (t), new_var, t);
- add_stmt (new_node);
- vec_safe_push (data.replacement, new_var);
- }
- walk_tree (node, replace_inv_trees, (void *)&data, NULL);
- node_list = pop_stmt_list (node_list);
- }
- return node_list;
-}
-
-/* Given a CALL_EXPR to an array notation built-in function in
- AN_BUILTIN_FN, replace the call with the appropriate loop and
- computation. Return the computation in *NEW_VAR.
-
- The return value in *NEW_VAR will always be a scalar. If the
- built-in is __sec_reduce_mutating, *NEW_VAR is set to NULL_TREE. */
-
-static tree
-fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
-{
- tree new_var_type = NULL_TREE, func_parm, new_expr, new_yes_expr, new_no_expr;
- tree array_ind_value = NULL_TREE, new_no_ind, new_yes_ind, new_no_list;
- tree new_yes_list, new_cond_expr, new_var_init = NULL_TREE;
- tree new_exp_init = NULL_TREE;
- vec<tree, va_gc> *array_list = NULL, *array_operand = NULL;
- size_t list_size = 0, rank = 0, ii = 0;
- tree loop_init, array_op0;
- tree identity_value = NULL_TREE, call_fn = NULL_TREE, new_call_expr, body;
- location_t location = UNKNOWN_LOCATION;
- tree loop_with_init = alloc_stmt_list ();
- vec<vec<an_parts> > an_info = vNULL;
- auto_vec<an_loop_parts> an_loop_info;
- enum built_in_function an_type =
- is_cilkplus_reduce_builtin (CALL_EXPR_FN (an_builtin_fn));
- if (an_type == BUILT_IN_NONE)
- return NULL_TREE;
-
- /* Builtin call should contain at least one argument. */
- if (call_expr_nargs (an_builtin_fn) == 0)
- {
- error_at (EXPR_LOCATION (an_builtin_fn), "Invalid builtin arguments");
- return error_mark_node;
- }
-
- if (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE
- || an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING)
- {
- call_fn = CALL_EXPR_ARG (an_builtin_fn, 2);
- if (TREE_CODE (call_fn) == ADDR_EXPR)
- call_fn = TREE_OPERAND (call_fn, 0);
- identity_value = CALL_EXPR_ARG (an_builtin_fn, 0);
- func_parm = CALL_EXPR_ARG (an_builtin_fn, 1);
- }
- else
- func_parm = CALL_EXPR_ARG (an_builtin_fn, 0);
-
- /* Fully fold any EXCESSIVE_PRECISION EXPR that can occur in the function
- parameter. */
- func_parm = c_fully_fold (func_parm, false, NULL);
- if (func_parm == error_mark_node)
- return error_mark_node;
-
- location = EXPR_LOCATION (an_builtin_fn);
-
- if (!find_rank (location, an_builtin_fn, an_builtin_fn, true, &rank))
- return error_mark_node;
-
- if (rank == 0)
- {
- error_at (location, "Invalid builtin arguments");
- return error_mark_node;
- }
- else if (rank > 1
- && (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND
- || an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND))
- {
- error_at (location, "__sec_reduce_min_ind or __sec_reduce_max_ind cannot"
- " have arrays with dimension greater than 1");
- return error_mark_node;
- }
-
- extract_array_notation_exprs (func_parm, true, &array_list);
- list_size = vec_safe_length (array_list);
- switch (an_type)
- {
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUL:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN:
- new_var_type = TREE_TYPE ((*array_list)[0]);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO:
- new_var_type = integer_type_node;
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND:
- new_var_type = integer_type_node;
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE:
- if (call_fn && identity_value)
- new_var_type = TREE_TYPE ((*array_list)[0]);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING:
- new_var_type = NULL_TREE;
- break;
- default:
- gcc_unreachable ();
- }
-
- an_loop_info.safe_grow_cleared (rank);
- cilkplus_extract_an_triplets (array_list, list_size, rank, &an_info);
- loop_init = alloc_stmt_list ();
-
- for (ii = 0; ii < rank; ii++)
- {
- an_loop_info[ii].var = create_tmp_var (integer_type_node);
- an_loop_info[ii].ind_init =
- build_modify_expr (location, an_loop_info[ii].var,
- TREE_TYPE (an_loop_info[ii].var), NOP_EXPR,
- location,
- build_int_cst (TREE_TYPE (an_loop_info[ii].var), 0),
- TREE_TYPE (an_loop_info[ii].var));
- }
- array_operand = create_array_refs (location, an_info, an_loop_info,
- list_size, rank);
- replace_array_notations (&func_parm, true, array_list, array_operand);
-
- create_cmp_incr (location, &an_loop_info, rank, an_info);
- if (an_type != BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING)
- {
- *new_var = build_decl (location, VAR_DECL, NULL_TREE, new_var_type);
- gcc_assert (*new_var && *new_var != error_mark_node);
- }
- else
- *new_var = NULL_TREE;
-
- if (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND
- || an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND)
- array_ind_value = build_decl (location, VAR_DECL, NULL_TREE,
- TREE_TYPE (func_parm));
- array_op0 = (*array_operand)[0];
- if (INDIRECT_REF_P (array_op0))
- array_op0 = TREE_OPERAND (array_op0, 0);
- switch (an_type)
- {
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD:
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_zero_cst (new_var_type), new_var_type);
- new_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), PLUS_EXPR,
- location, func_parm, TREE_TYPE (func_parm));
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUL:
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_one_cst (new_var_type), new_var_type);
- new_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), MULT_EXPR,
- location, func_parm, TREE_TYPE (func_parm));
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO:
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_one_cst (new_var_type), new_var_type);
- /* Initially you assume everything is zero, now if we find a case where
- it is NOT true, then we set the result to false. Otherwise
- we just keep the previous value. */
- new_yes_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_zero_cst (TREE_TYPE (*new_var)),
- TREE_TYPE (*new_var));
- new_no_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, *new_var, TREE_TYPE (*new_var));
- new_cond_expr = build2 (NE_EXPR, TREE_TYPE (func_parm), func_parm,
- build_zero_cst (TREE_TYPE (func_parm)));
- new_expr = build_conditional_expr
- (location, new_cond_expr, false,
- new_yes_expr, TREE_TYPE (new_yes_expr), location,
- new_no_expr, TREE_TYPE (new_no_expr), location);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO:
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_one_cst (new_var_type), new_var_type);
- /* Initially you assume everything is non-zero, now if we find a case
- where it is NOT true, then we set the result to false. Otherwise
- we just keep the previous value. */
- new_yes_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_zero_cst (TREE_TYPE (*new_var)),
- TREE_TYPE (*new_var));
- new_no_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, *new_var, TREE_TYPE (*new_var));
- new_cond_expr = build2 (EQ_EXPR, TREE_TYPE (func_parm), func_parm,
- build_zero_cst (TREE_TYPE (func_parm)));
- new_expr = build_conditional_expr
- (location, new_cond_expr, false,
- new_yes_expr, TREE_TYPE (new_yes_expr), location,
- new_no_expr, TREE_TYPE (new_no_expr), location);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO:
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_zero_cst (new_var_type), new_var_type);
- /* Initially we assume there are NO zeros in the list. When we find
- a non-zero, we keep the previous value. If we find a zero, we
- set the value to true. */
- new_yes_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_one_cst (new_var_type), new_var_type);
- new_no_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, *new_var, TREE_TYPE (*new_var));
- new_cond_expr = build2 (EQ_EXPR, TREE_TYPE (func_parm), func_parm,
- build_zero_cst (TREE_TYPE (func_parm)));
- new_expr = build_conditional_expr
- (location, new_cond_expr, false,
- new_yes_expr, TREE_TYPE (new_yes_expr), location,
- new_no_expr, TREE_TYPE (new_no_expr), location);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO:
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_zero_cst (new_var_type), new_var_type);
- /* Initially we assume there are NO non-zeros in the list. When we find
- a zero, we keep the previous value. If we find a non-zero, we set
- the value to true. */
- new_yes_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_one_cst (new_var_type), new_var_type);
- new_no_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, *new_var, TREE_TYPE (*new_var));
- new_cond_expr = build2 (NE_EXPR, TREE_TYPE (func_parm), func_parm,
- build_zero_cst (TREE_TYPE (func_parm)));
- new_expr = build_conditional_expr
- (location, new_cond_expr, false,
- new_yes_expr, TREE_TYPE (new_yes_expr), location,
- new_no_expr, TREE_TYPE (new_no_expr), location);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX:
- if (TYPE_MIN_VALUE (new_var_type))
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, TYPE_MIN_VALUE (new_var_type), new_var_type);
- else
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, func_parm, new_var_type);
- new_no_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, *new_var, TREE_TYPE (*new_var));
- new_yes_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, func_parm, TREE_TYPE (*new_var));
- new_expr = build_conditional_expr
- (location,
- build2 (LT_EXPR, TREE_TYPE (*new_var), *new_var, func_parm), false,
- new_yes_expr, TREE_TYPE (*new_var), location,
- new_no_expr, TREE_TYPE (*new_var), location);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN:
- if (TYPE_MAX_VALUE (new_var_type))
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, TYPE_MAX_VALUE (new_var_type), new_var_type);
- else
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, func_parm, new_var_type);
- new_no_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, *new_var, TREE_TYPE (*new_var));
- new_yes_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, func_parm, TREE_TYPE (*new_var));
- new_expr = build_conditional_expr
- (location,
- build2 (GT_EXPR, TREE_TYPE (*new_var), *new_var, func_parm), false,
- new_yes_expr, TREE_TYPE (*new_var), location,
- new_no_expr, TREE_TYPE (*new_var), location);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND:
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_zero_cst (new_var_type), new_var_type);
- new_exp_init = build_modify_expr
- (location, array_ind_value, TREE_TYPE (array_ind_value),
- NOP_EXPR, location, func_parm, TREE_TYPE (func_parm));
- new_no_ind = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, *new_var, TREE_TYPE (*new_var));
- new_no_expr = build_modify_expr
- (location, array_ind_value, TREE_TYPE (array_ind_value),
- NOP_EXPR,
- location, array_ind_value, TREE_TYPE (array_ind_value));
- if (list_size > 1)
- {
- new_yes_ind = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, an_loop_info[0].var, TREE_TYPE (an_loop_info[0].var));
- new_yes_expr = build_modify_expr
- (location, array_ind_value, TREE_TYPE (array_ind_value),
- NOP_EXPR,
- location, func_parm, TREE_TYPE ((*array_operand)[0]));
- }
- else
- {
- new_yes_ind = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, TREE_OPERAND (array_op0, 1),
- TREE_TYPE (TREE_OPERAND (array_op0, 1)));
- new_yes_expr = build_modify_expr
- (location, array_ind_value, TREE_TYPE (array_ind_value),
- NOP_EXPR,
- location, func_parm, TREE_TYPE (TREE_OPERAND (array_op0, 1)));
- }
- new_yes_list = alloc_stmt_list ();
- append_to_statement_list (new_yes_ind, &new_yes_list);
- append_to_statement_list (new_yes_expr, &new_yes_list);
-
- new_no_list = alloc_stmt_list ();
- append_to_statement_list (new_no_ind, &new_no_list);
- append_to_statement_list (new_no_expr, &new_no_list);
-
- new_expr = build_conditional_expr
- (location,
- build2 (LE_EXPR, TREE_TYPE (array_ind_value), array_ind_value,
- func_parm),
- false,
- new_yes_list, TREE_TYPE (*new_var), location,
- new_no_list, TREE_TYPE (*new_var), location);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND:
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, build_zero_cst (new_var_type), new_var_type);
- new_exp_init = build_modify_expr
- (location, array_ind_value, TREE_TYPE (array_ind_value),
- NOP_EXPR, location, func_parm, TREE_TYPE (func_parm));
- new_no_ind = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, *new_var, TREE_TYPE (*new_var));
- new_no_expr = build_modify_expr
- (location, array_ind_value, TREE_TYPE (array_ind_value),
- NOP_EXPR,
- location, array_ind_value, TREE_TYPE (array_ind_value));
- if (list_size > 1)
- {
- new_yes_ind = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, an_loop_info[0].var, TREE_TYPE (an_loop_info[0].var));
- new_yes_expr = build_modify_expr
- (location, array_ind_value, TREE_TYPE (array_ind_value),
- NOP_EXPR,
- location, func_parm, TREE_TYPE (array_op0));
- }
- else
- {
- new_yes_ind = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, TREE_OPERAND (array_op0, 1),
- TREE_TYPE (TREE_OPERAND (array_op0, 1)));
- new_yes_expr = build_modify_expr
- (location, array_ind_value, TREE_TYPE (array_ind_value),
- NOP_EXPR,
- location, func_parm, TREE_TYPE (TREE_OPERAND (array_op0, 1)));
- }
- new_yes_list = alloc_stmt_list ();
- append_to_statement_list (new_yes_ind, &new_yes_list);
- append_to_statement_list (new_yes_expr, &new_yes_list);
-
- new_no_list = alloc_stmt_list ();
- append_to_statement_list (new_no_ind, &new_no_list);
- append_to_statement_list (new_no_expr, &new_no_list);
-
- new_expr = build_conditional_expr
- (location,
- build2 (GE_EXPR, TREE_TYPE (array_ind_value), array_ind_value,
- func_parm),
- false,
- new_yes_list, TREE_TYPE (*new_var), location,
- new_no_list, TREE_TYPE (*new_var), location);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE:
- new_var_init = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, identity_value, new_var_type);
- new_call_expr = build_call_expr (call_fn, 2, *new_var, func_parm);
- new_expr = build_modify_expr
- (location, *new_var, TREE_TYPE (*new_var), NOP_EXPR,
- location, new_call_expr, TREE_TYPE (*new_var));
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING:
- new_expr = build_call_expr (call_fn, 2, identity_value, func_parm);
- break;
- default:
- gcc_unreachable ();
- break;
- }
-
- for (ii = 0; ii < rank; ii++)
- append_to_statement_list (an_loop_info[ii].ind_init, &loop_init);
-
- if (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND
- || an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND)
- append_to_statement_list (new_exp_init, &loop_init);
- if (an_type != BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING)
- append_to_statement_list (new_var_init, &loop_init);
-
- append_to_statement_list_force (loop_init, &loop_with_init);
- body = new_expr;
- for (ii = 0; ii < rank; ii++)
- {
- tree new_loop = push_stmt_list ();
- c_finish_loop (location, an_loop_info[ii].cmp, an_loop_info[ii].incr,
- body, NULL_TREE, NULL_TREE, true);
- body = pop_stmt_list (new_loop);
- }
- append_to_statement_list_force (body, &loop_with_init);
-
- release_vec_vec (an_info);
-
- return loop_with_init;
-}
-
-/* Returns a loop with ARRAY_REF inside it with an appropriate modify expr.
- The LHS and/or RHS will be array notation expressions that have a MODIFYCODE
- Their locations are specified by LHS_LOC, RHS_LOC. The location of the
- modify expression is location. The original type of LHS and RHS are passed
- in LHS_ORIGTYPE and RHS_ORIGTYPE. */
-
-tree
-build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
- enum tree_code modifycode, location_t rhs_loc,
- tree rhs, tree rhs_origtype)
-{
- bool found_builtin_fn = false;
- tree array_expr_lhs = NULL_TREE, array_expr_rhs = NULL_TREE;
- tree array_expr = NULL_TREE;
- tree an_init = NULL_TREE;
- auto_vec<tree> cond_expr;
- tree body, loop_with_init = alloc_stmt_list();
- tree scalar_mods = NULL_TREE;
- vec<tree, va_gc> *rhs_array_operand = NULL, *lhs_array_operand = NULL;
- size_t lhs_rank = 0, rhs_rank = 0;
- size_t ii = 0;
- vec<tree, va_gc> *lhs_list = NULL, *rhs_list = NULL;
- tree new_modify_expr, new_var = NULL_TREE, builtin_loop = NULL_TREE;
- size_t rhs_list_size = 0, lhs_list_size = 0;
- vec<vec<an_parts> > lhs_an_info = vNULL, rhs_an_info = vNULL;
- auto_vec<an_loop_parts> lhs_an_loop_info, rhs_an_loop_info;
-
- /* If either of this is true, an error message must have been send out
- already. Not necessary to send out multiple error messages. */
- if (lhs == error_mark_node || rhs == error_mark_node)
- return error_mark_node;
-
- if (!find_rank (location, rhs, rhs, false, &rhs_rank))
- return error_mark_node;
-
- extract_array_notation_exprs (rhs, false, &rhs_list);
- rhs_list_size = vec_safe_length (rhs_list);
- an_init = push_stmt_list ();
- if (rhs_rank)
- {
- scalar_mods = replace_invariant_exprs (&rhs);
- if (scalar_mods)
- add_stmt (scalar_mods);
- }
- for (ii = 0; ii < rhs_list_size; ii++)
- {
- tree rhs_node = (*rhs_list)[ii];
- if (TREE_CODE (rhs_node) == CALL_EXPR)
- {
- builtin_loop = fix_builtin_array_notation_fn (rhs_node, &new_var);
- if (builtin_loop == error_mark_node)
- {
- pop_stmt_list (an_init);
- return error_mark_node;
- }
- else if (builtin_loop)
- {
- add_stmt (builtin_loop);
- found_builtin_fn = true;
- if (new_var)
- {
- vec<tree, va_gc> *rhs_sub_list = NULL, *new_var_list = NULL;
- vec_safe_push (rhs_sub_list, rhs_node);
- vec_safe_push (new_var_list, new_var);
- replace_array_notations (&rhs, false, rhs_sub_list,
- new_var_list);
- }
- }
- }
- }
-
- lhs_rank = 0;
- rhs_rank = 0;
- if (!find_rank (location, lhs, lhs, true, &lhs_rank))
- {
- pop_stmt_list (an_init);
- return error_mark_node;
- }
-
- if (!find_rank (location, rhs, rhs, true, &rhs_rank))
- {
- pop_stmt_list (an_init);
- return error_mark_node;
- }
-
- if (lhs_rank == 0 && rhs_rank == 0)
- {
- if (found_builtin_fn)
- {
- new_modify_expr = build_modify_expr (location, lhs, lhs_origtype,
- modifycode, rhs_loc, rhs,
- rhs_origtype);
- add_stmt (new_modify_expr);
- pop_stmt_list (an_init);
- return an_init;
- }
- else
- {
- pop_stmt_list (an_init);
- return NULL_TREE;
- }
- }
- rhs_list_size = 0;
- rhs_list = NULL;
- extract_array_notation_exprs (rhs, true, &rhs_list);
- extract_array_notation_exprs (lhs, true, &lhs_list);
- rhs_list_size = vec_safe_length (rhs_list);
- lhs_list_size = vec_safe_length (lhs_list);
-
- if (lhs_rank == 0 && rhs_rank != 0)
- {
- tree rhs_base = rhs;
- if (TREE_CODE (rhs_base) == ARRAY_NOTATION_REF)
- {
- for (ii = 0; ii < (size_t) rhs_rank; ii++)
- rhs_base = ARRAY_NOTATION_ARRAY (rhs);
-
- error_at (location, "%qE cannot be scalar when %qE is not", lhs,
- rhs_base);
- return error_mark_node;
- }
- else
- {
- error_at (location, "%qE cannot be scalar when %qE is not", lhs,
- rhs_base);
- return error_mark_node;
- }
- }
- if (lhs_rank != 0 && rhs_rank != 0 && lhs_rank != rhs_rank)
- {
- error_at (location, "rank mismatch between %qE and %qE", lhs, rhs);
- pop_stmt_list (an_init);
- return error_mark_node;
- }
-
- /* Here we assign the array notation components to variable so that we can
- satisfy the exec once rule. */
- for (ii = 0; ii < lhs_list_size; ii++)
- {
- tree array_node = (*lhs_list)[ii];
- make_triplet_val_inv (location, &ARRAY_NOTATION_START (array_node));
- make_triplet_val_inv (location, &ARRAY_NOTATION_LENGTH (array_node));
- make_triplet_val_inv (location, &ARRAY_NOTATION_STRIDE (array_node));
- }
- for (ii = 0; ii < rhs_list_size; ii++)
- if ((*rhs_list)[ii] && TREE_CODE ((*rhs_list)[ii]) == ARRAY_NOTATION_REF)
- {
- tree array_node = (*rhs_list)[ii];
- make_triplet_val_inv (location, &ARRAY_NOTATION_START (array_node));
- make_triplet_val_inv (location, &ARRAY_NOTATION_LENGTH (array_node));
- make_triplet_val_inv (location, &ARRAY_NOTATION_STRIDE (array_node));
- }
-
- cond_expr.safe_grow_cleared (MAX (lhs_rank, rhs_rank));
-
- lhs_an_loop_info.safe_grow_cleared (lhs_rank);
- if (rhs_rank)
- rhs_an_loop_info.safe_grow_cleared (rhs_rank);
-
- cilkplus_extract_an_triplets (lhs_list, lhs_list_size, lhs_rank,
- &lhs_an_info);
- if (rhs_rank)
- {
- rhs_an_loop_info.safe_grow_cleared (rhs_rank);
- cilkplus_extract_an_triplets (rhs_list, rhs_list_size, rhs_rank,
- &rhs_an_info);
- }
- if (length_mismatch_in_expr_p (EXPR_LOCATION (lhs), lhs_an_info)
- || (rhs_rank
- && length_mismatch_in_expr_p (EXPR_LOCATION (rhs), rhs_an_info)))
- {
- pop_stmt_list (an_init);
- goto error;
- }
- if (lhs_list_size > 0 && rhs_list_size > 0 && lhs_rank > 0 && rhs_rank > 0
- && TREE_CODE (lhs_an_info[0][0].length) == INTEGER_CST
- && rhs_an_info[0][0].length
- && TREE_CODE (rhs_an_info[0][0].length) == INTEGER_CST)
- {
- HOST_WIDE_INT l_length = int_cst_value (lhs_an_info[0][0].length);
- HOST_WIDE_INT r_length = int_cst_value (rhs_an_info[0][0].length);
- /* Length can be negative or positive. As long as the magnitude is OK,
- then the array notation is valid. */
- if (absu_hwi (l_length) != absu_hwi (r_length))
- {
- error_at (location, "length mismatch between LHS and RHS");
- pop_stmt_list (an_init);
- goto error;
- }
- }
- for (ii = 0; ii < lhs_rank; ii++)
- if (lhs_an_info[0][ii].is_vector)
- {
- lhs_an_loop_info[ii].var = create_tmp_var (integer_type_node);
- lhs_an_loop_info[ii].ind_init = build_modify_expr
- (location, lhs_an_loop_info[ii].var,
- TREE_TYPE (lhs_an_loop_info[ii].var), NOP_EXPR,
- location, build_zero_cst (TREE_TYPE (lhs_an_loop_info[ii].var)),
- TREE_TYPE (lhs_an_loop_info[ii].var));
- }
- for (ii = 0; ii < rhs_rank; ii++)
- {
- /* When we have a polynomial, we assume that the indices are of type
- integer. */
- rhs_an_loop_info[ii].var = create_tmp_var (integer_type_node);
- rhs_an_loop_info[ii].ind_init = build_modify_expr
- (location, rhs_an_loop_info[ii].var,
- TREE_TYPE (rhs_an_loop_info[ii].var), NOP_EXPR,
- location, build_int_cst (TREE_TYPE (rhs_an_loop_info[ii].var), 0),
- TREE_TYPE (rhs_an_loop_info[ii].var));
- }
- if (lhs_rank)
- {
- lhs_array_operand = create_array_refs
- (location, lhs_an_info, lhs_an_loop_info, lhs_list_size, lhs_rank);
- replace_array_notations (&lhs, true, lhs_list, lhs_array_operand);
- array_expr_lhs = lhs;
- }
- if (rhs_array_operand)
- vec_safe_truncate (rhs_array_operand, 0);
- if (rhs_rank)
- {
- rhs_array_operand = create_array_refs
- (location, rhs_an_info, rhs_an_loop_info, rhs_list_size, rhs_rank);
- replace_array_notations (&rhs, true, rhs_list, rhs_array_operand);
- vec_safe_truncate (rhs_array_operand, 0);
- rhs_array_operand = fix_sec_implicit_args (location, rhs_list,
- rhs_an_loop_info, rhs_rank,
- rhs);
- if (!rhs_array_operand)
- goto error;
- replace_array_notations (&rhs, true, rhs_list, rhs_array_operand);
- }
- else if (rhs_list_size > 0)
- {
- rhs_array_operand = fix_sec_implicit_args (location, rhs_list,
- lhs_an_loop_info, lhs_rank,
- lhs);
- if (!rhs_array_operand)
- goto error;
- replace_array_notations (&rhs, true, rhs_list, rhs_array_operand);
- }
- array_expr_lhs = lhs;
- array_expr_rhs = rhs;
- array_expr = build_modify_expr (location, array_expr_lhs, lhs_origtype,
- modifycode, rhs_loc, array_expr_rhs,
- rhs_origtype);
- create_cmp_incr (location, &lhs_an_loop_info, lhs_rank, lhs_an_info);
- if (rhs_rank)
- create_cmp_incr (location, &rhs_an_loop_info, rhs_rank, rhs_an_info);
-
- for (ii = 0; ii < MAX (lhs_rank, rhs_rank); ii++)
- if (ii < lhs_rank && ii < rhs_rank)
- cond_expr[ii] = build2 (TRUTH_ANDIF_EXPR, boolean_type_node,
- lhs_an_loop_info[ii].cmp,
- rhs_an_loop_info[ii].cmp);
- else if (ii < lhs_rank && ii >= rhs_rank)
- cond_expr[ii] = lhs_an_loop_info[ii].cmp;
- else
- gcc_unreachable ();
-
- an_init = pop_stmt_list (an_init);
- append_to_statement_list_force (an_init, &loop_with_init);
- body = array_expr;
- for (ii = 0; ii < MAX (lhs_rank, rhs_rank); ii++)
- {
- tree incr_list = alloc_stmt_list ();
- tree new_loop = push_stmt_list ();
- if (lhs_rank)
- add_stmt (lhs_an_loop_info[ii].ind_init);
- if (rhs_rank)
- add_stmt (rhs_an_loop_info[ii].ind_init);
- if (lhs_rank)
- append_to_statement_list_force (lhs_an_loop_info[ii].incr, &incr_list);
- if (rhs_rank && rhs_an_loop_info[ii].incr)
- append_to_statement_list_force (rhs_an_loop_info[ii].incr, &incr_list);
- c_finish_loop (location, cond_expr[ii], incr_list, body, NULL_TREE,
- NULL_TREE, true);
- body = pop_stmt_list (new_loop);
- }
- append_to_statement_list_force (body, &loop_with_init);
-
- release_vec_vec (lhs_an_info);
- release_vec_vec (rhs_an_info);
- return loop_with_init;
-
-error:
- release_vec_vec (lhs_an_info);
- release_vec_vec (rhs_an_info);
-
- return error_mark_node;
-}
-
-/* Helper function for fix_conditional_array_notations. Encloses the
- conditional statement passed in STMT with a loop around it
- and replaces the condition in STMT with a ARRAY_REF tree-node to the array.
- The condition must have an ARRAY_NOTATION_REF tree. An expansion of array
- notation in STMT is returned in a STATEMENT_LIST. */
-
-static tree
-fix_conditional_array_notations_1 (tree stmt)
-{
- vec<tree, va_gc> *array_list = NULL, *array_operand = NULL;
- size_t list_size = 0;
- tree cond = NULL_TREE, builtin_loop = NULL_TREE, new_var = NULL_TREE;
- size_t rank = 0, ii = 0;
- tree loop_init;
- location_t location = EXPR_LOCATION (stmt);
- tree body = NULL_TREE, loop_with_init = alloc_stmt_list ();
- vec<vec<an_parts> > an_info = vNULL;
- auto_vec<an_loop_parts> an_loop_info;
-
- if (TREE_CODE (stmt) == COND_EXPR)
- cond = COND_EXPR_COND (stmt);
- else if (TREE_CODE (stmt) == SWITCH_EXPR)
- cond = SWITCH_COND (stmt);
- else if (truth_value_p (TREE_CODE (stmt)))
- cond = TREE_OPERAND (stmt, 0);
- else
- /* Otherwise dont even touch the statement. */
- return stmt;
-
- if (!find_rank (location, cond, cond, false, &rank))
- return error_mark_node;
-
- extract_array_notation_exprs (stmt, false, &array_list);
- loop_init = push_stmt_list ();
- for (ii = 0; ii < vec_safe_length (array_list); ii++)
- {
- tree array_node = (*array_list)[ii];
- if (TREE_CODE (array_node) == CALL_EXPR)
- {
- builtin_loop = fix_builtin_array_notation_fn (array_node, &new_var);
- if (builtin_loop == error_mark_node)
- {
- add_stmt (error_mark_node);
- pop_stmt_list (loop_init);
- return loop_init;
- }
- else if (builtin_loop)
- {
- vec <tree, va_gc>* sub_list = NULL, *new_var_list = NULL;
- vec_safe_push (sub_list, array_node);
- vec_safe_push (new_var_list, new_var);
- add_stmt (builtin_loop);
- replace_array_notations (&stmt, false, sub_list, new_var_list);
- }
- }
- }
- if (!find_rank (location, stmt, stmt, true, &rank))
- {
- pop_stmt_list (loop_init);
- return error_mark_node;
- }
- if (rank == 0)
- {
- add_stmt (stmt);
- pop_stmt_list (loop_init);
- return loop_init;
- }
- extract_array_notation_exprs (stmt, true, &array_list);
-
- if (vec_safe_length (array_list) == 0)
- return stmt;
-
- list_size = vec_safe_length (array_list);
- an_loop_info.safe_grow_cleared (rank);
-
- for (ii = 0; ii < list_size; ii++)
- if ((*array_list)[ii]
- && TREE_CODE ((*array_list)[ii]) == ARRAY_NOTATION_REF)
- {
- tree array_node = (*array_list)[ii];
- make_triplet_val_inv (location, &ARRAY_NOTATION_START (array_node));
- make_triplet_val_inv (location, &ARRAY_NOTATION_LENGTH (array_node));
- make_triplet_val_inv (location, &ARRAY_NOTATION_STRIDE (array_node));
- }
- cilkplus_extract_an_triplets (array_list, list_size, rank, &an_info);
- for (ii = 0; ii < rank; ii++)
- {
- an_loop_info[ii].var = create_tmp_var (integer_type_node);
- an_loop_info[ii].ind_init =
- build_modify_expr (location, an_loop_info[ii].var,
- TREE_TYPE (an_loop_info[ii].var), NOP_EXPR,
- location,
- build_int_cst (TREE_TYPE (an_loop_info[ii].var), 0),
- TREE_TYPE (an_loop_info[ii].var));
- }
- array_operand = create_array_refs (location, an_info, an_loop_info,
- list_size, rank);
- replace_array_notations (&stmt, true, array_list, array_operand);
- create_cmp_incr (location, &an_loop_info, rank, an_info);
-
- loop_init = pop_stmt_list (loop_init);
- body = stmt;
- append_to_statement_list_force (loop_init, &loop_with_init);
-
- for (ii = 0; ii < rank; ii++)
- {
- tree new_loop = push_stmt_list ();
- add_stmt (an_loop_info[ii].ind_init);
- c_finish_loop (location, an_loop_info[ii].cmp, an_loop_info[ii].incr,
- body, NULL_TREE, NULL_TREE, true);
- body = pop_stmt_list (new_loop);
- }
- append_to_statement_list_force (body, &loop_with_init);
- release_vec_vec (an_info);
-
- return loop_with_init;
-}
-
-/* Top-level function to replace ARRAY_NOTATION_REF in a conditional statement
- in STMT. An expansion of array notation in STMT is returned as a
- STATEMENT_LIST. */
-
-tree
-fix_conditional_array_notations (tree stmt)
-{
- if (TREE_CODE (stmt) == STATEMENT_LIST)
- {
- tree_stmt_iterator tsi;
- for (tsi = tsi_start (stmt); !tsi_end_p (tsi); tsi_next (&tsi))
- {
- tree single_stmt = *tsi_stmt_ptr (tsi);
- *tsi_stmt_ptr (tsi) =
- fix_conditional_array_notations_1 (single_stmt);
- }
- return stmt;
- }
- else
- return fix_conditional_array_notations_1 (stmt);
-}
-
-/* Create a struct c_expr that contains a loop with ARRAY_REF expr at location
- LOCATION with the tree_code CODE and the array notation expr is
- passed in ARG. Returns the fixed c_expr in ARG itself. */
-
-struct c_expr
-fix_array_notation_expr (location_t location, enum tree_code code,
- struct c_expr arg)
-{
-
- vec<tree, va_gc> *array_list = NULL, *array_operand = NULL;
- size_t list_size = 0, rank = 0, ii = 0;
- tree loop_init;
- tree body, loop_with_init = alloc_stmt_list ();
- vec<vec<an_parts> > an_info = vNULL;
- auto_vec<an_loop_parts> an_loop_info;
-
- if (!find_rank (location, arg.value, arg.value, false, &rank))
- {
- /* If this function returns a NULL, we convert the tree value in the
- structure to error_mark_node and the parser should take care of the
- rest. */
- arg.value = error_mark_node;
- return arg;
- }
-
- if (rank == 0)
- return arg;
-
- extract_array_notation_exprs (arg.value, true, &array_list);
-
- if (vec_safe_length (array_list) == 0)
- return arg;
-
- list_size = vec_safe_length (array_list);
-
- an_loop_info.safe_grow_cleared (rank);
- cilkplus_extract_an_triplets (array_list, list_size, rank, &an_info);
-
- loop_init = push_stmt_list ();
- for (ii = 0; ii < rank; ii++)
- {
- an_loop_info[ii].var = create_tmp_var (integer_type_node);
- an_loop_info[ii].ind_init =
- build_modify_expr (location, an_loop_info[ii].var,
- TREE_TYPE (an_loop_info[ii].var), NOP_EXPR,
- location,
- build_int_cst (TREE_TYPE (an_loop_info[ii].var), 0),
- TREE_TYPE (an_loop_info[ii].var));;
-
- }
- array_operand = create_array_refs (location, an_info, an_loop_info,
- list_size, rank);
- replace_array_notations (&arg.value, true, array_list, array_operand);
- create_cmp_incr (location, &an_loop_info, rank, an_info);
-
- arg = default_function_array_read_conversion (location, arg);
- if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR)
- arg.value = build_unary_op (location, code, arg.value, false);
- else if (code == PREINCREMENT_EXPR || code == PREDECREMENT_EXPR)
- arg = parser_build_unary_op (location, code, arg);
-
- loop_init = pop_stmt_list (loop_init);
- append_to_statement_list_force (loop_init, &loop_with_init);
- body = arg.value;
-
- for (ii = 0; ii < rank; ii++)
- {
- tree new_loop = push_stmt_list ();
- add_stmt (an_loop_info[ii].ind_init);
- c_finish_loop (location, an_loop_info[ii].cmp,
- an_loop_info[ii].incr, body, NULL_TREE,
- NULL_TREE, true);
- body = pop_stmt_list (new_loop);
- }
- append_to_statement_list_force (body, &loop_with_init);
- arg.value = loop_with_init;
- release_vec_vec (an_info);
- return arg;
-}
-
-/* Replaces array notations in a void function call arguments in ARG and returns
- a STATEMENT_LIST. */
-
-static tree
-fix_array_notation_call_expr (tree arg)
-{
- vec<tree, va_gc> *array_list = NULL, *array_operand = NULL;
- tree new_var = NULL_TREE;
- size_t list_size = 0, rank = 0, ii = 0;
- tree loop_init;
- tree body, loop_with_init = alloc_stmt_list ();
- location_t location = UNKNOWN_LOCATION;
- vec<vec<an_parts> > an_info = vNULL;
- auto_vec<an_loop_parts> an_loop_info;
-
- if (TREE_CODE (arg) == CALL_EXPR
- && is_cilkplus_reduce_builtin (CALL_EXPR_FN (arg)))
- {
- loop_init = fix_builtin_array_notation_fn (arg, &new_var);
- /* We are ignoring the new var because either the user does not want to
- capture it OR he is using sec_reduce_mutating function. */
- return loop_init;
- }
- if (!find_rank (location, arg, arg, false, &rank))
- return error_mark_node;
-
- if (rank == 0)
- return arg;
-
- extract_array_notation_exprs (arg, true, &array_list);
- if (vec_safe_length (array_list) == 0)
- return arg;
-
- list_size = vec_safe_length (array_list);
- location = EXPR_LOCATION (arg);
- an_loop_info.safe_grow_cleared (rank);
-
- loop_init = push_stmt_list ();
- for (ii = 0; ii < list_size; ii++)
- if ((*array_list)[ii]
- && TREE_CODE ((*array_list)[ii]) == ARRAY_NOTATION_REF)
- {
- tree array_node = (*array_list)[ii];
- make_triplet_val_inv (location, &ARRAY_NOTATION_START (array_node));
- make_triplet_val_inv (location, &ARRAY_NOTATION_LENGTH (array_node));
- make_triplet_val_inv (location, &ARRAY_NOTATION_STRIDE (array_node));
- }
- cilkplus_extract_an_triplets (array_list, list_size, rank, &an_info);
- if (length_mismatch_in_expr_p (location, an_info))
- {
- pop_stmt_list (loop_init);
- return error_mark_node;
- }
- for (ii = 0; ii < rank; ii++)
- {
- an_loop_info[ii].var = create_tmp_var (integer_type_node);
- an_loop_info[ii].ind_init =
- build_modify_expr (location, an_loop_info[ii].var,
- TREE_TYPE (an_loop_info[ii].var), NOP_EXPR, location,
- build_int_cst (TREE_TYPE (an_loop_info[ii].var), 0),
- TREE_TYPE (an_loop_info[ii].var));
-
- }
- array_operand = create_array_refs (location, an_info, an_loop_info,
- list_size, rank);
- replace_array_notations (&arg, true, array_list, array_operand);
- create_cmp_incr (location, &an_loop_info, rank, an_info);
- loop_init = pop_stmt_list (loop_init);
- append_to_statement_list_force (loop_init, &loop_with_init);
- body = arg;
- for (ii = 0; ii < rank; ii++)
- {
- tree new_loop = push_stmt_list ();
- add_stmt (an_loop_info[ii].ind_init);
- c_finish_loop (location, an_loop_info[ii].cmp, an_loop_info[ii].incr,
- body, NULL_TREE, NULL_TREE, true);
- body = pop_stmt_list (new_loop);
- }
- append_to_statement_list_force (body, &loop_with_init);
- release_vec_vec (an_info);
- return loop_with_init;
-}
-
-/* Expands the built-in functions in a return. EXPR is a RETURN_EXPR with
- a built-in reduction function. This function returns the expansion code for
- the built-in function. */
-
-static tree
-fix_return_expr (tree expr)
-{
- tree new_mod_list, new_var, new_mod, retval_expr, retval_type;
- location_t loc = EXPR_LOCATION (expr);
-
- new_mod_list = alloc_stmt_list ();
- retval_expr = TREE_OPERAND (expr, 0);
- retval_type = TREE_TYPE (TREE_OPERAND (retval_expr, 1));
- new_var = build_decl (loc, VAR_DECL, NULL_TREE, TREE_TYPE (retval_expr));
- new_mod = build_array_notation_expr (loc, new_var, TREE_TYPE (new_var),
- NOP_EXPR, loc,
- TREE_OPERAND (retval_expr, 1),
- retval_type);
- TREE_OPERAND (retval_expr, 1) = new_var;
- TREE_OPERAND (expr, 0) = retval_expr;
- append_to_statement_list_force (new_mod, &new_mod_list);
- append_to_statement_list_force (expr, &new_mod_list);
- return new_mod_list;
-}
-
-/* Callback for walk_tree. Expands all array notations in *TP. *WALK_SUBTREES
- is set to 1 unless *TP contains no array notation expressions. */
-
-static tree
-expand_array_notations (tree *tp, int *walk_subtrees, void *)
-{
- if (!contains_array_notation_expr (*tp))
- {
- *walk_subtrees = 0;
- return NULL_TREE;
- }
- *walk_subtrees = 1;
-
- switch (TREE_CODE (*tp))
- {
- case TRUTH_ORIF_EXPR:
- case TRUTH_ANDIF_EXPR:
- case TRUTH_OR_EXPR:
- case TRUTH_AND_EXPR:
- case TRUTH_XOR_EXPR:
- case TRUTH_NOT_EXPR:
- case COND_EXPR:
- *tp = fix_conditional_array_notations (*tp);
- break;
- case MODIFY_EXPR:
- {
- location_t loc = EXPR_HAS_LOCATION (*tp) ? EXPR_LOCATION (*tp) :
- UNKNOWN_LOCATION;
- tree lhs = TREE_OPERAND (*tp, 0);
- tree rhs = TREE_OPERAND (*tp, 1);
- location_t rhs_loc = EXPR_HAS_LOCATION (rhs) ? EXPR_LOCATION (rhs) :
- UNKNOWN_LOCATION;
- *tp = build_array_notation_expr (loc, lhs, TREE_TYPE (lhs), NOP_EXPR,
- rhs_loc, rhs, TREE_TYPE (rhs));
- }
- break;
- case DECL_EXPR:
- {
- tree x = DECL_EXPR_DECL (*tp);
- if (DECL_INITIAL (x))
- {
- location_t loc = DECL_SOURCE_LOCATION (x);
- tree lhs = x;
- tree rhs = DECL_INITIAL (x);
- DECL_INITIAL (x) = NULL;
- tree new_modify_expr = build_modify_expr (loc, lhs,
- TREE_TYPE (lhs),
- NOP_EXPR,
- loc, rhs,
- TREE_TYPE(rhs));
- expand_array_notations (&new_modify_expr, walk_subtrees, NULL);
- *tp = new_modify_expr;
- }
- }
- break;
- case CALL_EXPR:
- *tp = fix_array_notation_call_expr (*tp);
- break;
- case RETURN_EXPR:
- *tp = fix_return_expr (*tp);
- break;
- case COMPOUND_EXPR:
- if (TREE_CODE (TREE_OPERAND (*tp, 0)) == SAVE_EXPR)
- {
- /* In here we are calling expand_array_notations because
- we need to be able to catch the return value and check if
- it is an error_mark_node. */
- expand_array_notations (&TREE_OPERAND (*tp, 1), walk_subtrees, NULL);
-
- /* SAVE_EXPR cannot have an error_mark_node inside it. This check
- will make sure that if there is an error in expanding of
- array notations (e.g. rank mismatch) then replace the entire
- SAVE_EXPR with an error_mark_node. */
- if (TREE_OPERAND (*tp, 1) == error_mark_node)
- *tp = error_mark_node;
- }
- break;
- case ARRAY_NOTATION_REF:
- /* If we are here, then we are dealing with cases like this:
- A[:];
- A[x:y:z];
- A[x:y];
- Replace those with just void zero node. */
- *tp = void_node;
- default:
- break;
- }
- return NULL_TREE;
-}
-
-/* Walks through tree node T and expands all array notations in its subtrees.
- The return value is the same type as T but with all array notations
- replaced with appropriate ARRAY_REFS with a loop around it. */
-
-tree
-expand_array_notation_exprs (tree t)
-{
- walk_tree (&t, expand_array_notations, NULL, NULL);
- return t;
-}
-
-/* This handles expression of the form "a[i:j:k]" or "a[:]" or "a[i:j]," which
- denotes an array notation expression. If a is a variable or a member, then
- we generate a ARRAY_NOTATION_REF front-end tree and return it.
- This tree is broken down to ARRAY_REF toward the end of parsing.
- ARRAY_NOTATION_REF tree holds the START_INDEX, LENGTH, STRIDE and the TYPE
- of ARRAY_REF. Restrictions on START_INDEX, LENGTH and STRIDE is same as that
- of the index field passed into ARRAY_REF. The only additional restriction
- is that, unlike index in ARRAY_REF, stride, length and start_index cannot
- contain ARRAY_NOTATIONS. */
-
-tree
-build_array_notation_ref (location_t loc, tree array, tree start_index,
- tree length, tree stride, tree type)
-{
- tree array_ntn_tree = NULL_TREE;
- size_t stride_rank = 0, length_rank = 0, start_rank = 0;
-
- if (!INTEGRAL_TYPE_P (TREE_TYPE (start_index)))
- {
- error_at (loc,
- "start-index of array notation triplet is not an integer");
- return error_mark_node;
- }
- if (!INTEGRAL_TYPE_P (TREE_TYPE (length)))
- {
- error_at (loc, "length of array notation triplet is not an integer");
- return error_mark_node;
- }
-
- /* The stride is an optional field. */
- if (stride && !INTEGRAL_TYPE_P (TREE_TYPE (stride)))
- {
- error_at (loc, "stride of array notation triplet is not an integer");
- return error_mark_node;
- }
- if (!stride)
- {
- if (TREE_CONSTANT (start_index) && TREE_CONSTANT (length)
- && tree_int_cst_lt (length, start_index))
- stride = build_int_cst (TREE_TYPE (start_index), -1);
- else
- stride = build_int_cst (TREE_TYPE (start_index), 1);
- }
-
- if (!find_rank (loc, start_index, start_index, false, &start_rank))
- return error_mark_node;
- if (!find_rank (loc, length, length, false, &length_rank))
- return error_mark_node;
- if (!find_rank (loc, stride, stride, false, &stride_rank))
- return error_mark_node;
-
- if (start_rank != 0)
- {
- error_at (loc, "rank of an array notation triplet's start-index is not "
- "zero");
- return error_mark_node;
- }
- if (length_rank != 0)
- {
- error_at (loc, "rank of an array notation triplet's length is not zero");
- return error_mark_node;
- }
- if (stride_rank != 0)
- {
- error_at (loc, "rank of array notation triplet's stride is not zero");
- return error_mark_node;
- }
- array_ntn_tree = build4 (ARRAY_NOTATION_REF, NULL_TREE, NULL_TREE, NULL_TREE,
- NULL_TREE, NULL_TREE);
- ARRAY_NOTATION_ARRAY (array_ntn_tree) = array;
- ARRAY_NOTATION_START (array_ntn_tree) = start_index;
- ARRAY_NOTATION_LENGTH (array_ntn_tree) = length;
- ARRAY_NOTATION_STRIDE (array_ntn_tree) = stride;
- TREE_TYPE (array_ntn_tree) = type;
-
- return array_ntn_tree;
-}
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index c66bc4043ce..56c63d80ec4 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -50,7 +50,6 @@ along with GCC; see the file COPYING3. If not see
#include "dumpfile.h"
#include "plugin.h"
#include "c-family/c-ada-spec.h"
-#include "cilk.h"
#include "builtins.h"
#include "spellcheck-tree.h"
#include "gcc-rich-location.h"
@@ -9388,12 +9387,6 @@ finish_function (void)
/* Tie off the statement tree for this function. */
DECL_SAVED_TREE (fndecl) = pop_stmt_list (DECL_SAVED_TREE (fndecl));
- /* If the function has _Cilk_spawn in front of a function call inside it
- i.e. it is a spawning function, then add the appropriate Cilk plus
- functions inside. */
- if (fn_contains_cilk_spawn_p (cfun))
- cfun->cilk_frame_decl = insert_cilk_frame (fndecl);
-
finish_fname_decls ();
/* Complain if there's just no return statement. */
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 9a6685a6744..4da24a64cd1 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -203,12 +203,6 @@ struct GTY(()) c_parser {
keywords are valid. */
BOOL_BITFIELD objc_property_attr_context : 1;
- /* Cilk Plus specific parser/lexer information. */
-
- /* Buffer to hold all the tokens from parsing the vector attribute for the
- SIMD-enabled functions (formerly known as elemental functions). */
- vec <c_token, va_gc> *cilk_simd_fn_tokens;
-
/* Location of the last consumed token. */
location_t last_token_location;
};
@@ -1493,14 +1487,6 @@ static void c_parser_objc_at_dynamic_declaration (c_parser *);
static bool c_parser_objc_diagnose_bad_element_prefix
(c_parser *, struct c_declspecs *);
-/* Cilk Plus supporting routines. */
-static void c_parser_cilk_simd (c_parser *, bool *);
-static void c_parser_cilk_for (c_parser *, tree, bool *);
-static bool c_parser_cilk_verify_simd (c_parser *, enum pragma_context);
-static tree c_parser_array_notation (location_t, c_parser *, tree, tree);
-static tree c_parser_cilk_clause_vectorlength (c_parser *, tree, bool);
-static void c_parser_cilk_grainsize (c_parser *, bool *);
-
static void c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass);
/* Parse a translation unit (C90 6.7, C99 6.9, C11 6.9).
@@ -1986,8 +1972,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
C_DTR_NORMAL, &dummy);
if (declarator == NULL)
{
- if (omp_declare_simd_clauses.exists ()
- || !vec_safe_is_empty (parser->cilk_simd_fn_tokens))
+ if (omp_declare_simd_clauses.exists ())
c_finish_omp_declare_simd (parser, NULL_TREE, NULL_TREE,
omp_declare_simd_clauses);
if (oacc_routine_data)
@@ -2091,8 +2076,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
chainon (postfix_attrs, all_prefix_attrs));
if (!d)
d = error_mark_node;
- if (omp_declare_simd_clauses.exists ()
- || !vec_safe_is_empty (parser->cilk_simd_fn_tokens))
+ if (omp_declare_simd_clauses.exists ())
c_finish_omp_declare_simd (parser, d, NULL_TREE,
omp_declare_simd_clauses);
}
@@ -2104,8 +2088,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
chainon (postfix_attrs, all_prefix_attrs));
if (!d)
d = error_mark_node;
- if (omp_declare_simd_clauses.exists ()
- || !vec_safe_is_empty (parser->cilk_simd_fn_tokens))
+ if (omp_declare_simd_clauses.exists ())
c_finish_omp_declare_simd (parser, d, NULL_TREE,
omp_declare_simd_clauses);
init_loc = c_parser_peek_token (parser)->location;
@@ -2146,8 +2129,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
if (declarator->kind == cdk_function)
if (DECL_ARGUMENTS (d) == NULL_TREE)
DECL_ARGUMENTS (d) = declarator->u.arg_info->parms;
- if (omp_declare_simd_clauses.exists ()
- || !vec_safe_is_empty (parser->cilk_simd_fn_tokens))
+ if (omp_declare_simd_clauses.exists ())
{
tree parms = NULL_TREE;
if (d && TREE_CODE (d) == FUNCTION_DECL)
@@ -2303,8 +2285,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
c_parser_declaration_or_fndef (parser, false, false, false,
true, false, NULL, vNULL);
store_parm_decls ();
- if (omp_declare_simd_clauses.exists ()
- || !vec_safe_is_empty (parser->cilk_simd_fn_tokens))
+ if (omp_declare_simd_clauses.exists ())
c_finish_omp_declare_simd (parser, current_function_decl, NULL_TREE,
omp_declare_simd_clauses);
if (oacc_routine_data)
@@ -2339,11 +2320,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
return;
}
else
- {
- fnbody = c_parser_compound_statement (parser);
- if (flag_cilkplus && contains_array_notation_expr (fnbody))
- fnbody = expand_array_notation_exprs (fnbody);
- }
+ fnbody = c_parser_compound_statement (parser);
tree fndecl = current_function_decl;
if (nested)
{
@@ -3799,15 +3776,6 @@ c_parser_direct_declarator_inner (c_parser *parser, bool id_present,
dimen.value = NULL_TREE;
star_seen = false;
}
- else if (flag_cilkplus
- && c_parser_next_token_is (parser, CPP_COLON))
- {
- dimen.value = error_mark_node;
- star_seen = false;
- error_at (c_parser_peek_token (parser)->location,
- "array notations cannot be used in declaration");
- c_parser_consume_token (parser);
- }
else if (c_parser_next_token_is (parser, CPP_MULT))
{
if (c_parser_peek_2nd_token (parser)->type == CPP_CLOSE_SQUARE)
@@ -3830,14 +3798,6 @@ c_parser_direct_declarator_inner (c_parser *parser, bool id_present,
}
if (c_parser_next_token_is (parser, CPP_CLOSE_SQUARE))
c_parser_consume_token (parser);
- else if (flag_cilkplus
- && c_parser_next_token_is (parser, CPP_COLON))
- {
- error_at (c_parser_peek_token (parser)->location,
- "array notations cannot be used in declaration");
- c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL);
- return NULL;
- }
else
{
c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE,
@@ -4283,76 +4243,6 @@ c_parser_attribute_any_word (c_parser *parser)
return attr_name;
}
-#define CILK_SIMD_FN_CLAUSE_MASK \
- ((OMP_CLAUSE_MASK_1 << PRAGMA_CILK_CLAUSE_VECTORLENGTH) \
- | (OMP_CLAUSE_MASK_1 << PRAGMA_CILK_CLAUSE_LINEAR) \
- | (OMP_CLAUSE_MASK_1 << PRAGMA_CILK_CLAUSE_UNIFORM) \
- | (OMP_CLAUSE_MASK_1 << PRAGMA_CILK_CLAUSE_MASK) \
- | (OMP_CLAUSE_MASK_1 << PRAGMA_CILK_CLAUSE_NOMASK))
-
-/* Parses the vector attribute of SIMD enabled functions in Cilk Plus.
- VEC_TOKEN is the "vector" token that is replaced with "simd" and
- pushed into the token list.
- Syntax:
- vector
- vector (<vector attributes>). */
-
-static void
-c_parser_cilk_simd_fn_vector_attrs (c_parser *parser, c_token vec_token)
-{
- gcc_assert (is_cilkplus_vector_p (vec_token.value));
-
- int paren_scope = 0;
- vec_safe_push (parser->cilk_simd_fn_tokens, vec_token);
- /* Consume the "vector" token. */
- c_parser_consume_token (parser);
-
- if (c_parser_next_token_is (parser, CPP_OPEN_PAREN))
- {
- c_parser_consume_token (parser);
- paren_scope++;
- }
- while (paren_scope > 0)
- {
- c_token *token = c_parser_peek_token (parser);
- if (token->type == CPP_OPEN_PAREN)
- paren_scope++;
- else if (token->type == CPP_CLOSE_PAREN)
- paren_scope--;
- /* Do not push the last ')' since we are not pushing the '('. */
- if (!(token->type == CPP_CLOSE_PAREN && paren_scope == 0))
- vec_safe_push (parser->cilk_simd_fn_tokens, *token);
- c_parser_consume_token (parser);
- }
-
- /* Since we are converting an attribute to a pragma, we need to end the
- attribute with PRAGMA_EOL. */
- c_token eol_token;
- memset (&eol_token, 0, sizeof (eol_token));
- eol_token.type = CPP_PRAGMA_EOL;
- vec_safe_push (parser->cilk_simd_fn_tokens, eol_token);
-}
-
-/* Add 2 CPP_EOF at the end of PARSER->ELEM_FN_TOKENS vector. */
-
-static void
-c_finish_cilk_simd_fn_tokens (c_parser *parser)
-{
- c_token last_token = parser->cilk_simd_fn_tokens->last ();
-
- /* c_parser_attributes is called in several places, so if these EOF
- tokens are already inserted, then don't do them again. */
- if (last_token.type == CPP_EOF)
- return;
-
- /* Two CPP_EOF token are added as a safety net since the normal C
- front-end has two token look-ahead. */
- c_token eof_token;
- eof_token.type = CPP_EOF;
- vec_safe_push (parser->cilk_simd_fn_tokens, eof_token);
- vec_safe_push (parser->cilk_simd_fn_tokens, eof_token);
-}
-
/* Parse (possibly empty) attributes. This is a GNU extension.
attributes:
@@ -4420,16 +4310,6 @@ c_parser_attributes (c_parser *parser)
if (attr_name == NULL)
break;
attr_name = canonicalize_attr_name (attr_name);
- if (is_cilkplus_vector_p (attr_name))
- {
- c_token *v_token = c_parser_peek_token (parser);
- v_token->value = canonicalize_attr_name (v_token->value);
- c_parser_cilk_simd_fn_vector_attrs (parser, *v_token);
- /* If the next token isn't a comma, we're done. */
- if (!c_parser_next_token_is (parser, CPP_COMMA))
- break;
- continue;
- }
c_parser_consume_token (parser);
if (c_parser_next_token_is_not (parser, CPP_OPEN_PAREN))
{
@@ -4526,8 +4406,6 @@ c_parser_attributes (c_parser *parser)
parser->lex_untranslated_string = false;
}
- if (flag_cilkplus && !vec_safe_is_empty (parser->cilk_simd_fn_tokens))
- c_finish_cilk_simd_fn_tokens (parser);
return attrs;
}
@@ -5011,9 +4889,6 @@ c_parser_compound_statement (c_parser *parser)
stmt = c_begin_compound_stmt (true);
c_parser_compound_statement_nostart (parser);
- /* If the compound stmt contains array notations, then we expand them. */
- if (flag_cilkplus && contains_array_notation_expr (stmt))
- stmt = expand_array_notation_exprs (stmt);
return c_end_compound_stmt (brace_loc, stmt, true);
}
@@ -5507,24 +5382,6 @@ c_parser_statement_after_labels (c_parser *parser, bool *if_p,
case RID_FOR:
c_parser_for_statement (parser, false, if_p);
break;
- case RID_CILK_FOR:
- if (!flag_cilkplus)
- {
- error_at (c_parser_peek_token (parser)->location,
- "-fcilkplus must be enabled to use %<_Cilk_for%>");
- c_parser_skip_to_end_of_block_or_statement (parser);
- }
- else
- c_parser_cilk_for (parser, integer_zero_node, if_p);
- break;
- case RID_CILK_SYNC:
- c_parser_consume_token (parser);
- c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
- if (!flag_cilkplus)
- error_at (loc, "-fcilkplus must be enabled to use %<_Cilk_sync%>");
- else
- add_stmt (build_cilk_sync ());
- break;
case RID_GOTO:
c_parser_consume_token (parser);
if (c_parser_next_token_is (parser, CPP_NAME))
@@ -5539,11 +5396,6 @@ c_parser_statement_after_labels (c_parser *parser, bool *if_p,
c_parser_consume_token (parser);
val = c_parser_expression (parser);
- if (check_no_cilk (val.value,
- "Cilk array notation cannot be used as a computed goto expression",
- "%<_Cilk_spawn%> statement cannot be used as a computed goto expression",
- loc))
- val.value = error_mark_node;
val = convert_lvalue_to_rvalue (loc, val, false, true);
stmt = c_finish_goto_ptr (loc, val.value);
}
@@ -5598,15 +5450,8 @@ c_parser_statement_after_labels (c_parser *parser, bool *if_p,
{
struct c_expr expr = c_parser_expression (parser);
expr = convert_lvalue_to_rvalue (loc, expr, false, false);
- if (check_no_cilk (expr.value,
- "Cilk array notation cannot be used for a throw expression",
- "%<_Cilk_spawn%> statement cannot be used for a throw expression"))
- expr.value = error_mark_node;
- else
- {
- expr.value = c_fully_fold (expr.value, false, NULL);
- stmt = objc_build_throw_stmt (loc, expr.value);
- }
+ expr.value = c_fully_fold (expr.value, false, NULL);
+ stmt = objc_build_throw_stmt (loc, expr.value);
goto expect_semicolon;
}
break;
@@ -5884,7 +5729,6 @@ c_parser_if_statement (c_parser *parser, bool *if_p, vec<tree> *chain)
bool nested_if = false;
tree first_body, second_body;
bool in_if_block;
- tree if_stmt;
gcc_assert (c_parser_next_token_is_keyword (parser, RID_IF));
token_indent_info if_tinfo
@@ -5893,11 +5737,6 @@ c_parser_if_statement (c_parser *parser, bool *if_p, vec<tree> *chain)
block = c_begin_compound_stmt (flag_isoc99);
loc = c_parser_peek_token (parser)->location;
cond = c_parser_paren_condition (parser);
- if (flag_cilkplus && contains_cilk_spawn_stmt (cond))
- {
- error_at (loc, "if statement cannot contain %<Cilk_spawn%>");
- cond = error_mark_node;
- }
in_if_block = parser->in_if_block;
parser->in_if_block = true;
first_body = c_parser_if_body (parser, &nested_if, if_tinfo);
@@ -5956,12 +5795,8 @@ c_parser_if_statement (c_parser *parser, bool *if_p, vec<tree> *chain)
}
}
c_finish_if_stmt (loc, cond, first_body, second_body);
- if_stmt = c_end_compound_stmt (loc, block, flag_isoc99);
+ add_stmt (c_end_compound_stmt (loc, block, flag_isoc99));
- /* If the if statement contains array notations, then we expand them. */
- if (flag_cilkplus && contains_array_notation_expr (if_stmt))
- if_stmt = fix_conditional_array_notations (if_stmt);
- add_stmt (if_stmt);
c_parser_maybe_reclassify_token (parser);
}
@@ -5993,11 +5828,6 @@ c_parser_switch_statement (c_parser *parser, bool *if_p)
ce = convert_lvalue_to_rvalue (switch_cond_loc, ce, true, false);
expr = ce.value;
/* ??? expr has no valid location? */
- if (check_no_cilk (expr,
- "Cilk array notation cannot be used as a condition for switch statement",
- "%<_Cilk_spawn%> statement cannot be used as a condition for switch statement",
- switch_cond_loc))
- expr = error_mark_node;
parens.skip_until_found_close (parser);
}
else
@@ -6050,10 +5880,6 @@ c_parser_while_statement (c_parser *parser, bool ivdep, bool *if_p)
block = c_begin_compound_stmt (flag_isoc99);
loc = c_parser_peek_token (parser)->location;
cond = c_parser_paren_condition (parser);
- if (check_no_cilk (cond,
- "Cilk array notation cannot be used as a condition for while statement",
- "%<_Cilk_spawn%> statement cannot be used as a condition for while statement"))
- cond = error_mark_node;
if (ivdep && cond != error_mark_node)
cond = build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond,
build_int_cst (integer_type_node,
@@ -6116,10 +5942,6 @@ c_parser_do_statement (c_parser *parser, bool ivdep)
new_cont = c_cont_label;
c_cont_label = save_cont;
cond = c_parser_paren_condition (parser);
- if (check_no_cilk (cond,
- "Cilk array notation cannot be used as a condition for a do-while statement",
- "%<_Cilk_spawn%> statement cannot be used as a condition for a do-while statement"))
- cond = error_mark_node;
if (ivdep && cond != error_mark_node)
cond = build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond,
build_int_cst (integer_type_node,
@@ -6278,8 +6100,6 @@ c_parser_for_statement (c_parser *parser, bool ivdep, bool *if_p)
struct c_expr ce;
tree init_expression;
ce = c_parser_expression (parser);
- /* In theory we could forbid _Cilk_spawn here, as the spec says "only in top
- level statement", but it works just fine, so allow it. */
init_expression = ce.value;
parser->objc_could_be_foreach_context = false;
if (c_parser_next_token_is_keyword (parser, RID_IN))
@@ -6321,10 +6141,6 @@ c_parser_for_statement (c_parser *parser, bool ivdep, bool *if_p)
else
{
cond = c_parser_condition (parser);
- if (check_no_cilk (cond,
- "Cilk array notation cannot be used in a condition for a for-loop",
- "%<_Cilk_spawn%> statement cannot be used in a condition for a for-loop"))
- cond = error_mark_node;
c_parser_skip_until_found (parser, CPP_SEMICOLON,
"expected %<;%>");
}
@@ -7284,27 +7100,15 @@ c_parser_unary_expression (c_parser *parser)
exp_loc = c_parser_peek_token (parser)->location;
op = c_parser_cast_expression (parser, NULL);
- /* If there is array notations in op, we expand them. */
- if (flag_cilkplus && TREE_CODE (op.value) == ARRAY_NOTATION_REF)
- return fix_array_notation_expr (exp_loc, PREINCREMENT_EXPR, op);
- else
- {
- op = default_function_array_read_conversion (exp_loc, op);
- return parser_build_unary_op (op_loc, PREINCREMENT_EXPR, op);
- }
+ op = default_function_array_read_conversion (exp_loc, op);
+ return parser_build_unary_op (op_loc, PREINCREMENT_EXPR, op);
case CPP_MINUS_MINUS:
c_parser_consume_token (parser);
exp_loc = c_parser_peek_token (parser)->location;
op = c_parser_cast_expression (parser, NULL);
- /* If there is array notations in op, we expand them. */
- if (flag_cilkplus && TREE_CODE (op.value) == ARRAY_NOTATION_REF)
- return fix_array_notation_expr (exp_loc, PREDECREMENT_EXPR, op);
- else
- {
- op = default_function_array_read_conversion (exp_loc, op);
- return parser_build_unary_op (op_loc, PREDECREMENT_EXPR, op);
- }
+ op = default_function_array_read_conversion (exp_loc, op);
+ return parser_build_unary_op (op_loc, PREDECREMENT_EXPR, op);
case CPP_AND:
c_parser_consume_token (parser);
op = c_parser_cast_expression (parser, NULL);
@@ -9082,30 +8886,6 @@ c_parser_postfix_expression (c_parser *parser)
case RID_GENERIC:
expr = c_parser_generic_selection (parser);
break;
- case RID_CILK_SPAWN:
- c_parser_consume_token (parser);
- if (!flag_cilkplus)
- {
- error_at (loc, "-fcilkplus must be enabled to use "
- "%<_Cilk_spawn%>");
- expr = c_parser_cast_expression (parser, NULL);
- expr.set_error ();
- }
- else if (c_parser_peek_token (parser)->keyword == RID_CILK_SPAWN)
- {
- error_at (loc, "consecutive %<_Cilk_spawn%> keywords "
- "are not permitted");
- /* Now flush out all the _Cilk_spawns. */
- while (c_parser_peek_token (parser)->keyword == RID_CILK_SPAWN)
- c_parser_consume_token (parser);
- expr = c_parser_cast_expression (parser, NULL);
- }
- else
- {
- expr = c_parser_cast_expression (parser, NULL);
- expr.value = build_cilk_spawn (loc, expr.value);
- }
- break;
default:
c_parser_error (parser, "expected expression");
expr.set_error ();
@@ -9249,39 +9029,13 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
case CPP_OPEN_SQUARE:
/* Array reference. */
c_parser_consume_token (parser);
- if (flag_cilkplus
- && c_parser_peek_token (parser)->type == CPP_COLON)
- /* If we are here, then we have something like this:
- Array [ : ]
- */
- expr.value = c_parser_array_notation (expr_loc, parser, NULL_TREE,
- expr.value);
- else
- {
- idx = c_parser_expression (parser).value;
- /* Here we have 3 options:
- 1. Array [EXPR] -- Normal Array call.
- 2. Array [EXPR : EXPR] -- Array notation without stride.
- 3. Array [EXPR : EXPR : EXPR] -- Array notation with stride.
-
- For 1, we just handle it just like a normal array expression.
- For 2 and 3 we handle it like we handle array notations. The
- idx value we have above becomes the initial/start index.
- */
- if (flag_cilkplus
- && c_parser_peek_token (parser)->type == CPP_COLON)
- expr.value = c_parser_array_notation (expr_loc, parser, idx,
- expr.value);
- else
- {
- c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE,
- "expected %<]%>");
- start = expr.get_start ();
- finish = parser->tokens_buf[0].location;
- expr.value = build_array_ref (op_loc, expr.value, idx);
- set_c_expr_source_range (&expr, start, finish);
- }
- }
+ idx = c_parser_expression (parser).value;
+ c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE,
+ "expected %<]%>");
+ start = expr.get_start ();
+ finish = parser->tokens_buf[0].location;
+ expr.value = build_array_ref (op_loc, expr.value, idx);
+ set_c_expr_source_range (&expr, start, finish);
expr.original_code = ERROR_MARK;
expr.original_type = NULL;
break;
@@ -9422,16 +9176,9 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
start = expr.get_start ();
finish = c_parser_peek_token (parser)->get_finish ();
c_parser_consume_token (parser);
- /* If the expressions have array notations, we expand them. */
- if (flag_cilkplus
- && TREE_CODE (expr.value) == ARRAY_NOTATION_REF)
- expr = fix_array_notation_expr (expr_loc, POSTINCREMENT_EXPR, expr);
- else
- {
- expr = default_function_array_read_conversion (expr_loc, expr);
- expr.value = build_unary_op (op_loc, POSTINCREMENT_EXPR,
- expr.value, false);
- }
+ expr = default_function_array_read_conversion (expr_loc, expr);
+ expr.value = build_unary_op (op_loc, POSTINCREMENT_EXPR,
+ expr.value, false);
set_c_expr_source_range (&expr, start, finish);
expr.original_code = ERROR_MARK;
expr.original_type = NULL;
@@ -9441,16 +9188,9 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
start = expr.get_start ();
finish = c_parser_peek_token (parser)->get_finish ();
c_parser_consume_token (parser);
- /* If the expressions have array notations, we expand them. */
- if (flag_cilkplus
- && TREE_CODE (expr.value) == ARRAY_NOTATION_REF)
- expr = fix_array_notation_expr (expr_loc, POSTDECREMENT_EXPR, expr);
- else
- {
- expr = default_function_array_read_conversion (expr_loc, expr);
- expr.value = build_unary_op (op_loc, POSTDECREMENT_EXPR,
- expr.value, false);
- }
+ expr = default_function_array_read_conversion (expr_loc, expr);
+ expr.value = build_unary_op (op_loc, POSTDECREMENT_EXPR,
+ expr.value, false);
set_c_expr_source_range (&expr, start, finish);
expr.original_code = ERROR_MARK;
expr.original_type = NULL;
@@ -11206,30 +10946,6 @@ c_parser_pragma (c_parser *parser, enum pragma_context context, bool *if_p)
c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL);
return false;
- case PRAGMA_CILK_SIMD:
- if (!c_parser_cilk_verify_simd (parser, context))
- return false;
- c_parser_consume_pragma (parser);
- c_parser_cilk_simd (parser, if_p);
- return false;
- case PRAGMA_CILK_GRAINSIZE:
- if (!flag_cilkplus)
- {
- warning (0, "%<#pragma grainsize%> ignored because -fcilkplus is not"
- " enabled");
- c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL);
- return false;
- }
- if (context == pragma_external)
- {
- error_at (c_parser_peek_token (parser)->location,
- "%<#pragma grainsize%> must be inside a function");
- c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL);
- return false;
- }
- c_parser_cilk_grainsize (parser, if_p);
- return false;
-
case PRAGMA_OACC_WAIT:
if (context != pragma_compound)
{
@@ -11412,8 +11128,6 @@ c_parser_omp_clause_name (c_parser *parser)
result = PRAGMA_OMP_CLAUSE_MAP;
else if (!strcmp ("mergeable", p))
result = PRAGMA_OMP_CLAUSE_MERGEABLE;
- else if (flag_cilkplus && !strcmp ("mask", p))
- result = PRAGMA_CILK_CLAUSE_MASK;
break;
case 'n':
if (!strcmp ("nogroup", p))
@@ -11432,8 +11146,6 @@ c_parser_omp_clause_name (c_parser *parser)
result = PRAGMA_OMP_CLAUSE_NUM_THREADS;
else if (!strcmp ("num_workers", p))
result = PRAGMA_OACC_CLAUSE_NUM_WORKERS;
- else if (flag_cilkplus && !strcmp ("nomask", p))
- result = PRAGMA_CILK_CLAUSE_NOMASK;
break;
case 'o':
if (!strcmp ("ordered", p))
@@ -11512,8 +11224,6 @@ c_parser_omp_clause_name (c_parser *parser)
result = PRAGMA_OACC_CLAUSE_VECTOR;
else if (!strcmp ("vector_length", p))
result = PRAGMA_OACC_CLAUSE_VECTOR_LENGTH;
- else if (flag_cilkplus && !strcmp ("vectorlength", p))
- result = PRAGMA_CILK_CLAUSE_VECTORLENGTH;
break;
case 'w':
if (!strcmp ("wait", p))
@@ -13414,7 +13124,7 @@ c_parser_omp_clause_aligned (c_parser *parser, tree list)
linear ( modifier ( variable-list ) : expression ) */
static tree
-c_parser_omp_clause_linear (c_parser *parser, tree list, bool is_cilk_simd_fn)
+c_parser_omp_clause_linear (c_parser *parser, tree list)
{
location_t clause_loc = c_parser_peek_token (parser)->location;
tree nl, c, step;
@@ -13424,8 +13134,7 @@ c_parser_omp_clause_linear (c_parser *parser, tree list, bool is_cilk_simd_fn)
if (!parens.require_open (parser))
return list;
- if (!is_cilk_simd_fn
- && c_parser_next_token_is (parser, CPP_NAME))
+ if (c_parser_next_token_is (parser, CPP_NAME))
{
c_token *tok = c_parser_peek_token (parser);
const char *p = IDENTIFIER_POINTER (tok->value);
@@ -13454,11 +13163,6 @@ c_parser_omp_clause_linear (c_parser *parser, tree list, bool is_cilk_simd_fn)
expr = convert_lvalue_to_rvalue (expr_loc, expr, false, true);
step = expr.value;
step = c_fully_fold (step, false, NULL);
- if (is_cilk_simd_fn && TREE_CODE (step) == PARM_DECL)
- {
- sorry ("using parameters for %<linear%> step is not supported yet");
- step = integer_one_node;
- }
if (!INTEGRAL_TYPE_P (TREE_TYPE (step)))
{
error_at (clause_loc, "%<linear%> clause step expression must "
@@ -14218,7 +13922,7 @@ c_parser_omp_all_clauses (c_parser *parser, omp_clause_mask mask,
const char *where, bool finish_p = true)
{
tree clauses = NULL;
- bool first = true, cilk_simd_fn = false;
+ bool first = true;
while (c_parser_next_token_is_not (parser, CPP_PRAGMA_EOL))
{
@@ -14324,13 +14028,11 @@ c_parser_omp_all_clauses (c_parser *parser, omp_clause_mask mask,
c_name = "untied";
break;
case PRAGMA_OMP_CLAUSE_INBRANCH:
- case PRAGMA_CILK_CLAUSE_MASK:
clauses = c_parser_omp_clause_branch (parser, OMP_CLAUSE_INBRANCH,
clauses);
c_name = "inbranch";
break;
case PRAGMA_OMP_CLAUSE_NOTINBRANCH:
- case PRAGMA_CILK_CLAUSE_NOMASK:
clauses = c_parser_omp_clause_branch (parser, OMP_CLAUSE_NOTINBRANCH,
clauses);
c_name = "notinbranch";
@@ -14407,9 +14109,7 @@ c_parser_omp_all_clauses (c_parser *parser, omp_clause_mask mask,
c_name = "aligned";
break;
case PRAGMA_OMP_CLAUSE_LINEAR:
- if (((mask >> PRAGMA_CILK_CLAUSE_VECTORLENGTH) & 1) != 0)
- cilk_simd_fn = true;
- clauses = c_parser_omp_clause_linear (parser, clauses, cilk_simd_fn);
+ clauses = c_parser_omp_clause_linear (parser, clauses);
c_name = "linear";
break;
case PRAGMA_OMP_CLAUSE_DEPEND:
@@ -14444,10 +14144,6 @@ c_parser_omp_all_clauses (c_parser *parser, omp_clause_mask mask,
clauses = c_parser_omp_clause_safelen (parser, clauses);
c_name = "safelen";
break;
- case PRAGMA_CILK_CLAUSE_VECTORLENGTH:
- clauses = c_parser_cilk_clause_vectorlength (parser, clauses, true);
- c_name = "simdlen";
- break;
case PRAGMA_OMP_CLAUSE_SIMDLEN:
clauses = c_parser_omp_clause_simdlen (parser, clauses);
c_name = "simdlen";
@@ -15781,18 +15477,11 @@ c_parser_omp_for_loop (location_t loc, c_parser *parser, enum tree_code code,
condv = make_tree_vec (count);
incrv = make_tree_vec (count);
- if (code != CILK_FOR
- && !c_parser_next_token_is_keyword (parser, RID_FOR))
+ if (!c_parser_next_token_is_keyword (parser, RID_FOR))
{
c_parser_error (parser, "for statement expected");
return NULL;
}
- if (code == CILK_FOR
- && !c_parser_next_token_is_keyword (parser, RID_CILK_FOR))
- {
- c_parser_error (parser, "_Cilk_for statement expected");
- return NULL;
- }
for_loc = c_parser_peek_token (parser)->location;
c_parser_consume_token (parser);
@@ -15892,10 +15581,6 @@ c_parser_omp_for_loop (location_t loc, c_parser *parser, enum tree_code code,
case LT_EXPR:
case LE_EXPR:
break;
- case NE_EXPR:
- if (code == CILK_SIMD || code == CILK_FOR)
- break;
- /* FALLTHRU. */
default:
/* Can't be cond = error_mark_node, because we want to preserve
the location until c_finish_omp_for. */
@@ -15972,10 +15657,7 @@ c_parser_omp_for_loop (location_t loc, c_parser *parser, enum tree_code code,
if_p = NULL;
save_break = c_break_label;
- if (code == CILK_SIMD)
- c_break_label = build_int_cst (size_type_node, 2);
- else
- c_break_label = size_one_node;
+ c_break_label = size_one_node;
save_cont = c_cont_label;
c_cont_label = NULL_TREE;
body = push_stmt_list ();
@@ -17529,18 +17211,6 @@ static void
c_finish_omp_declare_simd (c_parser *parser, tree fndecl, tree parms,
vec<c_token> clauses)
{
- if (flag_cilkplus
- && (clauses.exists ()
- || lookup_attribute ("simd", DECL_ATTRIBUTES (fndecl)))
- && !vec_safe_is_empty (parser->cilk_simd_fn_tokens))
- {
- error ("%<#pragma omp declare simd%> or %<simd%> attribute cannot be "
- "used in the same function marked as a Cilk Plus SIMD-enabled "
- "function");
- vec_free (parser->cilk_simd_fn_tokens);
- return;
- }
-
/* Normally first token is CPP_NAME "simd". CPP_EOF there indicates
error has been reported and CPP_PRAGMA that c_finish_omp_declare_simd
has already processed the tokens. */
@@ -17567,60 +17237,26 @@ c_finish_omp_declare_simd (c_parser *parser, tree fndecl, tree parms,
unsigned int tokens_avail = parser->tokens_avail;
gcc_assert (parser->tokens == &parser->tokens_buf[0]);
- bool is_cilkplus_cilk_simd_fn = false;
- if (flag_cilkplus && !vec_safe_is_empty (parser->cilk_simd_fn_tokens))
- {
- parser->tokens = parser->cilk_simd_fn_tokens->address ();
- parser->tokens_avail = vec_safe_length (parser->cilk_simd_fn_tokens);
- is_cilkplus_cilk_simd_fn = true;
-
- if (lookup_attribute ("simd", DECL_ATTRIBUTES (fndecl)) != NULL)
- {
- error_at (DECL_SOURCE_LOCATION (fndecl),
- "%<__simd__%> attribute cannot be used in the same "
- "function marked as a Cilk Plus SIMD-enabled function");
- vec_free (parser->cilk_simd_fn_tokens);
- return;
- }
- }
- else
- {
- parser->tokens = clauses.address ();
- parser->tokens_avail = clauses.length ();
- }
+ parser->tokens = clauses.address ();
+ parser->tokens_avail = clauses.length ();
/* c_parser_omp_declare_simd pushed 2 extra CPP_EOF tokens at the end. */
while (parser->tokens_avail > 3)
{
c_token *token = c_parser_peek_token (parser);
- if (!is_cilkplus_cilk_simd_fn)
- gcc_assert (token->type == CPP_NAME
- && strcmp (IDENTIFIER_POINTER (token->value), "simd") == 0);
- else
- gcc_assert (token->type == CPP_NAME
- && is_cilkplus_vector_p (token->value));
+ gcc_assert (token->type == CPP_NAME
+ && strcmp (IDENTIFIER_POINTER (token->value), "simd") == 0);
c_parser_consume_token (parser);
parser->in_pragma = true;
tree c = NULL_TREE;
- if (is_cilkplus_cilk_simd_fn)
- c = c_parser_omp_all_clauses (parser, CILK_SIMD_FN_CLAUSE_MASK,
- "SIMD-enabled functions attribute");
- else
- c = c_parser_omp_all_clauses (parser, OMP_DECLARE_SIMD_CLAUSE_MASK,
+ c = c_parser_omp_all_clauses (parser, OMP_DECLARE_SIMD_CLAUSE_MASK,
"#pragma omp declare simd");
c = c_omp_declare_simd_clauses_to_numbers (parms, c);
if (c != NULL_TREE)
c = tree_cons (NULL_TREE, c, NULL_TREE);
- if (is_cilkplus_cilk_simd_fn)
- {
- tree k = build_tree_list (get_identifier ("cilk simd function"),
- NULL_TREE);
- TREE_CHAIN (k) = DECL_ATTRIBUTES (fndecl);
- DECL_ATTRIBUTES (fndecl) = k;
- }
c = build_tree_list (get_identifier ("omp declare simd"), c);
TREE_CHAIN (c) = DECL_ATTRIBUTES (fndecl);
DECL_ATTRIBUTES (fndecl) = c;
@@ -17630,9 +17266,6 @@ c_finish_omp_declare_simd (c_parser *parser, tree fndecl, tree parms,
parser->tokens_avail = tokens_avail;
if (clauses.exists ())
clauses[0].type = CPP_PRAGMA;
-
- if (!vec_safe_is_empty (parser->cilk_simd_fn_tokens))
- vec_free (parser->cilk_simd_fn_tokens);
}
@@ -18384,419 +18017,7 @@ c_parser_omp_threadprivate (c_parser *parser)
c_parser_skip_to_pragma_eol (parser);
}
-
-/* Cilk Plus <#pragma simd> parsing routines. */
-
-/* Helper function for c_parser_pragma. Perform some sanity checking
- for <#pragma simd> constructs. Returns FALSE if there was a
- problem. */
-
-static bool
-c_parser_cilk_verify_simd (c_parser *parser,
- enum pragma_context context)
-{
- if (!flag_cilkplus)
- {
- warning (0, "pragma simd ignored because -fcilkplus is not enabled");
- c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL);
- return false;
- }
- if (context == pragma_external)
- {
- c_parser_error (parser,"pragma simd must be inside a function");
- c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL);
- return false;
- }
- return true;
-}
-
-/* Cilk Plus:
- This function is shared by SIMD-enabled functions and #pragma simd.
- If IS_SIMD_FN is true then it is parsing a SIMD-enabled function and
- CLAUSES is unused. The main purpose of this function is to parse a
- vectorlength attribute or clause and check for parse errors.
- When IS_SIMD_FN is true then the function is merely caching the tokens
- in PARSER->CILK_SIMD_FN_TOKENS. If errors are found then the token
- cache is cleared since there is no reason to continue.
- Syntax:
- vectorlength ( constant-expression ) */
-
-static tree
-c_parser_cilk_clause_vectorlength (c_parser *parser, tree clauses,
- bool is_simd_fn)
-{
- if (is_simd_fn)
- check_no_duplicate_clause (clauses, OMP_CLAUSE_SIMDLEN, "vectorlength");
- else
- /* The vectorlength clause behaves exactly like OpenMP's safelen
- clause. Represent it in OpenMP terms. */
- check_no_duplicate_clause (clauses, OMP_CLAUSE_SAFELEN, "vectorlength");
-
- matching_parens parens;
- if (!parens.require_open (parser))
- return clauses;
-
- location_t loc = c_parser_peek_token (parser)->location;
- tree expr = c_parser_expr_no_commas (parser, NULL).value;
- expr = c_fully_fold (expr, false, NULL);
-
- /* If expr is an error_mark_node then the above function would have
- emitted an error. No reason to do it twice. */
- if (expr == error_mark_node)
- ;
- else if (!TREE_TYPE (expr)
- || !TREE_CONSTANT (expr)
- || !INTEGRAL_TYPE_P (TREE_TYPE (expr)))
-
- error_at (loc, "vectorlength must be an integer constant");
- else if (wi::exact_log2 (wi::to_wide (expr)) == -1)
- error_at (loc, "vectorlength must be a power of 2");
- else
- {
- if (is_simd_fn)
- {
- tree u = build_omp_clause (loc, OMP_CLAUSE_SIMDLEN);
- OMP_CLAUSE_SIMDLEN_EXPR (u) = expr;
- OMP_CLAUSE_CHAIN (u) = clauses;
- clauses = u;
- }
- else
- {
- tree u = build_omp_clause (loc, OMP_CLAUSE_SAFELEN);
- OMP_CLAUSE_SAFELEN_EXPR (u) = expr;
- OMP_CLAUSE_CHAIN (u) = clauses;
- clauses = u;
- }
- }
-
- parens.require_close (parser);
-
- return clauses;
-}
-
-/* Cilk Plus:
- linear ( simd-linear-variable-list )
-
- simd-linear-variable-list:
- simd-linear-variable
- simd-linear-variable-list , simd-linear-variable
-
- simd-linear-variable:
- id-expression
- id-expression : simd-linear-step
-
- simd-linear-step:
- conditional-expression */
-
-static tree
-c_parser_cilk_clause_linear (c_parser *parser, tree clauses)
-{
- matching_parens parens;
- if (!parens.require_open (parser))
- return clauses;
-
- location_t loc = c_parser_peek_token (parser)->location;
-
- if (c_parser_next_token_is_not (parser, CPP_NAME)
- || c_parser_peek_token (parser)->id_kind != C_ID_ID)
- c_parser_error (parser, "expected identifier");
-
- while (c_parser_next_token_is (parser, CPP_NAME)
- && c_parser_peek_token (parser)->id_kind == C_ID_ID)
- {
- tree var = lookup_name (c_parser_peek_token (parser)->value);
-
- if (var == NULL)
- {
- undeclared_variable (c_parser_peek_token (parser)->location,
- c_parser_peek_token (parser)->value);
- c_parser_consume_token (parser);
- }
- else if (var == error_mark_node)
- c_parser_consume_token (parser);
- else
- {
- tree step = integer_one_node;
-
- /* Parse the linear step if present. */
- if (c_parser_peek_2nd_token (parser)->type == CPP_COLON)
- {
- c_parser_consume_token (parser);
- c_parser_consume_token (parser);
-
- tree expr = c_parser_expr_no_commas (parser, NULL).value;
- expr = c_fully_fold (expr, false, NULL);
-
- if (TREE_TYPE (expr)
- && INTEGRAL_TYPE_P (TREE_TYPE (expr))
- && (TREE_CONSTANT (expr)
- || DECL_P (expr)))
- step = expr;
- else
- c_parser_error (parser,
- "step size must be an integer constant "
- "expression or an integer variable");
- }
- else
- c_parser_consume_token (parser);
-
- /* Use OMP_CLAUSE_LINEAR, which has the same semantics. */
- tree u = build_omp_clause (loc, OMP_CLAUSE_LINEAR);
- OMP_CLAUSE_DECL (u) = var;
- OMP_CLAUSE_LINEAR_STEP (u) = step;
- OMP_CLAUSE_CHAIN (u) = clauses;
- clauses = u;
- }
-
- if (c_parser_next_token_is_not (parser, CPP_COMMA))
- break;
-
- c_parser_consume_token (parser);
- }
-
- parens.skip_until_found_close (parser);
-
- return clauses;
-}
-
-/* Returns the name of the next clause. If the clause is not
- recognized SIMD_OMP_CLAUSE_NONE is returned and the next token is
- not consumed. Otherwise, the appropriate pragma_simd_clause is
- returned and the token is consumed. */
-
-static pragma_omp_clause
-c_parser_cilk_clause_name (c_parser *parser)
-{
- pragma_omp_clause result;
- c_token *token = c_parser_peek_token (parser);
-
- if (!token->value || token->type != CPP_NAME)
- return PRAGMA_CILK_CLAUSE_NONE;
-
- const char *p = IDENTIFIER_POINTER (token->value);
-
- if (!strcmp (p, "vectorlength"))
- result = PRAGMA_CILK_CLAUSE_VECTORLENGTH;
- else if (!strcmp (p, "linear"))
- result = PRAGMA_CILK_CLAUSE_LINEAR;
- else if (!strcmp (p, "private"))
- result = PRAGMA_CILK_CLAUSE_PRIVATE;
- else if (!strcmp (p, "firstprivate"))
- result = PRAGMA_CILK_CLAUSE_FIRSTPRIVATE;
- else if (!strcmp (p, "lastprivate"))
- result = PRAGMA_CILK_CLAUSE_LASTPRIVATE;
- else if (!strcmp (p, "reduction"))
- result = PRAGMA_CILK_CLAUSE_REDUCTION;
- else
- return PRAGMA_CILK_CLAUSE_NONE;
-
- c_parser_consume_token (parser);
- return result;
-}
-
-/* Parse all #<pragma simd> clauses. Return the list of clauses
- found. */
-
-static tree
-c_parser_cilk_all_clauses (c_parser *parser)
-{
- tree clauses = NULL;
-
- while (c_parser_next_token_is_not (parser, CPP_PRAGMA_EOL))
- {
- pragma_omp_clause c_kind;
-
- c_kind = c_parser_cilk_clause_name (parser);
-
- switch (c_kind)
- {
- case PRAGMA_CILK_CLAUSE_VECTORLENGTH:
- clauses = c_parser_cilk_clause_vectorlength (parser, clauses, false);
- break;
- case PRAGMA_CILK_CLAUSE_LINEAR:
- clauses = c_parser_cilk_clause_linear (parser, clauses);
- break;
- case PRAGMA_CILK_CLAUSE_PRIVATE:
- /* Use the OpenMP counterpart. */
- clauses = c_parser_omp_clause_private (parser, clauses);
- break;
- case PRAGMA_CILK_CLAUSE_FIRSTPRIVATE:
- /* Use the OpenMP counterpart. */
- clauses = c_parser_omp_clause_firstprivate (parser, clauses);
- break;
- case PRAGMA_CILK_CLAUSE_LASTPRIVATE:
- /* Use the OpenMP counterpart. */
- clauses = c_parser_omp_clause_lastprivate (parser, clauses);
- break;
- case PRAGMA_CILK_CLAUSE_REDUCTION:
- /* Use the OpenMP counterpart. */
- clauses = c_parser_omp_clause_reduction (parser, clauses);
- break;
- default:
- c_parser_error (parser, "expected %<#pragma simd%> clause");
- goto saw_error;
- }
- }
-
- saw_error:
- c_parser_skip_to_pragma_eol (parser);
- return c_finish_omp_clauses (clauses, C_ORT_CILK);
-}
-
-/* This function helps parse the grainsize pragma for a _Cilk_for statement.
- Here is the correct syntax of this pragma:
- #pragma cilk grainsize = <EXP>
- */
-
-static void
-c_parser_cilk_grainsize (c_parser *parser, bool *if_p)
-{
- extern tree convert_to_integer (tree, tree);
-
- /* consume the 'grainsize' keyword. */
- c_parser_consume_pragma (parser);
-
- if (c_parser_require (parser, CPP_EQ, "expected %<=%>") != 0)
- {
- struct c_expr g_expr = c_parser_binary_expression (parser, NULL, NULL);
- if (g_expr.value == error_mark_node)
- {
- c_parser_skip_to_pragma_eol (parser);
- return;
- }
- tree grain = convert_to_integer (long_integer_type_node,
- c_fully_fold (g_expr.value, false,
- NULL));
- c_parser_skip_to_pragma_eol (parser);
- c_token *token = c_parser_peek_token (parser);
- if (token && token->type == CPP_KEYWORD
- && token->keyword == RID_CILK_FOR)
- {
- if (grain == NULL_TREE || grain == error_mark_node)
- grain = integer_zero_node;
- c_parser_cilk_for (parser, grain, if_p);
- }
- else
- warning (0, "%<#pragma cilk grainsize%> is not followed by "
- "%<_Cilk_for%>");
- }
- else
- c_parser_skip_to_pragma_eol (parser);
-}
-
-/* Main entry point for parsing Cilk Plus <#pragma simd> for loops. */
-
-static void
-c_parser_cilk_simd (c_parser *parser, bool *if_p)
-{
- tree clauses = c_parser_cilk_all_clauses (parser);
- tree block = c_begin_compound_stmt (true);
- location_t loc = c_parser_peek_token (parser)->location;
- c_parser_omp_for_loop (loc, parser, CILK_SIMD, clauses, NULL, if_p);
- block = c_end_compound_stmt (loc, block, true);
- add_stmt (block);
-}
-
-/* Create an artificial decl with TYPE and emit initialization of it with
- INIT. */
-
-static tree
-c_get_temp_regvar (tree type, tree init)
-{
- location_t loc = EXPR_LOCATION (init);
- tree decl = build_decl (loc, VAR_DECL, NULL_TREE, type);
- DECL_ARTIFICIAL (decl) = 1;
- DECL_IGNORED_P (decl) = 1;
- pushdecl (decl);
- tree t = build2 (INIT_EXPR, type, decl, init);
- add_stmt (t);
- return decl;
-}
-
-/* Main entry point for parsing Cilk Plus _Cilk_for loops.
- GRAIN is the grain value passed in through pragma or 0. */
-
-static void
-c_parser_cilk_for (c_parser *parser, tree grain, bool *if_p)
-{
- tree clauses = build_omp_clause (EXPR_LOCATION (grain), OMP_CLAUSE_SCHEDULE);
- OMP_CLAUSE_SCHEDULE_KIND (clauses) = OMP_CLAUSE_SCHEDULE_CILKFOR;
- OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clauses) = grain;
- clauses = c_finish_omp_clauses (clauses, C_ORT_CILK);
-
- tree block = c_begin_compound_stmt (true);
- tree sb = push_stmt_list ();
- location_t loc = c_parser_peek_token (parser)->location;
- tree omp_for = c_parser_omp_for_loop (loc, parser, CILK_FOR, clauses, NULL,
- if_p);
- sb = pop_stmt_list (sb);
-
- if (omp_for)
- {
- tree omp_par = make_node (OMP_PARALLEL);
- TREE_TYPE (omp_par) = void_type_node;
- OMP_PARALLEL_CLAUSES (omp_par) = NULL_TREE;
- tree bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
- TREE_SIDE_EFFECTS (bind) = 1;
- BIND_EXPR_BODY (bind) = sb;
- OMP_PARALLEL_BODY (omp_par) = bind;
- if (OMP_FOR_PRE_BODY (omp_for))
- {
- add_stmt (OMP_FOR_PRE_BODY (omp_for));
- OMP_FOR_PRE_BODY (omp_for) = NULL_TREE;
- }
- tree init = TREE_VEC_ELT (OMP_FOR_INIT (omp_for), 0);
- tree decl = TREE_OPERAND (init, 0);
- tree cond = TREE_VEC_ELT (OMP_FOR_COND (omp_for), 0);
- tree incr = TREE_VEC_ELT (OMP_FOR_INCR (omp_for), 0);
- tree t = TREE_OPERAND (cond, 1), c, clauses = NULL_TREE;
- if (TREE_CODE (t) != INTEGER_CST)
- {
- TREE_OPERAND (cond, 1) = c_get_temp_regvar (TREE_TYPE (t), t);
- c = build_omp_clause (input_location, OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = TREE_OPERAND (cond, 1);
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- if (TREE_CODE (incr) == MODIFY_EXPR)
- {
- t = TREE_OPERAND (TREE_OPERAND (incr, 1), 1);
- if (TREE_CODE (t) != INTEGER_CST)
- {
- TREE_OPERAND (TREE_OPERAND (incr, 1), 1)
- = c_get_temp_regvar (TREE_TYPE (t), t);
- c = build_omp_clause (input_location, OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = TREE_OPERAND (TREE_OPERAND (incr, 1), 1);
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- }
- t = TREE_OPERAND (init, 1);
- if (TREE_CODE (t) != INTEGER_CST)
- {
- TREE_OPERAND (init, 1) = c_get_temp_regvar (TREE_TYPE (t), t);
- c = build_omp_clause (input_location, OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = TREE_OPERAND (init, 1);
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- c = build_omp_clause (input_location, OMP_CLAUSE_PRIVATE);
- OMP_CLAUSE_DECL (c) = decl;
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- c = build_omp_clause (input_location, OMP_CLAUSE__CILK_FOR_COUNT_);
- OMP_CLAUSE_OPERAND (c, 0)
- = cilk_for_number_of_iterations (omp_for);
- OMP_CLAUSE_CHAIN (c) = clauses;
- OMP_PARALLEL_CLAUSES (omp_par) = c_finish_omp_clauses (c, C_ORT_CILK);
- add_stmt (omp_par);
- }
-
- block = c_end_compound_stmt (loc, block, true);
- add_stmt (block);
-}
-
/* Parse a transaction attribute (GCC Extension).
transaction-attribute:
@@ -19042,145 +18263,6 @@ c_parse_file (void)
the_parser = NULL;
}
-/* This function parses Cilk Plus array notation. The starting index is
- passed in INITIAL_INDEX and the array name is passes in ARRAY_VALUE. The
- return value of this function is a tree_node called VALUE_TREE of type
- ARRAY_NOTATION_REF. */
-
-static tree
-c_parser_array_notation (location_t loc, c_parser *parser, tree initial_index,
- tree array_value)
-{
- c_token *token = NULL;
- tree start_index = NULL_TREE, end_index = NULL_TREE, stride = NULL_TREE;
- tree value_tree = NULL_TREE, type = NULL_TREE, array_type = NULL_TREE;
- tree array_type_domain = NULL_TREE;
-
- if (array_value == error_mark_node || initial_index == error_mark_node)
- {
- /* No need to continue. If either of these 2 were true, then an error
- must be emitted already. Thus, no need to emit them twice. */
- c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL);
- return error_mark_node;
- }
-
- array_type = TREE_TYPE (array_value);
- gcc_assert (array_type);
- if (TREE_CODE (array_type) != ARRAY_TYPE
- && TREE_CODE (array_type) != POINTER_TYPE)
- {
- error_at (loc, "base of array section must be pointer or array type");
- c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL);
- return error_mark_node;
- }
- type = TREE_TYPE (array_type);
- token = c_parser_peek_token (parser);
-
- if (token->type == CPP_EOF)
- {
- c_parser_error (parser, "expected %<:%> or numeral");
- return value_tree;
- }
- else if (token->type == CPP_COLON)
- {
- if (!initial_index)
- {
- /* If we are here, then we have a case like this A[:]. */
- c_parser_consume_token (parser);
- if (TREE_CODE (array_type) == POINTER_TYPE)
- {
- error_at (loc, "start-index and length fields necessary for "
- "using array notations in pointers");
- c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL);
- return error_mark_node;
- }
- if (TREE_CODE (array_type) == FUNCTION_TYPE)
- {
- error_at (loc, "array notations cannot be used with function "
- "type");
- c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL);
- return error_mark_node;
- }
- array_type_domain = TYPE_DOMAIN (array_type);
-
- if (!array_type_domain)
- {
- error_at (loc, "start-index and length fields necessary for "
- "using array notations in dimensionless arrays");
- c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL);
- return error_mark_node;
- }
-
- start_index = TYPE_MIN_VALUE (array_type_domain);
- start_index = fold_build1 (CONVERT_EXPR, ptrdiff_type_node,
- start_index);
- if (!TYPE_MAX_VALUE (array_type_domain)
- || !TREE_CONSTANT (TYPE_MAX_VALUE (array_type_domain)))
- {
- error_at (loc, "start-index and length fields necessary for "
- "using array notations in variable-length arrays");
- c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL);
- return error_mark_node;
- }
- end_index = TYPE_MAX_VALUE (array_type_domain);
- end_index = fold_build2 (PLUS_EXPR, TREE_TYPE (end_index),
- end_index, integer_one_node);
- end_index = fold_build1 (CONVERT_EXPR, ptrdiff_type_node, end_index);
- stride = build_int_cst (integer_type_node, 1);
- stride = fold_build1 (CONVERT_EXPR, ptrdiff_type_node, stride);
- }
- else if (initial_index != error_mark_node)
- {
- /* If we are here, then there should be 2 possibilities:
- 1. Array [EXPR : EXPR]
- 2. Array [EXPR : EXPR : EXPR]
- */
- start_index = initial_index;
-
- if (TREE_CODE (array_type) == FUNCTION_TYPE)
- {
- error_at (loc, "array notations cannot be used with function "
- "type");
- c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, NULL);
- return error_mark_node;
- }
- c_parser_consume_token (parser); /* consume the ':' */
- struct c_expr ce = c_parser_expression (parser);
- ce = convert_lvalue_to_rvalue (loc, ce, false, false);
- end_index = ce.value;
- if (!end_index || end_index == error_mark_node)
- {
- c_parser_skip_to_end_of_block_or_statement (parser);
- return error_mark_node;
- }
- if (c_parser_peek_token (parser)->type == CPP_COLON)
- {
- c_parser_consume_token (parser);
- ce = c_parser_expression (parser);
- ce = convert_lvalue_to_rvalue (loc, ce, false, false);
- stride = ce.value;
- if (!stride || stride == error_mark_node)
- {
- c_parser_skip_to_end_of_block_or_statement (parser);
- return error_mark_node;
- }
- }
- }
- else
- c_parser_error (parser, "expected array notation expression");
- }
- else
- c_parser_error (parser, "expected array notation expression");
-
- c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, "expected %<]%>");
-
- value_tree = build_array_notation_ref (loc, array_value, start_index,
- end_index, stride, type);
- if (value_tree != error_mark_node)
- SET_EXPR_LOCATION (value_tree, loc);
- return value_tree;
-}
-
/* Parse the body of a function declaration marked with "__RTL".
The RTL parser works on the level of characters read from a
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index a4d3d39c3d0..f761305bfdc 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -46,7 +46,6 @@ along with GCC; see the file COPYING3. If not see
#include "omp-general.h"
#include "c-family/c-objc.h"
#include "c-family/c-ubsan.h"
-#include "cilk.h"
#include "gomp-constants.h"
#include "spellcheck-tree.h"
#include "gcc-rich-location.h"
@@ -2593,17 +2592,6 @@ build_array_ref (location_t loc, tree array, tree index)
|| TREE_TYPE (index) == error_mark_node)
return error_mark_node;
- if (flag_cilkplus && contains_array_notation_expr (index))
- {
- size_t rank = 0;
- if (!find_rank (loc, index, index, true, &rank))
- return error_mark_node;
- if (rank > 1)
- {
- error_at (loc, "rank of the array's index is greater than 1");
- return error_mark_node;
- }
- }
if (TREE_CODE (TREE_TYPE (array)) != ARRAY_TYPE
&& TREE_CODE (TREE_TYPE (array)) != POINTER_TYPE
/* Allow vector[index] but not index[vector]. */
@@ -3033,10 +3021,6 @@ build_function_call_vec (location_t loc, vec<location_t> arg_loc,
often rewritten and don't match the original parameter list. */
if (name && !strncmp (IDENTIFIER_POINTER (name), "__atomic_", 9))
origtypes = NULL;
-
- if (flag_cilkplus
- && is_cilkplus_reduce_builtin (function))
- origtypes = NULL;
}
if (TREE_CODE (TREE_TYPE (function)) == FUNCTION_TYPE)
function = function_to_pointer_conversion (loc, function);
@@ -3261,8 +3245,6 @@ convert_arguments (location_t loc, vec<location_t> arg_loc, tree typelist,
break;
}
}
- if (flag_cilkplus && fundecl && is_cilkplus_reduce_builtin (fundecl))
- return vec_safe_length (values);
/* Scan the given expressions and types, producing individual
converted arguments. */
@@ -4733,7 +4715,6 @@ lvalue_p (const_tree ref)
case INDIRECT_REF:
case ARRAY_REF:
- case ARRAY_NOTATION_REF:
case VAR_DECL:
case PARM_DECL:
case RESULT_DECL:
@@ -5301,14 +5282,6 @@ build_compound_expr (location_t loc, tree expr1, tree expr2)
tree eptype = NULL_TREE;
tree ret;
- if (flag_cilkplus
- && (TREE_CODE (expr1) == CILK_SPAWN_STMT
- || TREE_CODE (expr2) == CILK_SPAWN_STMT))
- {
- error_at (loc,
- "spawned function call cannot be part of a comma expression");
- return error_mark_node;
- }
expr1_int_operands = EXPR_INT_CONST_OPERANDS (expr1);
if (expr1_int_operands)
expr1 = remove_c_maybe_const_expr (expr1);
@@ -10051,7 +10024,6 @@ c_finish_return (location_t loc, tree retval, tree origtype)
tree valtype = TREE_TYPE (TREE_TYPE (current_function_decl)), ret_stmt;
bool no_warning = false;
bool npc = false;
- size_t rank = 0;
/* Use the expansion point to handle cases such as returning NULL
in a function returning void. */
@@ -10061,25 +10033,6 @@ c_finish_return (location_t loc, tree retval, tree origtype)
warning_at (xloc, 0,
"function declared %<noreturn%> has a %<return%> statement");
- if (flag_cilkplus && contains_array_notation_expr (retval))
- {
- /* Array notations are allowed in a return statement if it is inside a
- built-in array notation reduction function. */
- if (!find_rank (loc, retval, retval, false, &rank))
- return error_mark_node;
- if (rank >= 1)
- {
- error_at (loc, "array notation expression cannot be used as a "
- "return value");
- return error_mark_node;
- }
- }
- if (flag_cilkplus && retval && contains_cilk_spawn_stmt (retval))
- {
- error_at (loc, "use of %<_Cilk_spawn%> in a return statement is not "
- "allowed");
- return error_mark_node;
- }
if (retval)
{
tree semantic_type = NULL_TREE;
@@ -10425,35 +10378,6 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block,
{
tree stmt;
- /* If the condition has array notations, then the rank of the then_block and
- else_block must be either 0 or be equal to the rank of the condition. If
- the condition does not have array notations then break them up as it is
- broken up in a normal expression. */
- if (flag_cilkplus && contains_array_notation_expr (cond))
- {
- size_t then_rank = 0, cond_rank = 0, else_rank = 0;
- if (!find_rank (if_locus, cond, cond, true, &cond_rank))
- return;
- if (then_block
- && !find_rank (if_locus, then_block, then_block, true, &then_rank))
- return;
- if (else_block
- && !find_rank (if_locus, else_block, else_block, true, &else_rank))
- return;
- if (cond_rank != then_rank && then_rank != 0)
- {
- error_at (if_locus, "rank-mismatch between if-statement%'s condition"
- " and the then-block");
- return;
- }
- else if (cond_rank != else_rank && else_rank != 0)
- {
- error_at (if_locus, "rank-mismatch between if-statement%'s condition"
- " and the else-block");
- return;
- }
- }
-
stmt = build3 (COND_EXPR, void_type_node, cond, then_block, else_block);
SET_EXPR_LOCATION (stmt, if_locus);
add_stmt (stmt);
@@ -10471,9 +10395,6 @@ c_finish_loop (location_t start_locus, tree cond, tree incr, tree body,
{
tree entry = NULL, exit = NULL, t;
- /* In theory could forbid cilk spawn for loop increment expression,
- but it should work just fine. */
-
/* If the condition is zero don't generate a loop construct. */
if (cond && integer_zerop (cond))
{
@@ -11037,18 +10958,9 @@ build_binary_op (location_t location, enum tree_code code,
op1 = default_conversion (op1);
}
- /* When Cilk Plus is enabled and there are array notations inside op0, then
- we check to see if there are builtin array notation functions. If
- so, then we take on the type of the array notation inside it. */
- if (flag_cilkplus && contains_array_notation_expr (op0))
- orig_type0 = type0 = find_correct_array_notation_type (op0);
- else
- orig_type0 = type0 = TREE_TYPE (op0);
+ orig_type0 = type0 = TREE_TYPE (op0);
- if (flag_cilkplus && contains_array_notation_expr (op1))
- orig_type1 = type1 = find_correct_array_notation_type (op1);
- else
- orig_type1 = type1 = TREE_TYPE (op1);
+ orig_type1 = type1 = TREE_TYPE (op1);
/* The expression codes of the data types of the arguments tell us
whether the arguments are integers, floating, pointers, etc. */
@@ -13292,38 +13204,21 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
"clause on %<simd%> or %<for%> constructs");
OMP_CLAUSE_LINEAR_KIND (c) = OMP_CLAUSE_LINEAR_DEFAULT;
}
- if (ort & C_ORT_CILK)
+ if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
+ && TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE)
{
- if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
- && !SCALAR_FLOAT_TYPE_P (TREE_TYPE (t))
- && TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE)
- {
- error_at (OMP_CLAUSE_LOCATION (c),
- "linear clause applied to non-integral, "
- "non-floating, non-pointer variable with type %qT",
- TREE_TYPE (t));
- remove = true;
- break;
- }
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "linear clause applied to non-integral non-pointer "
+ "variable with type %qT", TREE_TYPE (t));
+ remove = true;
+ break;
}
- else
+ if (TYPE_ATOMIC (TREE_TYPE (t)))
{
- if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
- && TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE)
- {
- error_at (OMP_CLAUSE_LOCATION (c),
- "linear clause applied to non-integral non-pointer "
- "variable with type %qT", TREE_TYPE (t));
- remove = true;
- break;
- }
- if (TYPE_ATOMIC (TREE_TYPE (t)))
- {
- error_at (OMP_CLAUSE_LOCATION (c),
- "%<_Atomic%> %qD in %<linear%> clause", t);
- remove = true;
- break;
- }
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "%<_Atomic%> %qD in %<linear%> clause", t);
+ remove = true;
+ break;
}
if (ort == C_ORT_OMP_DECLARE_SIMD)
{
@@ -13855,7 +13750,6 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
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:
case OMP_CLAUSE_VECTOR_LENGTH:
@@ -14407,28 +14301,6 @@ c_tree_equal (tree t1, tree t2)
return false;
}
-/* Inserts "cleanup" functions after the function-body of FNDECL. FNDECL is a
- spawn-helper and BODY is the newly created body for FNDECL. */
-
-void
-cilk_install_body_with_frame_cleanup (tree fndecl, tree body, void *w)
-{
- tree list = alloc_stmt_list ();
- tree frame = make_cilk_frame (fndecl);
- tree dtor = create_cilk_function_exit (frame, false, true);
- add_local_decl (cfun, frame);
-
- DECL_SAVED_TREE (fndecl) = list;
-
- tree body_list = alloc_stmt_list ();
- cilk_outline (fndecl, &body, (struct wrapper_data *) w);
- body = fold_build_cleanup_point_expr (void_type_node, body);
-
- append_to_statement_list (body, &body_list);
- append_to_statement_list (build_stmt (EXPR_LOCATION (body), TRY_FINALLY_EXPR,
- body_list, dtor), &list);
-}
-
/* Returns true when the function declaration FNDECL is implicit,
introduced as a result of a call to an otherwise undeclared
function, and false otherwise. */
diff --git a/gcc/cif-code.def b/gcc/cif-code.def
index a2f05e016f2..92d81d30a49 100644
--- a/gcc/cif-code.def
+++ b/gcc/cif-code.def
@@ -128,10 +128,6 @@ DEFCIFCODE(USES_COMDAT_LOCAL, CIF_FINAL_ERROR,
DEFCIFCODE(ATTRIBUTE_MISMATCH, CIF_FINAL_ERROR,
N_("function attribute mismatch"))
-/* We can't inline because of mismatched caller/callee attributes. */
-DEFCIFCODE(CILK_SPAWN, CIF_FINAL_ERROR,
- N_("caller function contains cilk spawn"))
-
/* We proved that the call is unreachable. */
DEFCIFCODE(UNREACHABLE, CIF_FINAL_ERROR,
N_("unreachable"))
diff --git a/gcc/cilk-builtins.def b/gcc/cilk-builtins.def
deleted file mode 100644
index 348d08efd9e..00000000000
--- a/gcc/cilk-builtins.def
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This file contains the definitions and documentation for the
- Cilk Plus builtins used in the GNU compiler.
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
-
- Contributed by Balaji V. Iyer <balaji.v.iyer@intel.com>
- Intel Corporation.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-DEF_CILK_BUILTIN_STUB (BUILT_IN_CILK_ENTER_FRAME, "__cilkrts_enter_frame_1")
-DEF_CILK_BUILTIN_STUB (BUILT_IN_CILK_ENTER_FRAME_FAST,
- "__cilkrts_enter_frame_fast_1")
-DEF_CILK_BUILTIN_STUB (BUILT_IN_CILK_DETACH, "__cilkrts_detach")
-DEF_CILK_BUILTIN_STUB (BUILT_IN_CILK_RETHROW, "__cilkrts_rethrow")
-DEF_CILK_BUILTIN_STUB (BUILT_IN_CILK_SYNCHED, "__cilkrts_synched")
-DEF_CILK_BUILTIN_STUB (BUILT_IN_CILK_SYNC, "__cilkrts_sync")
-DEF_CILK_BUILTIN_STUB (BUILT_IN_CILK_LEAVE_FRAME, "__cilkrts_leave_frame")
-DEF_CILK_BUILTIN_STUB (BUILT_IN_CILK_POP_FRAME, "__cilkrts_pop_frame")
-DEF_CILK_BUILTIN_STUB (BUILT_IN_CILK_SAVE_FP, "__cilkrts_save_fp_ctrl_state")
-DEF_CILK_BUILTIN_STUB (BUILT_IN_CILK_FOR_32, "__cilkrts_cilk_for_32")
-DEF_CILK_BUILTIN_STUB (BUILT_IN_CILK_FOR_64, "__cilkrts_cilk_for_64")
diff --git a/gcc/cilk-common.c b/gcc/cilk-common.c
deleted file mode 100644
index edde4711869..00000000000
--- a/gcc/cilk-common.c
+++ /dev/null
@@ -1,571 +0,0 @@
-/* This file is part of the Intel(R) Cilk(TM) Plus support
- This file contains the CilkPlus Intrinsics
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
- Contributed by Balaji V. Iyer <balaji.v.iyer@intel.com>,
- Intel Corporation
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "function.h"
-#include "rtl.h"
-#include "tree.h"
-#include "stringpool.h"
-#include "expmed.h"
-#include "optabs-query.h"
-#include "insn-config.h"
-#include "memmodel.h"
-#include "emit-rtl.h"
-#include "recog.h"
-#include "fold-const.h"
-#include "stor-layout.h"
-#include "langhooks.h"
-#include "explow.h"
-#include "profile-count.h"
-#include "expr.h"
-#include "tree-iterator.h"
-#include "gimplify.h"
-#include "cilk.h"
-
-/* This structure holds all the important fields of the internal structures,
- internal built-in functions, and Cilk-specific data types. Explanation of
- all the these fielsd are given in cilk.h. */
-tree cilk_trees[(int) CILK_TI_MAX];
-
-/* Returns the value in structure FRAME pointed by the FIELD_NUMBER
- (e.g. X.y).
- FIELD_NUMBER is an index to the structure FRAME_PTR. For details
- about these fields, refer to cilk_trees structure in cilk.h and
- cilk_init_builtins function in this file. Returns a TREE that is the type
- of the field represented by FIELD_NUMBER. If VOLATIL parameter is set
- to true then the returning field is set as volatile. */
-
-tree
-cilk_dot (tree frame, int field_number, bool volatil)
-{
- tree field = cilk_trees[field_number];
- field = fold_build3 (COMPONENT_REF, TREE_TYPE (field), frame, field,
- NULL_TREE);
- TREE_THIS_VOLATILE (field) = volatil;
- return field;
-}
-
-/* Returns the address of a field in FRAME_PTR, pointed by FIELD_NUMBER.
- (e.g. (&X)->y). Please see cilk_dot function for explanation of the
- FIELD_NUMBER. Returns a tree that is the type of the field represented
- by FIELD_NUMBER. If VOLATIL parameter is set to true then the returning
- field is set as volatile. */
-
-tree
-cilk_arrow (tree frame_ptr, int field_number, bool volatil)
-{
- return cilk_dot (build_simple_mem_ref (frame_ptr),
- field_number, volatil);
-}
-
-
-/* This function will add FIELD of type TYPE to a defined built-in
- structure. *NAME is the name of the field to be added. */
-
-static tree
-add_field (const char *name, tree type, tree fields)
-{
- tree t = get_identifier (name);
- tree field = build_decl (BUILTINS_LOCATION, FIELD_DECL, t, type);
- TREE_CHAIN (field) = fields;
- return field;
-}
-
-/* This function will define a built-in function of NAME, of type FNTYPE and
- register it under the built-in function code CODE. If PUBLISH is set then
- the declaration is pushed into the declaration list. CODE is the index
- to the cilk_trees array. *NAME is the name of the function to be added. */
-
-static tree
-install_builtin (const char *name, tree fntype, enum built_in_function code,
- bool publish)
-{
- tree fndecl = build_fn_decl (name, fntype);
- DECL_BUILT_IN_CLASS (fndecl) = BUILT_IN_NORMAL;
- DECL_FUNCTION_CODE (fndecl) = code;
- if (publish)
- {
- tree t = lang_hooks.decls.pushdecl (fndecl);
- if (t)
- fndecl = t;
- }
- set_builtin_decl (code, fndecl, true);
- return fndecl;
-}
-
-/* Returns a FUNCTION_DECL of type TYPE whose name is *NAME. */
-
-static tree
-declare_cilk_for_builtin (const char *name, tree type,
- enum built_in_function code)
-{
- tree cb, ft, fn;
-
- cb = build_function_type_list (void_type_node,
- ptr_type_node, type, type,
- NULL_TREE);
- cb = build_pointer_type (cb);
- ft = build_function_type_list (void_type_node,
- cb, ptr_type_node, type,
- integer_type_node, NULL_TREE);
- fn = install_builtin (name, ft, code, false);
- TREE_NOTHROW (fn) = 0;
-
- return fn;
-}
-
-/* Creates and initializes all the built-in Cilk keywords functions and three
- structures: __cilkrts_stack_frame, __cilkrts_pedigree and __cilkrts_worker.
- Detailed information about __cilkrts_stack_frame and
- __cilkrts_worker structures are given in libcilkrts/include/internal/abi.h.
- __cilkrts_pedigree is described in libcilkrts/include/cilk/common.h. */
-
-void
-cilk_init_builtins (void)
-{
- /* Now build the following __cilkrts_pedigree struct:
- struct __cilkrts_pedigree {
- uint64_t rank;
- struct __cilkrts_pedigree *parent;
- } */
-
- tree pedigree_type = lang_hooks.types.make_type (RECORD_TYPE);
- tree pedigree_ptr = build_pointer_type (pedigree_type);
- tree field = add_field ("rank", uint64_type_node, NULL_TREE);
- cilk_trees[CILK_TI_PEDIGREE_RANK] = field;
- field = add_field ("parent", pedigree_ptr, field);
- cilk_trees[CILK_TI_PEDIGREE_PARENT] = field;
- finish_builtin_struct (pedigree_type, "__cilkrts_pedigree_GCC", field,
- NULL_TREE);
- lang_hooks.types.register_builtin_type (pedigree_type,
- "__cilkrts_pedigree_t");
- cilk_pedigree_type_decl = pedigree_type;
-
- /* Build the Cilk Stack Frame:
- struct __cilkrts_stack_frame {
- uint32_t flags;
- uint32_t size;
- struct __cilkrts_stack_frame *call_parent;
- __cilkrts_worker *worker;
- void *except_data;
- void *ctx[4];
- uint32_t mxcsr;
- uint16_t fpcsr;
- uint16_t reserved;
- __cilkrts_pedigree pedigree;
- }; */
-
- tree frame = lang_hooks.types.make_type (RECORD_TYPE);
- tree frame_ptr = build_pointer_type (frame);
- tree worker_type = lang_hooks.types.make_type (RECORD_TYPE);
- tree worker_ptr = build_pointer_type (worker_type);
- tree s_type_node = build_int_cst (size_type_node, 4);
-
- tree flags = add_field ("flags", uint32_type_node, NULL_TREE);
- tree size = add_field ("size", uint32_type_node, flags);
- tree parent = add_field ("call_parent", frame_ptr, size);
- tree worker = add_field ("worker", worker_ptr, parent);
- tree except = add_field ("except_data", frame_ptr, worker);
- tree context = add_field ("ctx",
- build_array_type (ptr_type_node,
- build_index_type (s_type_node)),
- except);
- tree mxcsr = add_field ("mxcsr", uint32_type_node, context);
- tree fpcsr = add_field ("fpcsr", uint16_type_node, mxcsr);
- tree reserved = add_field ("reserved", uint16_type_node, fpcsr);
- tree pedigree = add_field ("pedigree", pedigree_type, reserved);
-
- /* Now add them to a common structure whose fields are #defined to something
- that is used at a later stage. */
- cilk_trees[CILK_TI_FRAME_FLAGS] = flags;
- cilk_trees[CILK_TI_FRAME_PARENT] = parent;
- cilk_trees[CILK_TI_FRAME_WORKER] = worker;
- cilk_trees[CILK_TI_FRAME_EXCEPTION] = except;
- cilk_trees[CILK_TI_FRAME_CONTEXT] = context;
- /* We don't care about reserved, so no need to store it in cilk_trees. */
- cilk_trees[CILK_TI_FRAME_PEDIGREE] = pedigree;
- TREE_ADDRESSABLE (frame) = 1;
-
- finish_builtin_struct (frame, "__cilkrts_st_frame_GCC", pedigree, NULL_TREE);
- cilk_frame_type_decl = frame;
- lang_hooks.types.register_builtin_type (frame, "__cilkrts_frame_t");
-
- cilk_frame_ptr_type_decl = build_qualified_type (frame_ptr,
- TYPE_QUAL_VOLATILE);
- /* Now let's do the following worker struct:
-
- struct __cilkrts_worker {
- __cilkrts_stack_frame *volatile *volatile tail;
- __cilkrts_stack_frame *volatile *volatile head;
- __cilkrts_stack_frame *volatile *volatile exc;
- __cilkrts_stack_frame *volatile *volatile protected_tail;
- __cilkrts_stack_frame *volatile *ltq_limit;
- int32_t self;
- global_state_t *g;
- local_state *l;
- cilkred_map *reducer_map;
- __cilkrts_stack_frame *current_stack_frame;
- void *reserved;
- __cilkrts_worker_sysdep_state *sysdep;
- __cilkrts_pedigree pedigree;
- } */
-
- tree fptr_volatil_type = build_qualified_type (frame_ptr, TYPE_QUAL_VOLATILE);
- tree fptr_volatile_ptr = build_pointer_type (fptr_volatil_type);
- tree fptr_vol_ptr_vol = build_qualified_type (fptr_volatile_ptr,
- TYPE_QUAL_VOLATILE);
- tree g = lang_hooks.types.make_type (RECORD_TYPE);
- finish_builtin_struct (g, "__cilkrts_global_state", NULL_TREE, NULL_TREE);
- tree l = lang_hooks.types.make_type (RECORD_TYPE);
- finish_builtin_struct (l, "__cilkrts_local_state", NULL_TREE, NULL_TREE);
- tree sysdep_t = lang_hooks.types.make_type (RECORD_TYPE);
- finish_builtin_struct (sysdep_t, "__cilkrts_worker_sysdep_state", NULL_TREE,
- NULL_TREE);
-
- field = add_field ("tail", fptr_vol_ptr_vol, NULL_TREE);
- cilk_trees[CILK_TI_WORKER_TAIL] = field;
- field = add_field ("head", fptr_vol_ptr_vol, field);
- field = add_field ("exc", fptr_vol_ptr_vol, field);
- field = add_field ("protected_tail", fptr_vol_ptr_vol, field);
- field = add_field ("ltq_limit", fptr_volatile_ptr, field);
- field = add_field ("self", integer_type_node, field);
- field = add_field ("g", build_pointer_type (g), field);
- field = add_field ("l", build_pointer_type (g), field);
- field = add_field ("reducer_map", ptr_type_node, field);
- field = add_field ("current_stack_frame", frame_ptr, field);
- cilk_trees[CILK_TI_WORKER_CUR] = field;
- field = add_field ("saved_protected_tail", fptr_volatile_ptr, field);
- field = add_field ("sysdep", build_pointer_type (sysdep_t), field);
- field = add_field ("pedigree", pedigree_type, field);
- cilk_trees[CILK_TI_WORKER_PEDIGREE] = field;
- finish_builtin_struct (worker_type, "__cilkrts_worker_GCC", field,
- NULL_TREE);
-
- tree fptr_arglist = tree_cons (NULL_TREE, frame_ptr, void_list_node);
- tree fptr_fun = build_function_type (void_type_node, fptr_arglist);
-
- /* void __cilkrts_enter_frame_1 (__cilkrts_stack_frame *); */
- cilk_enter_fndecl = install_builtin ("__cilkrts_enter_frame_1", fptr_fun,
- BUILT_IN_CILK_ENTER_FRAME, false);
-
- /* void __cilkrts_enter_frame_fast_1 (__cilkrts_stack_frame *); */
- cilk_enter_fast_fndecl =
- install_builtin ("__cilkrts_enter_frame_fast_1", fptr_fun,
- BUILT_IN_CILK_ENTER_FRAME_FAST, false);
-
- /* void __cilkrts_pop_frame (__cilkrts_stack_frame *); */
- cilk_pop_fndecl = install_builtin ("__cilkrts_pop_frame", fptr_fun,
- BUILT_IN_CILK_POP_FRAME, false);
-
- /* void __cilkrts_leave_frame (__cilkrts_stack_frame *); */
- cilk_leave_fndecl = install_builtin ("__cilkrts_leave_frame", fptr_fun,
- BUILT_IN_CILK_LEAVE_FRAME, false);
-
- /* void __cilkrts_sync (__cilkrts_stack_frame *); */
- cilk_sync_fndecl = install_builtin ("__cilkrts_sync", fptr_fun,
- BUILT_IN_CILK_SYNC, false);
-
- /* void __cilkrts_detach (__cilkrts_stack_frame *); */
- cilk_detach_fndecl = install_builtin ("__cilkrts_detach", fptr_fun,
- BUILT_IN_CILK_DETACH, false);
-
- /* __cilkrts_rethrow (struct stack_frame *); */
- cilk_rethrow_fndecl = install_builtin ("__cilkrts_rethrow", fptr_fun,
- BUILT_IN_CILK_RETHROW, false);
- TREE_NOTHROW (cilk_rethrow_fndecl) = 0;
-
- /* __cilkrts_save_fp_ctrl_state (__cilkrts_stack_frame *); */
- cilk_save_fp_fndecl = install_builtin ("__cilkrts_save_fp_ctrl_state",
- fptr_fun, BUILT_IN_CILK_SAVE_FP,
- false);
- /* __cilkrts_cilk_for_32 (...); */
- cilk_for_32_fndecl = declare_cilk_for_builtin ("__cilkrts_cilk_for_32",
- unsigned_intSI_type_node,
- BUILT_IN_CILK_FOR_32);
- /* __cilkrts_cilk_for_64 (...); */
- cilk_for_64_fndecl = declare_cilk_for_builtin ("__cilkrts_cilk_for_64",
- unsigned_intDI_type_node,
- BUILT_IN_CILK_FOR_64);
-}
-
-/* Get the appropriate frame arguments for CALL that is of type CALL_EXPR. */
-
-static tree
-get_frame_arg (tree call)
-{
- tree arg, argtype;
-
- gcc_assert (call_expr_nargs (call) >= 1);
-
- arg = CALL_EXPR_ARG (call, 0);
- argtype = TREE_TYPE (arg);
- gcc_assert (TREE_CODE (argtype) == POINTER_TYPE);
-
- argtype = TREE_TYPE (argtype);
-
- /* If it is passed in as an address, then just use the value directly
- since the function is inlined. */
- if (TREE_CODE (arg) == ADDR_EXPR)
- return TREE_OPERAND (arg, 0);
- return arg;
-}
-
-/* Expands the __cilkrts_pop_frame function call stored in EXP. */
-
-void
-expand_builtin_cilk_pop_frame (tree exp)
-{
- tree frame = get_frame_arg (exp);
- tree parent = cilk_dot (frame, CILK_TI_FRAME_PARENT, 0);
-
- tree clear_parent = build2 (MODIFY_EXPR, void_type_node, parent,
- build_int_cst (TREE_TYPE (parent), 0));
- expand_expr (clear_parent, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- /* During LTO, the is_cilk_function flag gets cleared.
- If __cilkrts_pop_frame is called, then this definitely must be a
- cilk function. */
- if (cfun)
- cfun->is_cilk_function = 1;
-}
-
-/* Expands the cilk_detach function call stored in EXP. */
-
-void
-expand_builtin_cilk_detach (tree exp)
-{
- rtx_insn *insn;
- tree fptr = get_frame_arg (exp);
-
- if (fptr == NULL_TREE)
- return;
-
- tree parent = cilk_dot (fptr, CILK_TI_FRAME_PARENT, 0);
- tree worker = cilk_dot (fptr, CILK_TI_FRAME_WORKER, 0);
- tree tail = cilk_arrow (worker, CILK_TI_WORKER_TAIL, 1);
-
- tree faddr = build1 (ADDR_EXPR, cilk_frame_ptr_type_decl, fptr);
- tree enter_frame = build_call_expr (cilk_enter_fast_fndecl, 1, faddr);
- expand_expr (enter_frame, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- tree pedigree = cilk_dot (fptr, CILK_TI_FRAME_PEDIGREE, 0);
- tree pedigree_rank = cilk_dot (pedigree, CILK_TI_PEDIGREE_RANK, 0);
- tree parent_pedigree = cilk_dot (pedigree, CILK_TI_PEDIGREE_PARENT, 0);
- tree pedigree_parent = cilk_arrow (parent, CILK_TI_FRAME_PEDIGREE, 0);
- tree pedigree_parent_rank = cilk_dot (pedigree_parent,
- CILK_TI_PEDIGREE_RANK, 0);
- tree pedigree_parent_parent = cilk_dot (pedigree_parent,
- CILK_TI_PEDIGREE_PARENT, 0);
- tree worker_pedigree = cilk_arrow (worker, CILK_TI_WORKER_PEDIGREE, 1);
- tree w_pedigree_rank = cilk_dot (worker_pedigree, CILK_TI_PEDIGREE_RANK, 0);
- tree w_pedigree_parent = cilk_dot (worker_pedigree,
- CILK_TI_PEDIGREE_PARENT, 0);
-
- rtx wreg = expand_expr (worker, NULL_RTX, Pmode, EXPAND_NORMAL);
- if (GET_CODE (wreg) != REG)
- wreg = copy_to_reg (wreg);
- rtx preg = expand_expr (parent, NULL_RTX, Pmode, EXPAND_NORMAL);
-
- /* sf.pedigree.rank = worker->pedigree.rank. */
- tree exp1 = build2 (MODIFY_EXPR, void_type_node, pedigree_rank,
- w_pedigree_rank);
- expand_expr (exp1, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- /* sf.pedigree.parent = worker->pedigree.parent. */
- exp1 = build2 (MODIFY_EXPR, void_type_node, parent_pedigree,
- w_pedigree_parent);
- expand_expr (exp1, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- /* sf.call_parent->pedigree.rank = worker->pedigree.rank. */
- exp1 = build2 (MODIFY_EXPR, void_type_node, pedigree_parent_rank,
- w_pedigree_rank);
- expand_expr (exp1, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- /* sf.call_parent->pedigree.parent = worker->pedigree.parent. */
- exp1 = build2 (MODIFY_EXPR, void_type_node, pedigree_parent_parent,
- w_pedigree_parent);
- expand_expr (exp1, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- /* sf->worker.pedigree.rank = 0. */
- exp1 = build2 (MODIFY_EXPR, void_type_node, w_pedigree_rank,
- build_zero_cst (uint64_type_node));
- expand_expr (exp1, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- /* sf->pedigree.parent = &sf->pedigree. */
- exp1 = build2 (MODIFY_EXPR, void_type_node, w_pedigree_parent,
- build1 (ADDR_EXPR,
- build_pointer_type (cilk_pedigree_type_decl),
- pedigree));
- expand_expr (exp1, const0_rtx, VOIDmode, EXPAND_NORMAL);
-
- /* TMP <- WORKER.TAIL
- *TMP <- PARENT
- TMP <- TMP + 1
- WORKER.TAIL <- TMP */
-
- HOST_WIDE_INT worker_tail_offset =
- tree_to_shwi (DECL_FIELD_OFFSET (cilk_trees[CILK_TI_WORKER_TAIL])) +
- tree_to_shwi (DECL_FIELD_BIT_OFFSET (cilk_trees[CILK_TI_WORKER_TAIL])) /
- BITS_PER_UNIT;
- rtx tmem0 = gen_rtx_MEM (Pmode,
- plus_constant (Pmode, wreg, worker_tail_offset));
- set_mem_attributes (tmem0, tail, 0);
- MEM_NOTRAP_P (tmem0) = 1;
- gcc_assert (MEM_VOLATILE_P (tmem0));
- rtx treg = copy_to_mode_reg (Pmode, tmem0);
- rtx tmem1 = gen_rtx_MEM (Pmode, treg);
- set_mem_attributes (tmem1, TREE_TYPE (TREE_TYPE (tail)), 0);
- MEM_NOTRAP_P (tmem1) = 1;
- emit_move_insn (tmem1, preg);
- emit_move_insn (treg, plus_constant (Pmode, treg, GET_MODE_SIZE (Pmode)));
-
- /* There is a release barrier (st8.rel, membar #StoreStore,
- sfence, lwsync, etc.) between the two stores. On x86
- normal volatile stores have proper semantics; the sfence
- would only be needed for nontemporal stores (which we
- could generate using the storent optab, for no benefit
- in this case).
-
- The predicate may return false even for a REG if this is
- the limited release operation that only stores 0. */
- enum insn_code icode = direct_optab_handler (sync_lock_release_optab, Pmode);
- if (icode != CODE_FOR_nothing
- && insn_data[icode].operand[1].predicate (treg, Pmode)
- && (insn = GEN_FCN (icode) (tmem0, treg)) != NULL_RTX)
- emit_insn (insn);
- else
- emit_move_insn (tmem0, treg);
-
- /* The memory barrier inserted above should not prevent
- the load of flags from being moved before the stores,
- but in practice it does because it is implemented with
- unspec_volatile. In-order RISC machines should
- explicitly load flags earlier. */
-
- tree flags = cilk_dot (fptr, CILK_TI_FRAME_FLAGS, 0);
- expand_expr (build2 (MODIFY_EXPR, void_type_node, flags,
- build2 (BIT_IOR_EXPR, TREE_TYPE (flags), flags,
- build_int_cst (TREE_TYPE (flags),
- CILK_FRAME_DETACHED))),
- const0_rtx, VOIDmode, EXPAND_NORMAL);
-}
-
-/* Returns a setjmp CALL_EXPR with FRAME->context as its parameter. */
-
-tree
-cilk_call_setjmp (tree frame)
-{
- tree c = cilk_dot (frame, CILK_TI_FRAME_CONTEXT, false);
- c = build1 (ADDR_EXPR, build_pointer_type (ptr_type_node), c);
- return build_call_expr (builtin_decl_implicit (BUILT_IN_SETJMP), 1, c);
-}
-
-/* This function will expand the _Cilk_sync keyword. */
-
-static tree
-expand_cilk_sync (void)
-{
- tree frame = cfun->cilk_frame_decl;
-
- /* Cilk_sync is converted to the following code:
-
- sf.pedigree = sf.worker->pedigree;
- if (frame.flags & CILK_FRAME_UNSYNCHED)
- {
- __cilkrts_save_fp_state (&sf);
- if (!builtin_setjmp (sf.ctx)
- __cilkrts_sync (&sf);
- else
- if (sf.flags & CILK_FRAME_EXCEPTING)
- __cilkrts_rethrow (&sf);
- }
- sf.worker->pedigree.rank = sf.worker->pedigree.rank + 1; */
-
- tree flags = cilk_dot (frame, CILK_TI_FRAME_FLAGS, false);
-
- tree unsynched = fold_build2 (BIT_AND_EXPR, TREE_TYPE (flags), flags,
- build_int_cst (TREE_TYPE (flags),
- CILK_FRAME_UNSYNCHED));
-
- unsynched = fold_build2 (NE_EXPR, TREE_TYPE (unsynched), unsynched,
- build_int_cst (TREE_TYPE (unsynched), 0));
-
- tree frame_addr = build1 (ADDR_EXPR, cilk_frame_ptr_type_decl, frame);
-
- /* Check if exception (0x10) bit is set in the sf->flags. */
- tree except_flag = fold_build2 (BIT_AND_EXPR, TREE_TYPE (flags), flags,
- build_int_cst (TREE_TYPE (flags),
- CILK_FRAME_EXCEPTING));
- except_flag = fold_build2 (NE_EXPR, TREE_TYPE (except_flag), except_flag,
- build_int_cst (TREE_TYPE (except_flag), 0));
-
- /* If the exception flag is set then call the __cilkrts_rethrow (&sf). */
- tree except_cond = fold_build3 (COND_EXPR, void_type_node, except_flag,
- build_call_expr (cilk_rethrow_fndecl, 1,
- frame_addr),
- build_empty_stmt (EXPR_LOCATION (unsynched)));
-
- tree sync_expr = build_call_expr (cilk_sync_fndecl, 1, frame_addr);
- tree setjmp_expr = cilk_call_setjmp (frame);
- setjmp_expr = fold_build2 (EQ_EXPR, TREE_TYPE (setjmp_expr), setjmp_expr,
- build_int_cst (TREE_TYPE (setjmp_expr), 0));
-
- setjmp_expr = fold_build3 (COND_EXPR, void_type_node, setjmp_expr,
- sync_expr, except_cond);
- tree sync_list = alloc_stmt_list ();
- append_to_statement_list (build_call_expr (cilk_save_fp_fndecl, 1,
- frame_addr), &sync_list);
- append_to_statement_list (setjmp_expr, &sync_list);
- tree sync = fold_build3 (COND_EXPR, void_type_node, unsynched, sync_list,
- build_empty_stmt (EXPR_LOCATION (unsynched)));
- tree parent_pedigree = cilk_dot (frame, CILK_TI_FRAME_PEDIGREE, false);
- tree worker = cilk_dot (frame, CILK_TI_FRAME_WORKER, false);
- tree worker_pedigree = cilk_arrow (worker, CILK_TI_WORKER_PEDIGREE, false);
- tree assign_pedigree = fold_build2 (MODIFY_EXPR, void_type_node,
- parent_pedigree, worker_pedigree);
- tree w_ped_rank = cilk_dot (unshare_expr (worker_pedigree),
- CILK_TI_PEDIGREE_RANK, false);
- tree incr_ped_rank = fold_build2 (PLUS_EXPR, TREE_TYPE (w_ped_rank),
- w_ped_rank,
- build_one_cst (TREE_TYPE (w_ped_rank)));
- incr_ped_rank = fold_build2 (MODIFY_EXPR, void_type_node, w_ped_rank,
- incr_ped_rank);
- tree ret_sync_exp = alloc_stmt_list ();
- append_to_statement_list (assign_pedigree, &ret_sync_exp);
- append_to_statement_list (sync, &ret_sync_exp);
- append_to_statement_list (incr_ped_rank, &ret_sync_exp);
- return ret_sync_exp;
-}
-
-/* Gimplifies the cilk_sync expression passed in *EXPR_P. Returns GS_ALL_DONE
- when finished. */
-
-void
-gimplify_cilk_sync (tree *expr_p, gimple_seq *pre_p)
-{
- tree sync_expr = expand_cilk_sync ();
- *expr_p = NULL_TREE;
- gimplify_and_add (sync_expr, pre_p);
-}
diff --git a/gcc/cilk.h b/gcc/cilk.h
deleted file mode 100644
index 27c2e0a63e9..00000000000
--- a/gcc/cilk.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* This file is part of the Intel(R) Cilk(TM) Plus support
- This file contains Cilk Support files.
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
- Contributed by Balaji V. Iyer <balaji.v.iyer@intel.com>,
- Intel Corporation
-
- This file is part of GCC.
-
- GCC is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GCC is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3. If not see
- <http://www.gnu.org/licenses/>. */
-
-#ifndef GCC_CILK_H
-#define GCC_CILK_H
-
-/* Frame status bits known to compiler. */
-#define CILK_FRAME_UNSYNCHED 0x02
-#define CILK_FRAME_DETACHED 0x04
-#define CILK_FRAME_EXCEPTING 0x10
-#define CILK_FRAME_VERSION (1 << 24)
-
-enum cilk_tree_index {
-/* All the built-in functions for Cilk keywords. */
- CILK_TI_F_WORKER = 0, /* __cilkrts_get_worker (). */
- CILK_TI_F_SYNC, /* __cilkrts_sync (). */
- CILK_TI_F_DETACH, /* __cilkrts_detach (...). */
- CILK_TI_F_ENTER, /* __cilkrts_enter_frame (...). */
- CILK_TI_F_ENTER_FAST, /* __cilkrts_enter_frame_fast (.). */
- CILK_TI_F_LEAVE, /* __cilkrts_leave_frame (...). */
- CILK_TI_F_POP, /* __cilkrts_pop_frame (...). */
- CILK_TI_F_RETHROW, /* __cilkrts_rethrow (...). */
- CILK_TI_F_SAVE_FP, /* __cilkrts_save_fp_ctrl_state (...). */
- CILK_TI_F_LOOP_32, /* __cilkrts_cilk_for_32 (...). */
- CILK_TI_F_LOOP_64, /* __cilkrts_cilk_for_64 (...). */
-
- /* __cilkrts_stack_frame struct fields. */
- CILK_TI_FRAME_FLAGS, /* stack_frame->flags. */
- CILK_TI_FRAME_PARENT, /* stack_frame->parent. */
- CILK_TI_FRAME_WORKER, /* stack_frame->worker. */
- CILK_TI_FRAME_EXCEPTION, /* stack_frame->except_data. */
- CILK_TI_FRAME_CONTEXT, /* stack_frame->context[4]. */
- CILK_TI_FRAME_PEDIGREE, /* stack_frame->pedigree. */
-
- /* __cilkrts_worker struct fields. */
- CILK_TI_WORKER_CUR, /* worker->current_stack_frame. */
- CILK_TI_WORKER_TAIL, /* worker->tail. */
- CILK_TI_WORKER_PEDIGREE, /* worker->pedigree. */
-
- /* __cilkrts_pedigree struct fields. */
- CILK_TI_PEDIGREE_RANK, /* pedigree->rank. */
- CILK_TI_PEDIGREE_PARENT, /* pedigree->parent. */
-
- /* Types. */
- CILK_TI_FRAME_TYPE, /* struct __cilkrts_stack_frame. */
- CILK_TI_FRAME_PTR, /* __cilkrts_stack_frame *. */
- CILK_TI_WORKER_TYPE, /* struct __cilkrts_worker. */
- CILK_TI_PEDIGREE_TYPE, /* struct __cilkrts_pedigree. */
- CILK_TI_MAX
-};
-
-extern GTY (()) tree cilk_trees[CILK_TI_MAX];
-
-#define cilk_worker_fndecl cilk_trees[CILK_TI_F_WORKER]
-#define cilk_sync_fndecl cilk_trees[CILK_TI_F_SYNC]
-#define cilk_synched_fndecl cilk_trees[CILK_TI_F_SYNCED]
-#define cilk_detach_fndecl cilk_trees[CILK_TI_F_DETACH]
-#define cilk_enter_fndecl cilk_trees[CILK_TI_F_ENTER]
-#define cilk_enter_fast_fndecl cilk_trees[CILK_TI_F_ENTER_FAST]
-#define cilk_leave_fndecl cilk_trees[CILK_TI_F_LEAVE]
-#define cilk_rethrow_fndecl cilk_trees[CILK_TI_F_RETHROW]
-#define cilk_pop_fndecl cilk_trees[CILK_TI_F_POP]
-#define cilk_save_fp_fndecl cilk_trees[CILK_TI_F_SAVE_FP]
-#define cilk_for_32_fndecl cilk_trees[CILK_TI_F_LOOP_32]
-#define cilk_for_64_fndecl cilk_trees[CILK_TI_F_LOOP_64]
-
-#define cilk_worker_type_fndecl cilk_trees[CILK_TI_WORKER_TYPE]
-#define cilk_frame_type_decl cilk_trees[CILK_TI_FRAME_TYPE]
-#define cilk_frame_ptr_type_decl cilk_trees[CILK_TI_FRAME_PTR]
-#define cilk_pedigree_type_decl cilk_trees[CILK_TI_PEDIGREE_TYPE]
-
-extern void expand_builtin_cilk_detach (tree);
-extern void expand_builtin_cilk_pop_frame (tree);
-extern tree cilk_arrow (tree, int, bool);
-extern tree cilk_dot (tree, int, bool);
-extern void cilk_init_builtins (void);
-extern void gimplify_cilk_sync (tree *, gimple_seq *);
-extern tree cilk_call_setjmp (tree);
-
-/* Returns true if Cilk Plus is enabled and if F->cilk_frame_decl is not
- NULL_TREE. */
-
-inline bool
-fn_contains_cilk_spawn_p (function *f)
-{
- return (flag_cilkplus
- && (f->calls_cilk_spawn || f->cilk_frame_decl != NULL_TREE));
-}
-
-#endif
diff --git a/gcc/cilkplus.def b/gcc/cilkplus.def
deleted file mode 100644
index 450ed173092..00000000000
--- a/gcc/cilkplus.def
+++ /dev/null
@@ -1,59 +0,0 @@
-/* This file contains the definitions and documentation for the
- CilkPlus builtins used in the GNU compiler.
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-/* Before including this file, you should define a macro:
-
- DEF_CILKPLUS_BUILTIN (ENUM, NAME, TYPE, ATTRS)
-
- See builtins.def for details. */
-
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE_ADD,
- "__sec_reduce_add", BT_FN_INT_PTR, ATTR_NULL)
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE_MUL,
- "__sec_reduce_mul", BT_FN_INT_PTR, ATTR_NULL)
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO,
- "__sec_reduce_all_zero", BT_FN_INT_PTR, ATTR_NULL)
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO,
- "__sec_reduce_any_zero", BT_FN_INT_PTR, ATTR_NULL)
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE_MAX,
- "__sec_reduce_max", BT_FN_INT_PTR, ATTR_NULL)
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE_MIN,
- "__sec_reduce_min", BT_FN_INT_PTR, ATTR_NULL)
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND,
- "__sec_reduce_min_ind", BT_FN_INT_PTR, ATTR_NULL)
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND,
- "__sec_reduce_max_ind", BT_FN_INT_PTR, ATTR_NULL)
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO,
- "__sec_reduce_any_nonzero", BT_FN_INT_PTR, ATTR_NULL)
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO,
- "__sec_reduce_all_nonzero", BT_FN_INT_PTR, ATTR_NULL)
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE,
- "__sec_reduce", BT_FN_INT_PTR_PTR_PTR, ATTR_NULL)
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING,
- "__sec_reduce_mutating", BT_FN_INT_PTR_PTR_PTR, ATTR_NULL)
-// FIXME: This probably needs to be rewritten as a keyword.
-DEF_CILKPLUS_BUILTIN (BUILT_IN_CILKPLUS_SEC_IMPLICIT_INDEX,
- "__sec_implicit_index", BT_FN_INT_INT, ATTR_NULL)
-
-/*
-Local variables:
-mode:c
-End:
-*/
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 6cec8deb8cd..d7dc2cded57 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -185,7 +185,6 @@ extern GTY(()) int darwin_ms_struct;
%{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): \
%{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
- %{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\
%{fgnu-tm: \
%{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \
%{!nostdlib:%{!nodefaultlibs:\
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 13fe545cd1c..a93a9012958 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,52 @@
+2017-11-28 Julia Koval <julia.koval@intel.com>
+ Sebastian Peryt <sebastian.peryt@intel.com>
+
+ * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete.
+ * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus.
+ * constexpr.c (potential_constant_expression_1): Ditto.
+ * cp-array-notation.c: Delete.
+ * cp-cilkplus.c: Ditto.
+ * cp-cilkplus.h: Ditto.
+ * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove
+ cilkplus condition.
+ * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete.
+ * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete.
+ * decl.c (grokfndecl, finish_function): Remove cilkplus condition.
+ * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition.
+ * lambda.c (cp-cilkplus.h): Remove.
+ * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for,
+ cp_parser_cilk_simd_vectorlength): Delete.
+ (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body,
+ cp_parser_postfix_expression,
+ cp_parser_postfix_open_square_expression,
+ cp_parser_statement, cp_parser_jump_statement,
+ cp_parser_direct_declarator,
+ cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list,
+ cp_parser_omp_clause_name, cp_parser_omp_clause_aligned,
+ cp_parser_omp_clause_linear, cp_parser_omp_all_clauses,
+ cp_parser_omp_flush,
+ cp_parser_omp_for_cond, cp_parser_omp_for_incr,
+ cp_parser_omp_for_loop_init,
+ cp_parser_omp_for_loop,
+ cp_parser_omp_declare_simd): Remove cilkplus support.
+ (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info,
+ cp_parser_cilk_grainsize): Remove.
+ (cp_parser_pragma, c_parse_file): Remove cilkplus support.
+ (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear,
+ cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses,
+ cp_parser_cilk_simd, cp_parser_cilk_for): Remove.
+ * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove.
+ * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove
+ cilkplus support.
+ * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body,
+ finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr,
+ finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove
+ cilkplus
+ support.
+ * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon.
+ * typeck.c (cp_build_array_ref, cp_build_compound_expr,
+ check_return_expr): Remove cilkplus support.
+
2017-11-28 Jakub Jelinek <jakub@redhat.com>
* cp-gimplify.c (genericize_switch_stmt): Build SWITCH_EXPR using
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 7af4a4cb0b8..7871755b06d 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -73,7 +73,7 @@ CXX_C_OBJS = attribs.o incpath.o \
# Language-specific object files for C++ and Objective C++.
CXX_AND_OBJCXX_OBJS = \
cp/call.o cp/class.o cp/constexpr.o cp/constraint.o \
- cp/cp-array-notation.o cp/cp-cilkplus.o cp/cp-gimplify.o \
+ cp/cp-gimplify.o \
cp/cp-objcp-common.o cp/cp-ubsan.o \
cp/cvt.o cp/cxx-pretty-print.o \
cp/decl.o cp/decl2.o cp/dump.o \
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 177c3cc13e3..45c811e828e 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7422,9 +7422,6 @@ convert_for_arg_passing (tree type, tree val, tsubst_flags_t complain)
int
magic_varargs_p (tree fn)
{
- if (flag_cilkplus && is_cilkplus_reduce_builtin (fn) != BUILT_IN_NONE)
- return 2;
-
if (DECL_BUILT_IN_CLASS (fn) == BUILT_IN_NORMAL)
switch (DECL_FUNCTION_CODE (fn))
{
@@ -8650,38 +8647,6 @@ build_cxx_call (tree fn, int nargs, tree *argarray,
maybe_warn_class_memaccess (loc, fndecl, argarray);
}
- /* If it is a built-in array notation function, then the return type of
- the function is the element type of the array passed in as array
- notation (i.e. the first parameter of the function). */
- if (flag_cilkplus && TREE_CODE (fn) == CALL_EXPR)
- {
- enum built_in_function bif =
- is_cilkplus_reduce_builtin (CALL_EXPR_FN (fn));
- if (bif == BUILT_IN_CILKPLUS_SEC_REDUCE_ADD
- || bif == BUILT_IN_CILKPLUS_SEC_REDUCE_MUL
- || bif == BUILT_IN_CILKPLUS_SEC_REDUCE_MAX
- || bif == BUILT_IN_CILKPLUS_SEC_REDUCE_MIN
- || bif == BUILT_IN_CILKPLUS_SEC_REDUCE
- || bif == BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING)
- {
- if (call_expr_nargs (fn) == 0)
- {
- error_at (EXPR_LOCATION (fn), "Invalid builtin arguments");
- return error_mark_node;
- }
- /* for bif == BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO or
- BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO or
- BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO or
- BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO or
- BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND or
- BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND
- The pre-defined return-type is the correct one. */
- tree array_ntn = CALL_EXPR_ARG (fn, 0);
- TREE_TYPE (fn) = TREE_TYPE (array_ntn);
- return fn;
- }
- }
-
if (VOID_TYPE_P (TREE_TYPE (fn)))
return fn;
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 92f51910cb5..f0370cc2aff 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -5563,8 +5563,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
case OACC_ENTER_DATA:
case OACC_EXIT_DATA:
case OACC_UPDATE:
- case CILK_SIMD:
- case CILK_FOR:
/* GCC internal stuff. */
case VA_ARG_EXPR:
case OBJ_TYPE_REF:
@@ -5849,11 +5847,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
return false;
return true;
- case CILK_SYNC_STMT:
- case CILK_SPAWN_STMT:
- case ARRAY_NOTATION_REF:
- return false;
-
case FMA_EXPR:
case VEC_PERM_EXPR:
for (i = 0; i < 3; ++i)
diff --git a/gcc/cp/cp-array-notation.c b/gcc/cp/cp-array-notation.c
deleted file mode 100644
index 31be7d685ba..00000000000
--- a/gcc/cp/cp-array-notation.c
+++ /dev/null
@@ -1,1470 +0,0 @@
-/* This file is part of the Intel(R) Cilk(TM) Plus support
- It contains routines to handle Array Notation expression
- handling routines in the C++ Compiler.
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
- Contributed by Balaji V. Iyer <balaji.v.iyer@intel.com>,
- Intel Corporation
-
- This file is part of GCC.
-
- GCC is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GCC is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3. If not see
- <http://www.gnu.org/licenses/>. */
-
-/* The Array Notation Transformation Technique:
-
- An array notation expression has 4 major components:
- 1. The array name
- 2. Start Index
- 3. Number of elements we need to access (we call it length)
- 4. Stride
-
- So, if we have something like A[0:5:2], we are accessing A[0], A[2], A[4],
- A[6] and A[8]. The user is responsible to make sure the access length does
- not step outside the array's size.
-
- In this section, I highlight the overall method on how array notations are
- broken up into C/C++ code. Almost all the functions follows this step:
-
- Let's say the user has used the array notation in a statement like this:
-
- A[St1:Ln:Str1] = B[St2:Ln:Str2] + <NON ARRAY_NOT STMT>
-
- where St{1,2} = Starting index, Ln = Number of elements we need to access,
- and Str{1,2} = the stride.
- Note: The length of both the array notation expressions must be the same.
-
- The above expression is broken into the following:
-
- for (Tmp_Var = 0; Tmp_Var < Ln; Tmp_Var++)
- A[St1 + Tmp_Var * Str1] = B[St1 + Tmp_Var * Str2] + <NON_ARRAY_NOT_STMT>;
-*/
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "cp-tree.h"
-#include "tree-iterator.h"
-
-/* Creates a FOR_STMT with INIT, COND, INCR and BODY as the initializer,
- condition, increment expression and the loop-body, respectively. */
-
-static void
-create_an_loop (tree init, tree cond, tree incr, tree body)
-{
- tree for_stmt;
-
- finish_expr_stmt (init);
- for_stmt = begin_for_stmt (NULL_TREE, NULL_TREE);
- finish_init_stmt (for_stmt);
- finish_for_cond (cond, for_stmt, false);
- finish_for_expr (incr, for_stmt);
- finish_expr_stmt (body);
- finish_for_stmt (for_stmt);
-}
-
-/* If *VALUE is not a constant integer, then this function replaces it with
- a variable to make it loop invariant for array notations. */
-
-static inline void
-make_triplet_val_inv (tree *value)
-{
- if (TREE_CODE (*value) != INTEGER_CST
- && TREE_CODE (*value) != PARM_DECL
- && !VAR_P (*value))
- *value = get_temp_regvar (ptrdiff_type_node, *value);
-}
-
-/* Returns a vector of size RANK that contains an ARRAY_REF. This vector is
- created using array notation-triplet information stored in AN_INFO. The
- induction var is taken from AN_LOOP_INFO.
-
- For example: For an array notation A[5:10:2], the vector start will be
- of size 1 holding '5', stride of same size as start but holding the value of
- as 2, and is_vector as true. Let's assume VAR is 'x'
- This function returns a vector of size 1 with the following data:
- A[5 + (x * 2)] .
-*/
-
-static vec<tree, va_gc> *
-create_array_refs (location_t loc, vec<vec<an_parts> > an_info,
- vec<an_loop_parts> an_loop_info, size_t size, size_t rank)
-{
- tree ind_mult, ind_incr;
- vec<tree, va_gc> *array_operand = NULL;
-
- for (size_t ii = 0; ii < size; ii++)
- if (an_info[ii][0].is_vector)
- {
- tree array_opr = an_info[ii][rank - 1].value;
- for (int s_jj = rank -1; s_jj >= 0; s_jj--)
- {
- tree start = cp_fold_convert (ptrdiff_type_node,
- an_info[ii][s_jj].start);
- tree stride = cp_fold_convert (ptrdiff_type_node,
- an_info[ii][s_jj].stride);
- tree var = cp_fold_convert (ptrdiff_type_node,
- an_loop_info[s_jj].var);
-
- ind_mult = build2 (MULT_EXPR, TREE_TYPE (var), var, stride);
- ind_incr = build2 (PLUS_EXPR, TREE_TYPE (var), start, ind_mult);
- /* Array [ start_index + (induction_var * stride)] */
- array_opr = grok_array_decl (loc, array_opr, ind_incr, false);
- }
- vec_safe_push (array_operand, array_opr);
- }
- else
- vec_safe_push (array_operand, integer_one_node);
- return array_operand;
-}
-
-/* Populates the INCR and CMP fields in *NODE with the increment
- (of type POSTINCREMENT) and comparison (of TYPE LT_EXPR) expressions, using
- data from AN_INFO. */
-
-void
-create_cmp_incr (location_t loc, vec <an_loop_parts> *node, size_t rank,
- vec<vec<an_parts> > an_info, tsubst_flags_t complain)
-{
- for (size_t ii = 0; ii < rank; ii++)
- {
- (*node)[ii].incr = build_x_unary_op (loc, POSTINCREMENT_EXPR,
- (*node)[ii].var, complain);
- (*node)[ii].cmp = build_x_binary_op (loc, LT_EXPR, (*node)[ii].var,
- TREE_CODE ((*node)[ii].var),
- an_info[0][ii].length,
- TREE_CODE (an_info[0][ii].length),
- NULL, complain);
- }
-}
-
-/* Replaces all the scalar expressions in *NODE. Returns a STATEMENT LIST that
- holds the NODE along with the variables that hold the results of the
- invariant expressions. */
-
-static tree
-replace_invariant_exprs (tree *node)
-{
- size_t ix = 0;
- tree node_list = NULL_TREE;
- tree t = NULL_TREE, new_var = NULL_TREE;
- struct inv_list data;
-
- data.list_values = NULL;
- data.replacement = NULL;
- data.additional_tcodes = NULL;
- cp_walk_tree (node, find_inv_trees, (void *) &data, NULL);
-
- if (vec_safe_length (data.list_values))
- {
- node_list = push_stmt_list ();
- for (ix = 0; vec_safe_iterate (data.list_values, ix, &t); ix++)
- {
- /* Sometimes, when comma_expr has a function call in it, it will
- typecast it to void. Find_inv_trees finds those nodes and so
- if it void type, then don't bother creating a new var to hold
- the return value. */
- if (VOID_TYPE_P (TREE_TYPE (t)))
- {
- finish_expr_stmt (t);
- new_var = void_node;
- }
- else
- new_var = get_temp_regvar (TREE_TYPE (t), t);
- vec_safe_push (data.replacement, new_var);
- }
- cp_walk_tree (node, replace_inv_trees, (void *) &data, NULL);
- node_list = pop_stmt_list (node_list);
- }
- return node_list;
-}
-
-/* Replace array notation's built-in function passed in AN_BUILTIN_FN with
- the appropriate loop and computation (all stored in variable LOOP of type
- tree node). The output of the function is always a scalar and that
- result is returned in *NEW_VAR. *NEW_VAR is NULL_TREE if the function is
- __sec_reduce_mutating. */
-
-static tree
-expand_sec_reduce_builtin (tree an_builtin_fn, tree *new_var)
-{
- tree new_var_type = NULL_TREE, func_parm, new_yes_expr, new_no_expr;
- tree array_ind_value = NULL_TREE, new_no_ind, new_yes_ind, new_no_list;
- tree new_yes_list, new_cond_expr, new_expr = NULL_TREE;
- vec<tree, va_gc> *array_list = NULL, *array_operand = NULL;
- size_t list_size = 0, rank = 0, ii = 0;
- tree body, an_init, loop_with_init = alloc_stmt_list ();
- tree array_op0, comp_node = NULL_TREE;
- tree call_fn = NULL_TREE, identity_value = NULL_TREE;
- tree init = NULL_TREE, cond_init = NULL_TREE;
- enum tree_code code = NOP_EXPR;
- location_t location = UNKNOWN_LOCATION;
- vec<vec<an_parts> > an_info = vNULL;
- auto_vec<an_loop_parts> an_loop_info;
- enum built_in_function an_type =
- is_cilkplus_reduce_builtin (CALL_EXPR_FN (an_builtin_fn));
- vec <tree, va_gc> *func_args;
-
- if (an_type == BUILT_IN_NONE)
- return NULL_TREE;
-
- if (an_type != BUILT_IN_CILKPLUS_SEC_REDUCE
- && an_type != BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING)
- func_parm = CALL_EXPR_ARG (an_builtin_fn, 0);
- else
- {
- call_fn = CALL_EXPR_ARG (an_builtin_fn, 2);
-
- /* We need to do this because we are "faking" the builtin function types,
- so the compiler does a bunch of typecasts and this will get rid of
- all that! */
- STRIP_NOPS (call_fn);
- if (TREE_CODE (call_fn) != OVERLOAD
- && TREE_CODE (call_fn) != FUNCTION_DECL)
- call_fn = TREE_OPERAND (call_fn, 0);
- identity_value = CALL_EXPR_ARG (an_builtin_fn, 0);
- func_parm = CALL_EXPR_ARG (an_builtin_fn, 1);
- STRIP_NOPS (identity_value);
- }
- STRIP_NOPS (func_parm);
-
- location = EXPR_LOCATION (an_builtin_fn);
-
- /* Note about using find_rank (): If find_rank returns false, then it must
- have already reported an error, thus we just return an error_mark_node
- without any doing any error emission. */
- if (!find_rank (location, an_builtin_fn, an_builtin_fn, true, &rank))
- return error_mark_node;
- if (rank == 0)
- {
- error_at (location, "Invalid builtin arguments");
- return error_mark_node;
- }
- else if (rank > 1
- && (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND
- || an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND))
- {
- error_at (location, "__sec_reduce_min_ind or __sec_reduce_max_ind cannot "
- "have arrays with dimension greater than 1");
- return error_mark_node;
- }
-
- extract_array_notation_exprs (func_parm, true, &array_list);
- list_size = vec_safe_length (array_list);
- switch (an_type)
- {
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUL:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN:
- new_var_type = TREE_TYPE ((*array_list)[0]);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO:
- new_var_type = boolean_type_node;
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND:
- new_var_type = size_type_node;
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE:
- if (call_fn && identity_value)
- new_var_type = TREE_TYPE ((*array_list)[0]);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING:
- new_var_type = NULL_TREE;
- break;
- default:
- gcc_unreachable ();
- }
-
- if (new_var_type && TREE_CODE (new_var_type) == ARRAY_TYPE)
- new_var_type = TREE_TYPE (new_var_type);
- an_loop_info.safe_grow_cleared (rank);
-
- an_init = push_stmt_list ();
-
- /* Assign the array notation components to variable so that they can satisfy
- the exec-once rule. */
- for (ii = 0; ii < list_size; ii++)
- if (TREE_CODE ((*array_list)[ii]) == ARRAY_NOTATION_REF)
- {
- tree anode = (*array_list)[ii];
- make_triplet_val_inv (&ARRAY_NOTATION_START (anode));
- make_triplet_val_inv (&ARRAY_NOTATION_LENGTH (anode));
- make_triplet_val_inv (&ARRAY_NOTATION_STRIDE (anode));
- }
- cilkplus_extract_an_triplets (array_list, list_size, rank, &an_info);
- for (ii = 0; ii < rank; ii++)
- {
- tree typ = ptrdiff_type_node;
-
- /* In this place, we are using get_temp_regvar instead of
- create_temporary_var if an_type is SEC_REDUCE_MAX/MIN_IND because
- the array_ind_value depends on this value being initalized to 0. */
- if (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND
- || an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND)
- an_loop_info[ii].var = get_temp_regvar (typ, build_zero_cst (typ));
- else
- {
- an_loop_info[ii].var = create_temporary_var (typ);
- add_decl_expr (an_loop_info[ii].var);
- }
- an_loop_info[ii].ind_init =
- build_x_modify_expr (location, an_loop_info[ii].var, INIT_EXPR,
- build_zero_cst (typ), tf_warning_or_error);
- }
- array_operand = create_array_refs (location, an_info, an_loop_info,
- list_size, rank);
- replace_array_notations (&func_parm, true, array_list, array_operand);
-
- if (!TREE_TYPE (func_parm))
- TREE_TYPE (func_parm) = TREE_TYPE ((*array_list)[0]);
-
- create_cmp_incr (location, &an_loop_info, rank, an_info, tf_warning_or_error);
- if (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND
- || an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND)
- array_ind_value = get_temp_regvar (TREE_TYPE (func_parm), func_parm);
-
- array_op0 = (*array_operand)[0];
- if (INDIRECT_REF_P (array_op0))
- array_op0 = TREE_OPERAND (array_op0, 0);
- switch (an_type)
- {
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD:
- code = PLUS_EXPR;
- init = build_zero_cst (new_var_type);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUL:
- code = MULT_EXPR;
- init = build_one_cst (new_var_type);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO:
- code = ((an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO) ? EQ_EXPR
- : NE_EXPR);
- init = build_zero_cst (new_var_type);
- cond_init = build_one_cst (new_var_type);
- comp_node = build_zero_cst (TREE_TYPE (func_parm));
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO:
- code = ((an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO) ? NE_EXPR
- : EQ_EXPR);
- init = build_one_cst (new_var_type);
- cond_init = build_zero_cst (new_var_type);
- comp_node = build_zero_cst (TREE_TYPE (func_parm));
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX:
- code = MAX_EXPR;
- init = (TYPE_MIN_VALUE (new_var_type) ? TYPE_MIN_VALUE (new_var_type)
- : func_parm);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN:
- code = MIN_EXPR;
- init = (TYPE_MAX_VALUE (new_var_type) ? TYPE_MAX_VALUE (new_var_type)
- : func_parm);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND:
- code = (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND ? LE_EXPR
- : GE_EXPR);
- init = an_loop_info[0].var;
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE:
- init = identity_value;
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING:
- init = NULL_TREE;
- break;
- default:
- gcc_unreachable ();
- }
-
- if (an_type != BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING)
- *new_var = get_temp_regvar (new_var_type, init);
- else
- *new_var = NULL_TREE;
-
- switch (an_type)
- {
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUL:
- new_expr = build_x_modify_expr (location, *new_var, code, func_parm,
- tf_warning_or_error);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ALL_NONZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_ZERO:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_ANY_NONZERO:
- /* In all these cases, assume the false case is true and as soon as
- we find a true case, set the true flag on and latch it in. */
- new_yes_expr = build_x_modify_expr (location, *new_var, NOP_EXPR,
- cond_init, tf_warning_or_error);
- new_no_expr = build_x_modify_expr (location, *new_var, NOP_EXPR,
- *new_var, tf_warning_or_error);
- new_cond_expr = build_x_binary_op
- (location, code, func_parm, TREE_CODE (func_parm), comp_node,
- TREE_CODE (comp_node), NULL, tf_warning_or_error);
- new_expr = build_x_conditional_expr (location, new_cond_expr,
- new_yes_expr, new_no_expr,
- tf_warning_or_error);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN:
- new_cond_expr = build_x_binary_op
- (location, code, *new_var, TREE_CODE (*new_var), func_parm,
- TREE_CODE (func_parm), NULL, tf_warning_or_error);
- new_expr = build_x_modify_expr (location, *new_var, NOP_EXPR, func_parm,
- tf_warning_or_error);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND:
- new_yes_expr = build_x_modify_expr (location, array_ind_value, NOP_EXPR,
- func_parm, tf_warning_or_error);
- new_no_expr = build_x_modify_expr (location, array_ind_value, NOP_EXPR,
- array_ind_value, tf_warning_or_error);
- if (list_size > 1)
- new_yes_ind = build_x_modify_expr (location, *new_var, NOP_EXPR,
- an_loop_info[0].var,
- tf_warning_or_error);
- else
- new_yes_ind = build_x_modify_expr (location, *new_var, NOP_EXPR,
- TREE_OPERAND (array_op0, 1),
- tf_warning_or_error);
- new_no_ind = build_x_modify_expr (location, *new_var, NOP_EXPR, *new_var,
- tf_warning_or_error);
- new_yes_list = alloc_stmt_list ();
- append_to_statement_list (new_yes_ind, &new_yes_list);
- append_to_statement_list (new_yes_expr, &new_yes_list);
-
- new_no_list = alloc_stmt_list ();
- append_to_statement_list (new_no_ind, &new_no_list);
- append_to_statement_list (new_no_expr, &new_no_list);
-
- new_cond_expr = build_x_binary_op (location, code, array_ind_value,
- TREE_CODE (array_ind_value), func_parm,
- TREE_CODE (func_parm), NULL,
- tf_warning_or_error);
- new_expr = build_x_conditional_expr (location, new_cond_expr,
- new_yes_list, new_no_list,
- tf_warning_or_error);
- break;
- case BUILT_IN_CILKPLUS_SEC_REDUCE:
- case BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING:
- func_args = make_tree_vector ();
- if (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE)
- vec_safe_push (func_args, *new_var);
- else
- vec_safe_push (func_args, identity_value);
- vec_safe_push (func_args, func_parm);
-
- new_expr = finish_call_expr (call_fn, &func_args, false, true,
- tf_warning_or_error);
- if (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE)
- new_expr = build_x_modify_expr (location, *new_var, NOP_EXPR, new_expr,
- tf_warning_or_error);
- release_tree_vector (func_args);
- break;
- default:
- gcc_unreachable ();
- }
- an_init = pop_stmt_list (an_init);
- append_to_statement_list (an_init, &loop_with_init);
- body = new_expr;
-
- for (ii = 0; ii < rank; ii++)
- {
- tree new_loop = push_stmt_list ();
- create_an_loop (an_loop_info[ii].ind_init, an_loop_info[ii].cmp,
- an_loop_info[ii].incr, body);
- body = pop_stmt_list (new_loop);
- }
- append_to_statement_list (body, &loop_with_init);
-
- release_vec_vec (an_info);
-
- return loop_with_init;
-}
-
-/* Returns a loop with ARRAY_REF inside it with an appropriate modify expr.
- The LHS and/or RHS will be array notation expressions that have a
- MODIFYCODE. The location of the variable is specified by LOCATION. */
-
-static tree
-expand_an_in_modify_expr (location_t location, tree lhs,
- enum tree_code modifycode, tree rhs,
- tsubst_flags_t complain)
-{
- tree array_expr_lhs = NULL_TREE, array_expr_rhs = NULL_TREE;
- tree array_expr = NULL_TREE;
- tree body = NULL_TREE;
- auto_vec<tree> cond_expr;
- vec<tree, va_gc> *lhs_array_operand = NULL, *rhs_array_operand = NULL;
- size_t lhs_rank = 0, rhs_rank = 0, ii = 0;
- vec<tree, va_gc> *rhs_list = NULL, *lhs_list = NULL;
- size_t rhs_list_size = 0, lhs_list_size = 0;
- tree new_modify_expr, new_var = NULL_TREE, builtin_loop, scalar_mods;
- bool found_builtin_fn = false;
- tree an_init, loop_with_init = alloc_stmt_list ();
- vec<vec<an_parts> > lhs_an_info = vNULL, rhs_an_info = vNULL;
- auto_vec<an_loop_parts> lhs_an_loop_info, rhs_an_loop_info;
- tree lhs_len, rhs_len;
-
- if (!find_rank (location, rhs, rhs, false, &rhs_rank))
- return error_mark_node;
- extract_array_notation_exprs (rhs, false, &rhs_list);
- rhs_list_size = vec_safe_length (rhs_list);
- an_init = push_stmt_list ();
- if (rhs_rank)
- {
- scalar_mods = replace_invariant_exprs (&rhs);
- if (scalar_mods)
- finish_expr_stmt (scalar_mods);
- }
- for (ii = 0; ii < rhs_list_size; ii++)
- {
- tree rhs_node = (*rhs_list)[ii];
- if (TREE_CODE (rhs_node) == CALL_EXPR)
- {
- builtin_loop = expand_sec_reduce_builtin (rhs_node, &new_var);
- if (builtin_loop == error_mark_node)
- return error_mark_node;
- else if (builtin_loop)
- {
- finish_expr_stmt (builtin_loop);
- found_builtin_fn = true;
- if (new_var)
- {
- vec <tree, va_gc> *rhs_sub_list = NULL, *new_var_list = NULL;
- vec_safe_push (rhs_sub_list, rhs_node);
- vec_safe_push (new_var_list, new_var);
- replace_array_notations (&rhs, false, rhs_sub_list,
- new_var_list);
- }
- }
- }
- }
- lhs_rank = 0;
- rhs_rank = 0;
- if (!find_rank (location, lhs, lhs, true, &lhs_rank)
- || !find_rank (location, rhs, rhs, true, &rhs_rank))
- {
- pop_stmt_list (an_init);
- return error_mark_node;
- }
-
- /* If both are scalar, then the only reason why we will get this far is if
- there is some array notations inside it and was using a builtin array
- notation functions. If so, we have already broken those guys up and now
- a simple build_x_modify_expr would do. */
- if (lhs_rank == 0 && rhs_rank == 0)
- {
- if (found_builtin_fn)
- {
- new_modify_expr = build_x_modify_expr (location, lhs,
- modifycode, rhs, complain);
- finish_expr_stmt (new_modify_expr);
- pop_stmt_list (an_init);
- return an_init;
- }
- else
- gcc_unreachable ();
- }
-
- /* If for some reason location is not set, then find if LHS or RHS has
- location info. If so, then use that so we atleast have an idea. */
- if (location == UNKNOWN_LOCATION)
- {
- if (EXPR_LOCATION (lhs) != UNKNOWN_LOCATION)
- location = EXPR_LOCATION (lhs);
- else if (EXPR_LOCATION (rhs) != UNKNOWN_LOCATION)
- location = EXPR_LOCATION (rhs);
- }
-
- /* We need this when we have a scatter issue. */
- extract_array_notation_exprs (lhs, true, &lhs_list);
- rhs_list = NULL;
- extract_array_notation_exprs (rhs, true, &rhs_list);
- rhs_list_size = vec_safe_length (rhs_list);
- lhs_list_size = vec_safe_length (lhs_list);
-
- if (lhs_rank == 0 && rhs_rank != 0)
- {
- error_at (location, "%qE cannot be scalar when %qE is not", lhs, rhs);
- return error_mark_node;
- }
- if (lhs_rank != 0 && rhs_rank != 0 && lhs_rank != rhs_rank)
- {
- error_at (location, "rank mismatch between %qE and %qE", lhs, rhs);
- return error_mark_node;
- }
-
- /* Assign the array notation components to variable so that they can satisfy
- the execute-once rule. */
- for (ii = 0; ii < lhs_list_size; ii++)
- {
- tree anode = (*lhs_list)[ii];
- make_triplet_val_inv (&ARRAY_NOTATION_START (anode));
- make_triplet_val_inv (&ARRAY_NOTATION_LENGTH (anode));
- make_triplet_val_inv (&ARRAY_NOTATION_STRIDE (anode));
- }
- for (ii = 0; ii < rhs_list_size; ii++)
- if ((*rhs_list)[ii] && TREE_CODE ((*rhs_list)[ii]) == ARRAY_NOTATION_REF)
- {
- tree aa = (*rhs_list)[ii];
- make_triplet_val_inv (&ARRAY_NOTATION_START (aa));
- make_triplet_val_inv (&ARRAY_NOTATION_LENGTH (aa));
- make_triplet_val_inv (&ARRAY_NOTATION_STRIDE (aa));
- }
- lhs_an_loop_info.safe_grow_cleared (lhs_rank);
-
- if (rhs_rank)
- rhs_an_loop_info.safe_grow_cleared (rhs_rank);
-
- cond_expr.safe_grow_cleared (MAX (lhs_rank, rhs_rank));
- cilkplus_extract_an_triplets (lhs_list, lhs_list_size, lhs_rank,
- &lhs_an_info);
- if (rhs_list)
- cilkplus_extract_an_triplets (rhs_list, rhs_list_size, rhs_rank,
- &rhs_an_info);
- if (length_mismatch_in_expr_p (EXPR_LOCATION (lhs), lhs_an_info)
- || (rhs_list && length_mismatch_in_expr_p (EXPR_LOCATION (rhs),
- rhs_an_info)))
- {
- pop_stmt_list (an_init);
- goto error;
- }
- rhs_len = ((rhs_list_size > 0 && rhs_rank > 0) ?
- rhs_an_info[0][0].length : NULL_TREE);
- lhs_len = ((lhs_list_size > 0 && lhs_rank > 0) ?
- lhs_an_info[0][0].length : NULL_TREE);
- if (lhs_list_size > 0 && rhs_list_size > 0 && lhs_rank > 0 && rhs_rank > 0
- && TREE_CODE (lhs_len) == INTEGER_CST && rhs_len
- && TREE_CODE (rhs_len) == INTEGER_CST
- && !tree_int_cst_equal (rhs_len, lhs_len))
- {
- error_at (location, "length mismatch between LHS and RHS");
- pop_stmt_list (an_init);
- goto error;
- }
- for (ii = 0; ii < lhs_rank; ii++)
- {
- tree typ = ptrdiff_type_node;
- lhs_an_loop_info[ii].var = create_temporary_var (typ);
- add_decl_expr (lhs_an_loop_info[ii].var);
- lhs_an_loop_info[ii].ind_init = build_x_modify_expr
- (location, lhs_an_loop_info[ii].var, INIT_EXPR, build_zero_cst (typ),
- complain);
- }
-
- if (rhs_list_size > 0)
- {
- rhs_array_operand = fix_sec_implicit_args (location, rhs_list,
- lhs_an_loop_info, lhs_rank,
- lhs);
- if (!rhs_array_operand)
- goto error;
- }
- replace_array_notations (&rhs, true, rhs_list, rhs_array_operand);
- rhs_list_size = 0;
- rhs_list = NULL;
- extract_array_notation_exprs (rhs, true, &rhs_list);
- rhs_list_size = vec_safe_length (rhs_list);
-
- for (ii = 0; ii < rhs_rank; ii++)
- {
- tree typ = ptrdiff_type_node;
- rhs_an_loop_info[ii].var = create_temporary_var (typ);
- add_decl_expr (rhs_an_loop_info[ii].var);
- rhs_an_loop_info[ii].ind_init = build_x_modify_expr
- (location, rhs_an_loop_info[ii].var, INIT_EXPR, build_zero_cst (typ),
- complain);
- }
-
- if (lhs_rank)
- {
- lhs_array_operand =
- create_array_refs (location, lhs_an_info, lhs_an_loop_info,
- lhs_list_size, lhs_rank);
- replace_array_notations (&lhs, true, lhs_list, lhs_array_operand);
- }
-
- if (rhs_array_operand)
- vec_safe_truncate (rhs_array_operand, 0);
- if (rhs_rank)
- {
- rhs_array_operand = create_array_refs (location, rhs_an_info,
- rhs_an_loop_info, rhs_list_size,
- rhs_rank);
- /* Replace all the array refs created by the above function because this
- variable is blown away by the fix_sec_implicit_args function below. */
- replace_array_notations (&rhs, true, rhs_list, rhs_array_operand);
- vec_safe_truncate (rhs_array_operand , 0);
- rhs_array_operand = fix_sec_implicit_args (location, rhs_list,
- rhs_an_loop_info, rhs_rank,
- rhs);
- if (!rhs_array_operand)
- goto error;
- replace_array_notations (&rhs, true, rhs_list, rhs_array_operand);
- }
-
- array_expr_rhs = rhs;
- array_expr_lhs = lhs;
-
- array_expr = build_x_modify_expr (location, array_expr_lhs, modifycode,
- array_expr_rhs, complain);
- create_cmp_incr (location, &lhs_an_loop_info, lhs_rank, lhs_an_info,
- complain);
- if (rhs_rank)
- create_cmp_incr (location, &rhs_an_loop_info, rhs_rank, rhs_an_info,
- complain);
- for (ii = 0; ii < MAX (rhs_rank, lhs_rank); ii++)
- if (ii < lhs_rank && ii < rhs_rank)
- cond_expr[ii] = build_x_binary_op
- (location, TRUTH_ANDIF_EXPR, lhs_an_loop_info[ii].cmp,
- TREE_CODE (lhs_an_loop_info[ii].cmp), rhs_an_loop_info[ii].cmp,
- TREE_CODE (rhs_an_loop_info[ii].cmp), NULL, complain);
- else if (ii < lhs_rank && ii >= rhs_rank)
- cond_expr[ii] = lhs_an_loop_info[ii].cmp;
- else
- /* No need to compare ii < rhs_rank && ii >= lhs_rank because in a valid
- Array notation expression, rank of RHS cannot be greater than LHS. */
- gcc_unreachable ();
-
- an_init = pop_stmt_list (an_init);
- append_to_statement_list (an_init, &loop_with_init);
- body = array_expr;
- for (ii = 0; ii < MAX (lhs_rank, rhs_rank); ii++)
- {
- tree incr_list = alloc_stmt_list ();
- tree init_list = alloc_stmt_list ();
- tree new_loop = push_stmt_list ();
-
- if (lhs_rank)
- {
- append_to_statement_list (lhs_an_loop_info[ii].ind_init, &init_list);
- append_to_statement_list (lhs_an_loop_info[ii].incr, &incr_list);
- }
- if (rhs_rank)
- {
- append_to_statement_list (rhs_an_loop_info[ii].ind_init, &init_list);
- append_to_statement_list (rhs_an_loop_info[ii].incr, &incr_list);
- }
- create_an_loop (init_list, cond_expr[ii], incr_list, body);
- body = pop_stmt_list (new_loop);
- }
- append_to_statement_list (body, &loop_with_init);
-
- release_vec_vec (lhs_an_info);
- release_vec_vec (rhs_an_info);
-
- return loop_with_init;
-
-error:
- release_vec_vec (lhs_an_info);
- release_vec_vec (rhs_an_info);
-
- return error_mark_node;
-}
-
-/* Helper function for expand_conditonal_array_notations. Encloses the
- conditional statement passed in ORIG_STMT with a loop around it and
- replaces the condition in STMT with a ARRAY_REF tree-node to the array.
- The condition must have a ARRAY_NOTATION_REF tree. */
-
-static tree
-cp_expand_cond_array_notations (tree orig_stmt)
-{
- vec<tree, va_gc> *array_list = NULL, *array_operand = NULL;
- size_t list_size = 0;
- size_t rank = 0, ii = 0;
- tree an_init, body, stmt = NULL_TREE;
- tree builtin_loop, new_var = NULL_TREE;
- tree loop_with_init = alloc_stmt_list ();
- location_t location = UNKNOWN_LOCATION;
- vec<vec<an_parts> > an_info = vNULL;
- auto_vec<an_loop_parts> an_loop_info;
-
- if (TREE_CODE (orig_stmt) == COND_EXPR)
- {
- size_t cond_rank = 0, yes_rank = 0, no_rank = 0;
- tree yes_expr = COND_EXPR_THEN (orig_stmt);
- tree no_expr = COND_EXPR_ELSE (orig_stmt);
- tree cond = COND_EXPR_COND (orig_stmt);
- if (!find_rank (EXPR_LOCATION (cond), cond, cond, true, &cond_rank)
- || !find_rank (EXPR_LOCATION (yes_expr), yes_expr, yes_expr, true,
- &yes_rank)
- || !find_rank (EXPR_LOCATION (no_expr), no_expr, no_expr, true,
- &no_rank))
- return error_mark_node;
- /* If the condition has a zero rank, then handle array notations in body
- separately. */
- if (cond_rank == 0)
- return orig_stmt;
- if (cond_rank != yes_rank && yes_rank != 0)
- {
- error_at (EXPR_LOCATION (yes_expr), "rank mismatch with controlling"
- " expression of parent if-statement");
- return error_mark_node;
- }
- else if (cond_rank != no_rank && no_rank != 0)
- {
- error_at (EXPR_LOCATION (no_expr), "rank mismatch with controlling "
- "expression of parent if-statement");
- return error_mark_node;
- }
- }
- else if (TREE_CODE (orig_stmt) == IF_STMT)
- {
- size_t cond_rank = 0, yes_rank = 0, no_rank = 0;
- tree yes_expr = THEN_CLAUSE (orig_stmt);
- tree no_expr = ELSE_CLAUSE (orig_stmt);
- tree cond = IF_COND (orig_stmt);
- if (!find_rank (EXPR_LOCATION (cond), cond, cond, true, &cond_rank)
- || (yes_expr
- && !find_rank (EXPR_LOCATION (yes_expr), yes_expr, yes_expr, true,
- &yes_rank))
- || (no_expr
- && !find_rank (EXPR_LOCATION (no_expr), no_expr, no_expr, true,
- &no_rank)))
- return error_mark_node;
-
- /* Same reasoning as for COND_EXPR. */
- if (cond_rank == 0)
- return orig_stmt;
- else if (cond_rank != yes_rank && yes_rank != 0)
- {
- error_at (EXPR_LOCATION (yes_expr), "rank mismatch with controlling"
- " expression of parent if-statement");
- return error_mark_node;
- }
- else if (cond_rank != no_rank && no_rank != 0)
- {
- error_at (EXPR_LOCATION (no_expr), "rank mismatch with controlling "
- "expression of parent if-statement");
- return error_mark_node;
- }
- }
- else if (truth_value_p (TREE_CODE (orig_stmt)))
- {
- size_t left_rank = 0, right_rank = 0;
- tree left_expr = TREE_OPERAND (orig_stmt, 0);
- tree right_expr = TREE_OPERAND (orig_stmt, 1);
- if (!find_rank (EXPR_LOCATION (left_expr), left_expr, left_expr, true,
- &left_rank)
- || !find_rank (EXPR_LOCATION (right_expr), right_expr, right_expr,
- true, &right_rank))
- return error_mark_node;
- if (right_rank == 0 && left_rank == 0)
- return orig_stmt;
- }
-
- if (!find_rank (EXPR_LOCATION (orig_stmt), orig_stmt, orig_stmt, true,
- &rank))
- return error_mark_node;
- if (rank == 0)
- return orig_stmt;
-
- extract_array_notation_exprs (orig_stmt, false, &array_list);
- stmt = alloc_stmt_list ();
- for (ii = 0; ii < vec_safe_length (array_list); ii++)
- {
- tree array_node = (*array_list)[ii];
- if (TREE_CODE (array_node) == CALL_EXPR
- || TREE_CODE (array_node) == AGGR_INIT_EXPR)
- {
- builtin_loop = expand_sec_reduce_builtin (array_node, &new_var);
- if (builtin_loop == error_mark_node)
- finish_expr_stmt (error_mark_node);
- else if (new_var)
- {
- vec<tree, va_gc> *sub_list = NULL, *new_var_list = NULL;
- vec_safe_push (sub_list, array_node);
- vec_safe_push (new_var_list, new_var);
- replace_array_notations (&orig_stmt, false, sub_list,
- new_var_list);
- append_to_statement_list (builtin_loop, &stmt);
- }
- }
- }
- append_to_statement_list (orig_stmt, &stmt);
- rank = 0;
- array_list = NULL;
- if (!find_rank (EXPR_LOCATION (stmt), stmt, stmt, true, &rank))
- return error_mark_node;
- if (rank == 0)
- return stmt;
-
- extract_array_notation_exprs (stmt, true, &array_list);
- list_size = vec_safe_length (array_list);
- if (list_size == 0)
- return stmt;
-
- location = EXPR_LOCATION (orig_stmt);
- list_size = vec_safe_length (array_list);
- an_loop_info.safe_grow_cleared (rank);
-
- an_init = push_stmt_list ();
-
- /* Assign the array notation components to variable so that they can
- satisfy the exec-once rule. */
- for (ii = 0; ii < list_size; ii++)
- {
- tree anode = (*array_list)[ii];
- make_triplet_val_inv (&ARRAY_NOTATION_START (anode));
- make_triplet_val_inv (&ARRAY_NOTATION_LENGTH (anode));
- make_triplet_val_inv (&ARRAY_NOTATION_STRIDE (anode));
- }
- cilkplus_extract_an_triplets (array_list, list_size, rank, &an_info);
-
- for (ii = 0; ii < rank; ii++)
- {
- tree typ = ptrdiff_type_node;
- an_loop_info[ii].var = create_temporary_var (typ);
- add_decl_expr (an_loop_info[ii].var);
- an_loop_info[ii].ind_init =
- build_x_modify_expr (location, an_loop_info[ii].var, INIT_EXPR,
- build_zero_cst (typ), tf_warning_or_error);
- }
- array_operand = create_array_refs (location, an_info, an_loop_info,
- list_size, rank);
- replace_array_notations (&stmt, true, array_list, array_operand);
- create_cmp_incr (location, &an_loop_info, rank, an_info, tf_warning_or_error);
-
- an_init = pop_stmt_list (an_init);
- append_to_statement_list (an_init, &loop_with_init);
- body = stmt;
-
- for (ii = 0; ii < rank; ii++)
- {
- tree new_loop = push_stmt_list ();
- create_an_loop (an_loop_info[ii].ind_init, an_loop_info[ii].cmp,
- an_loop_info[ii].incr, body);
- body = pop_stmt_list (new_loop);
- }
- append_to_statement_list (body, &loop_with_init);
-
- release_vec_vec (an_info);
-
- return loop_with_init;
-}
-
-/* Transforms array notations inside unary expression ORIG_STMT with an
- appropriate loop and ARRAY_REF (and returns all this as a super-tree called
- LOOP). */
-
-static tree
-expand_unary_array_notation_exprs (tree orig_stmt)
-{
- vec<tree, va_gc> *array_list = NULL, *array_operand = NULL;
- size_t list_size = 0, rank = 0, ii = 0;
- tree body;
- tree builtin_loop, stmt = NULL_TREE, new_var = NULL_TREE;
- location_t location = EXPR_LOCATION (orig_stmt);
- tree an_init, loop_with_init = alloc_stmt_list ();
- vec<vec<an_parts> > an_info = vNULL;
- auto_vec<an_loop_parts> an_loop_info;
-
- if (!find_rank (location, orig_stmt, orig_stmt, true, &rank))
- return error_mark_node;
- if (rank == 0)
- return orig_stmt;
-
- extract_array_notation_exprs (orig_stmt, false, &array_list);
- list_size = vec_safe_length (array_list);
- location = EXPR_LOCATION (orig_stmt);
- stmt = NULL_TREE;
- for (ii = 0; ii < list_size; ii++)
- if (TREE_CODE ((*array_list)[ii]) == CALL_EXPR
- || TREE_CODE ((*array_list)[ii]) == AGGR_INIT_EXPR)
- {
- tree list_node = (*array_list)[ii];
- builtin_loop = expand_sec_reduce_builtin (list_node, &new_var);
- if (builtin_loop == error_mark_node)
- return error_mark_node;
- else if (builtin_loop)
- {
- vec<tree, va_gc> *sub_list = NULL, *new_var_list = NULL;
- stmt = alloc_stmt_list ();
- append_to_statement_list (builtin_loop, &stmt);
- vec_safe_push (sub_list, list_node);
- vec_safe_push (new_var_list, new_var);
- replace_array_notations (&orig_stmt, false, sub_list, new_var_list);
- }
- }
- if (stmt != NULL_TREE)
- append_to_statement_list (finish_expr_stmt (orig_stmt), &stmt);
- else
- stmt = orig_stmt;
- rank = 0;
- list_size = 0;
- array_list = NULL;
- extract_array_notation_exprs (stmt, true, &array_list);
- list_size = vec_safe_length (array_list);
-
- if (!find_rank (EXPR_LOCATION (stmt), stmt, stmt, true, &rank))
- return error_mark_node;
- if (rank == 0 || list_size == 0)
- return stmt;
- an_loop_info.safe_grow_cleared (rank);
- an_init = push_stmt_list ();
- /* Assign the array notation components to variable so that they can satisfy
- the exec-once rule. */
- for (ii = 0; ii < list_size; ii++)
- {
- tree array_node = (*array_list)[ii];
- make_triplet_val_inv (&ARRAY_NOTATION_START (array_node));
- make_triplet_val_inv (&ARRAY_NOTATION_LENGTH (array_node));
- make_triplet_val_inv (&ARRAY_NOTATION_STRIDE (array_node));
- }
- cilkplus_extract_an_triplets (array_list, list_size, rank, &an_info);
-
- for (ii = 0; ii < rank; ii++)
- {
- tree typ = ptrdiff_type_node;
- an_loop_info[ii].var = create_temporary_var (typ);
- add_decl_expr (an_loop_info[ii].var);
- an_loop_info[ii].ind_init = build_x_modify_expr
- (location, an_loop_info[ii].var, INIT_EXPR, build_zero_cst (typ),
- tf_warning_or_error);
- }
- array_operand = create_array_refs (location, an_info, an_loop_info,
- list_size, rank);
- replace_array_notations (&stmt, true, array_list, array_operand);
- create_cmp_incr (location, &an_loop_info, rank, an_info, tf_warning_or_error);
-
- an_init = pop_stmt_list (an_init);
- append_to_statement_list (an_init, &loop_with_init);
- body = stmt;
-
- for (ii = 0; ii < rank; ii++)
- {
- tree new_loop = push_stmt_list ();
- create_an_loop (an_loop_info[ii].ind_init, an_loop_info[ii].cmp,
- an_loop_info[ii].incr, body);
- body = pop_stmt_list (new_loop);
- }
- append_to_statement_list (body, &loop_with_init);
-
- release_vec_vec (an_info);
-
- return loop_with_init;
-}
-
-/* Expands the array notation's builtin reduction function in EXPR
- (of type RETURN_EXPR) and returns a STATEMENT_LIST that contains a loop
- with the builtin function expansion and a return statement at the end. */
-
-static tree
-expand_return_expr (tree expr)
-{
- tree new_mod_list, new_var, new_mod, retval_expr;
- size_t rank = 0;
- location_t loc = EXPR_LOCATION (expr);
- if (TREE_CODE (expr) != RETURN_EXPR)
- return expr;
-
- if (!find_rank (loc, expr, expr, false, &rank))
- return error_mark_node;
-
- /* If the return expression contains array notations, then flag it as
- error. */
- if (rank >= 1)
- {
- error_at (loc, "array notation expression cannot be used as a return "
- "value");
- return error_mark_node;
- }
-
- new_mod_list = push_stmt_list ();
- retval_expr = TREE_OPERAND (expr, 0);
- new_var = create_temporary_var (TREE_TYPE (retval_expr));
- add_decl_expr (new_var);
- new_mod = expand_an_in_modify_expr (loc, new_var, NOP_EXPR,
- TREE_OPERAND (retval_expr, 1),
- tf_warning_or_error);
- TREE_OPERAND (retval_expr, 1) = new_var;
- TREE_OPERAND (expr, 0) = retval_expr;
- add_stmt (new_mod);
- add_stmt (expr);
- new_mod_list = pop_stmt_list (new_mod_list);
- return new_mod_list;
-}
-
-/* Expands ARRAY_NOTATION_REF and builtin functions in a compound statement,
- STMT. Returns the STMT with expanded array notations. */
-
-tree
-expand_array_notation_exprs (tree t)
-{
- enum tree_code code;
- bool is_expr;
- location_t loc = UNKNOWN_LOCATION;
-
- if (!t)
- return t;
-
- loc = EXPR_LOCATION (t);
-
- code = TREE_CODE (t);
- is_expr = IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code));
- switch (code)
- {
- case ERROR_MARK:
- case IDENTIFIER_NODE:
- case VOID_CST:
- case INTEGER_CST:
- case REAL_CST:
- case FIXED_CST:
- case STRING_CST:
- case BLOCK:
- case PLACEHOLDER_EXPR:
- case FIELD_DECL:
- case VOID_TYPE:
- case REAL_TYPE:
- case SSA_NAME:
- case LABEL_DECL:
- case RESULT_DECL:
- case VAR_DECL:
- case PARM_DECL:
- case NON_LVALUE_EXPR:
- case NOP_EXPR:
- case ADDR_EXPR:
- case ARRAY_REF:
- case BIT_FIELD_REF:
- case VECTOR_CST:
- case COMPLEX_CST:
- return t;
- case INIT_EXPR:
- case MODIFY_EXPR:
- if (contains_array_notation_expr (t))
- t = expand_an_in_modify_expr (loc, TREE_OPERAND (t, 0), NOP_EXPR,
- TREE_OPERAND (t, 1),
- tf_warning_or_error);
- return t;
- case MODOP_EXPR:
- if (contains_array_notation_expr (t) && !processing_template_decl)
- t = expand_an_in_modify_expr
- (loc, TREE_OPERAND (t, 0), TREE_CODE (TREE_OPERAND (t, 1)),
- TREE_OPERAND (t, 2), tf_warning_or_error);
- return t;
- case CONSTRUCTOR:
- return t;
- case BIND_EXPR:
- {
- BIND_EXPR_BODY (t) =
- expand_array_notation_exprs (BIND_EXPR_BODY (t));
- return t;
- }
- case DECL_EXPR:
- if (contains_array_notation_expr (t))
- {
- tree x = DECL_EXPR_DECL (t);
- if (DECL_INITIAL (x))
- {
- location_t loc = DECL_SOURCE_LOCATION (x);
- tree lhs = x;
- tree rhs = DECL_INITIAL (x);
- DECL_INITIAL (x) = NULL;
- tree new_modify_expr = build_modify_expr (loc, lhs,
- TREE_TYPE (lhs),
- NOP_EXPR,
- loc, rhs,
- TREE_TYPE(rhs));
- t = expand_array_notation_exprs (new_modify_expr);
- }
- }
- return t;
- case STATEMENT_LIST:
- {
- tree_stmt_iterator i;
- for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
- *tsi_stmt_ptr (i) =
- expand_array_notation_exprs (*tsi_stmt_ptr (i));
- return t;
- }
-
- case OMP_PARALLEL:
- OMP_PARALLEL_BODY (t)
- = expand_array_notation_exprs (OMP_PARALLEL_BODY (t));
- return t;
-
- case OMP_TASK:
- case OMP_FOR:
- case OMP_SINGLE:
- case OMP_SECTION:
- case OMP_SECTIONS:
- case OMP_MASTER:
- case OMP_TASKGROUP:
- case OMP_ORDERED:
- case OMP_CRITICAL:
- case OMP_ATOMIC:
- case OMP_CLAUSE:
- case TARGET_EXPR:
- case INTEGER_TYPE:
- case ENUMERAL_TYPE:
- case BOOLEAN_TYPE:
- case POINTER_TYPE:
- case ARRAY_TYPE:
- case RECORD_TYPE:
- case METHOD_TYPE:
- return t;
- case RETURN_EXPR:
- if (contains_array_notation_expr (t))
- t = expand_return_expr (t);
- return t;
- case PREDECREMENT_EXPR:
- case PREINCREMENT_EXPR:
- case POSTDECREMENT_EXPR:
- case POSTINCREMENT_EXPR:
- case AGGR_INIT_EXPR:
- case CALL_EXPR:
- t = expand_unary_array_notation_exprs (t);
- return t;
- case CONVERT_EXPR:
- case CLEANUP_POINT_EXPR:
- case EXPR_STMT:
- TREE_OPERAND (t, 0) = expand_array_notation_exprs (TREE_OPERAND (t, 0));
- /* It is not necessary to wrap error_mark_node in EXPR_STMT. */
- if (TREE_OPERAND (t, 0) == error_mark_node)
- return TREE_OPERAND (t, 0);
- return t;
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
- case TRUTH_AND_EXPR:
- case TRUTH_OR_EXPR:
- case TRUTH_XOR_EXPR:
- case TRUTH_NOT_EXPR:
- case COND_EXPR:
- t = cp_expand_cond_array_notations (t);
- if (TREE_CODE (t) == COND_EXPR)
- {
- COND_EXPR_THEN (t) =
- expand_array_notation_exprs (COND_EXPR_THEN (t));
- COND_EXPR_ELSE (t) =
- expand_array_notation_exprs (COND_EXPR_ELSE (t));
- }
- return t;
- case FOR_STMT:
- if (contains_array_notation_expr (FOR_COND (t)))
- {
- error_at (EXPR_LOCATION (FOR_COND (t)),
- "array notation cannot be used in a condition for "
- "a for-loop");
- return error_mark_node;
- }
- /* FIXME: Add a check for CILK_FOR_STMT here when we add Cilk tasking
- keywords. */
- if (TREE_CODE (t) == FOR_STMT)
- {
- FOR_BODY (t) = expand_array_notation_exprs (FOR_BODY (t));
- FOR_EXPR (t) = expand_array_notation_exprs (FOR_EXPR (t));
- }
- else
- t = expand_array_notation_exprs (t);
- return t;
- case IF_STMT:
- t = cp_expand_cond_array_notations (t);
- /* If the above function added some extra instructions above the original
- if statement, then we can't assume it is still IF_STMT so we have to
- check again. */
- if (TREE_CODE (t) == IF_STMT)
- {
- if (THEN_CLAUSE (t))
- THEN_CLAUSE (t) = expand_array_notation_exprs (THEN_CLAUSE (t));
- if (ELSE_CLAUSE (t))
- ELSE_CLAUSE (t) = expand_array_notation_exprs (ELSE_CLAUSE (t));
- }
- else
- t = expand_array_notation_exprs (t);
- return t;
- case SWITCH_STMT:
- if (contains_array_notation_expr (SWITCH_STMT_COND (t)))
- {
- error_at (EXPR_LOCATION (SWITCH_STMT_COND (t)),
- "array notation cannot be used as a condition for "
- "switch statement");
- return error_mark_node;
- }
- if (SWITCH_STMT_BODY (t))
- SWITCH_STMT_BODY (t) =
- expand_array_notation_exprs (SWITCH_STMT_BODY (t));
- return t;
- case WHILE_STMT:
- if (contains_array_notation_expr (WHILE_COND (t)))
- {
- if (EXPR_LOCATION (WHILE_COND (t)) != UNKNOWN_LOCATION)
- loc = EXPR_LOCATION (WHILE_COND (t));
- error_at (loc, "array notation cannot be used as a condition for "
- "while statement");
- return error_mark_node;
- }
- if (WHILE_BODY (t))
- WHILE_BODY (t) = expand_array_notation_exprs (WHILE_BODY (t));
- return t;
- case DO_STMT:
- if (contains_array_notation_expr (DO_COND (t)))
- {
- error_at (EXPR_LOCATION (DO_COND (t)),
- "array notation cannot be used as a condition for a "
- "do-while statement");
- return error_mark_node;
- }
- if (DO_BODY (t))
- DO_BODY (t) = expand_array_notation_exprs (DO_BODY (t));
- return t;
- default:
- if (is_expr)
- {
- int i, len;
-
- /* Walk over all the sub-trees of this operand. */
- len = TREE_CODE_LENGTH (code);
-
- /* Go through the subtrees. We need to do this in forward order so
- that the scope of a FOR_EXPR is handled properly. */
- for (i = 0; i < len; ++i)
- TREE_OPERAND (t, i) =
- expand_array_notation_exprs (TREE_OPERAND (t, i));
- }
- return t;
- }
- return t;
-}
-
-/* Given the base of an array (ARRAY), the START (start_index), the number of
- elements to be accessed (LENGTH) and the STRIDE, construct an
- ARRAY_NOTATION_REF tree of type TYPE and return it. Restrictions on START,
- LENGTH and STRIDE are the same as that of index field passed into ARRAY_REF.
- The only additional restriction is that, unlike index in ARRAY_REF, stride,
- length and start_index cannot contain array notations. */
-
-tree
-build_array_notation_ref (location_t loc, tree array, tree start, tree length,
- tree stride, tree type)
-{
- tree array_ntn_expr = NULL_TREE;
-
- /* If we enter the then-case of the if-statement below, we have hit a case
- like this: ARRAY [:]. */
- if (!start && !length)
- {
- if (TREE_CODE (type) != ARRAY_TYPE)
- {
- error_at (loc, "start-index and length fields necessary for "
- "using array notation in pointers or records");
- return error_mark_node;
- }
- tree domain = TYPE_DOMAIN (type);
- if (!domain)
- {
- error_at (loc, "start-index and length fields necessary for "
- "using array notation with array of unknown bound");
- return error_mark_node;
- }
- start = cp_fold_convert (ptrdiff_type_node, TYPE_MIN_VALUE (domain));
- length = size_binop (PLUS_EXPR, TYPE_MAX_VALUE (domain), size_one_node);
- length = cp_fold_convert (ptrdiff_type_node, length);
- }
-
- if (!stride)
- stride = build_one_cst (ptrdiff_type_node);
-
- stride = maybe_constant_value (stride);
- length = maybe_constant_value (length);
- if (start)
- start = maybe_constant_value (start);
-
- /* When dealing with templates, triplet type-checking will be done in pt.c
- after type substitution. */
- if (processing_template_decl
- && (type_dependent_expression_p (array)
- || type_dependent_expression_p (length)
- || type_dependent_expression_p (start)
- || type_dependent_expression_p (stride)))
- array_ntn_expr = build_min_nt_loc (loc, ARRAY_NOTATION_REF, array, start,
- length, stride, NULL_TREE);
- else
- {
- if (!cilkplus_an_triplet_types_ok_p (loc, start, length, stride, type))
- return error_mark_node;
- array_ntn_expr = build4 (ARRAY_NOTATION_REF, NULL_TREE, array, start,
- length, stride);
- }
- if (TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == POINTER_TYPE)
- TREE_TYPE (array_ntn_expr) = TREE_TYPE (type);
- else
- {
- error_at (loc, "base of array section must be pointer or array type");
- return error_mark_node;
- }
-
- SET_EXPR_LOCATION (array_ntn_expr, loc);
- return array_ntn_expr;
-}
-
-/* Returns false if any of the Array notation triplet values: START_INDEX,
- LENGTH and STRIDE, are not of integral type and have a rank greater than
- zero. */
-
-bool
-cilkplus_an_triplet_types_ok_p (location_t loc, tree start_index, tree length,
- tree stride, tree type)
-{
- size_t stride_rank = 0, length_rank = 0, start_rank = 0;
- if (!TREE_TYPE (start_index) || !INTEGRAL_TYPE_P (TREE_TYPE (start_index)))
- {
- error_at (loc, "start-index of array notation triplet is not an integer");
- return false;
- }
- if (!TREE_TYPE (length) || !INTEGRAL_TYPE_P (TREE_TYPE (length)))
- {
- error_at (loc, "length of array notation triplet is not an integer");
- return false;
- }
- if (!TREE_TYPE (stride) || !INTEGRAL_TYPE_P (TREE_TYPE (stride)))
- {
- error_at (loc, "stride of array notation triplet is not an integer");
- return false;
- }
- if (TREE_CODE (type) == FUNCTION_TYPE)
- {
- error_at (loc, "array notation cannot be used with function type");
- return false;
- }
- if (!find_rank (loc, start_index, start_index, false, &start_rank)
- || !find_rank (loc, length, length, false, &length_rank)
- || !find_rank (loc, stride, stride, false, &stride_rank))
- return false;
-
- if (start_rank != 0)
- {
- error_at (loc, "rank of an array notation triplet%'s start-index is not "
- "zero");
- return false;
- }
- if (length_rank != 0)
- {
- error_at (loc, "rank of an array notation triplet%'s length is not zero");
- return false;
- }
- if (stride_rank != 0)
- {
- error_at (loc, "rank of array notation triplet%'s stride is not zero");
- return false;
- }
- return true;
-}
diff --git a/gcc/cp/cp-cilkplus.c b/gcc/cp/cp-cilkplus.c
deleted file mode 100644
index 5ccf5d3385d..00000000000
--- a/gcc/cp/cp-cilkplus.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/* This file is part of the Intel(R) Cilk(TM) Plus support
- This file contains routines to handle Cilk Plus specific
- routines for the C++ Compiler.
- Copyright (C) 2013-2017 Free Software Foundation, Inc.
- Contributed by Aldy Hernandez <aldyh@redhat.com>.
-
- This file is part of GCC.
-
- GCC is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GCC is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3. If not see
- <http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "cp-tree.h"
-#include "tree-iterator.h"
-#include "cilk.h"
-#include "c-family/c-common.h"
-
-/* Return TRUE if T is a FUNCTION_DECL for a type-conversion operator. */
-
-static bool
-is_conversion_operator_function_decl_p (tree t)
-{
- if (TREE_CODE (t) != FUNCTION_DECL)
- return false;
-
- return DECL_CONV_FN_P (t);
-}
-
-/* Recursively traverse EXP to search for a CILK_SPAWN_STMT subtree.
- Return the CILK_SPAWN_STMT subtree if found; otherwise, the last subtree
- searched. */
-
-static tree
-find_spawn (tree exp)
-{
- /* Happens with C++ TARGET_EXPR. */
- if (exp == NULL_TREE)
- return exp;
-
- if (cilk_ignorable_spawn_rhs_op (exp))
- return find_spawn (TREE_OPERAND (exp, 0));
-
- switch (TREE_CODE (exp))
- {
- case AGGR_INIT_EXPR:
- {
- /* Check for initialization via a constructor call that represents
- implicit conversion. */
- if (AGGR_INIT_VIA_CTOR_P (exp) && aggr_init_expr_nargs (exp) == 2)
- return find_spawn (AGGR_INIT_EXPR_ARG (exp, 1));
-
- /* Check for initialization via a call to a type-conversion
- operator. */
- tree fn = AGGR_INIT_EXPR_FN (exp);
- if (TREE_CODE (fn) == ADDR_EXPR
- && is_conversion_operator_function_decl_p (TREE_OPERAND (fn, 0))
- && aggr_init_expr_nargs (exp) == 1)
- return find_spawn (AGGR_INIT_EXPR_ARG (exp, 0));
- }
- break;
-
- case CALL_EXPR:
- {
- /* Check for a call to a type-conversion operator. */
- tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
- if (is_conversion_operator_function_decl_p (fndecl)
- && call_expr_nargs (exp) == 1)
- return find_spawn (CALL_EXPR_ARG (exp, 0));
- }
- break;
-
- case TARGET_EXPR:
- return find_spawn (TARGET_EXPR_INITIAL (exp));
-
- case CLEANUP_POINT_EXPR:
- case COMPOUND_EXPR:
- case EXPR_STMT:
- return find_spawn (TREE_OPERAND (exp, 0));
-
- default:
- break;
- }
-
- return exp;
-}
-
-/* Return true if *EXP0 is a recognized form of spawn. Recognized forms
- are, after conversion to void, a call expression at outer level or an
- assignment at outer level with the right hand side being a spawned call.
- In addition to this, it also unwraps the CILK_SPAWN_STMT cover from the
- CALL_EXPR that is being spawned.
-
- Note that `=' in C++ may turn into a CALL_EXPR rather than a
- MODIFY_EXPR. */
-
-bool
-cilk_cp_detect_spawn_and_unwrap (tree *exp0)
-{
- tree exp = *exp0;
-
- if (!TREE_SIDE_EFFECTS (exp))
- return false;
-
- /* Strip off any conversion to void. It does not affect whether spawn
- is supported here. */
- if (TREE_CODE (exp) == CONVERT_EXPR && VOID_TYPE_P (TREE_TYPE (exp)))
- exp = TREE_OPERAND (exp, 0);
-
- if (TREE_CODE (exp) == MODIFY_EXPR || TREE_CODE (exp) == INIT_EXPR)
- exp = TREE_OPERAND (exp, 1);
-
- exp = find_spawn (exp);
- if (exp == NULL_TREE)
- return false;
-
- /* Now we should have a CALL_EXPR with a CILK_SPAWN_STMT wrapper around
- it, or return false. */
- return cilk_recognize_spawn (exp, exp0);
-}
-
-/* Callback for cp_walk_tree to validate the body of a pragma simd loop
- or _cilk_for loop.
-
- This function is passed in as a function pointer to walk_tree. *TP is
- the current tree pointer, *WALK_SUBTREES is set to 0 by this function if
- recursing into TP's subtrees is unnecessary. *DATA is a bool variable that
- is set to false if an error has occurred. */
-
-static tree
-cpp_validate_cilk_plus_loop_aux (tree *tp, int *walk_subtrees, void *data)
-{
- bool *valid = (bool *) data;
-
- if (!tp || !*tp)
- return NULL_TREE;
-
- location_t loc = EXPR_LOCATION (*tp);
- if (TREE_CODE (*tp) == THROW_EXPR)
- {
- error_at (loc, "throw expressions are not allowed inside loops "
- "marked with pragma simd");
- *walk_subtrees = 0;
- *valid = false;
- }
- else if (TREE_CODE (*tp) == TRY_BLOCK)
- {
- error_at (loc, "try statements are not allowed inside loops marked "
- "with #pragma simd");
- *valid = false;
- *walk_subtrees = 0;
- }
- return NULL_TREE;
-}
-
-
-/* Walks through all the subtrees of BODY using walk_tree to make sure
- invalid statements/expressions are not found inside BODY. Returns
- false if any invalid statements are found. */
-
-bool
-cpp_validate_cilk_plus_loop (tree body)
-{
- bool valid = true;
- cp_walk_tree (&body, cpp_validate_cilk_plus_loop_aux,
- (void *) &valid, NULL);
- return valid;
-}
-
-/* Sets the EXCEPTION bit (0x10) in the FRAME.flags field. */
-
-static tree
-set_cilk_except_flag (tree frame)
-{
- tree flags = cilk_dot (frame, CILK_TI_FRAME_FLAGS, 0);
-
- flags = build2 (MODIFY_EXPR, void_type_node, flags,
- build2 (BIT_IOR_EXPR, TREE_TYPE (flags), flags,
- build_int_cst (TREE_TYPE (flags),
- CILK_FRAME_EXCEPTING)));
- return flags;
-}
-
-/* Sets the frame.EXCEPT_DATA field to the head of the exception pointer. */
-
-static tree
-set_cilk_except_data (tree frame)
-{
- tree except_data = cilk_dot (frame, CILK_TI_FRAME_EXCEPTION, 0);
- tree uresume_fn = builtin_decl_implicit (BUILT_IN_EH_POINTER);
- tree ret_expr;
- uresume_fn = build_call_expr (uresume_fn, 1,
- build_int_cst (integer_type_node, 0));
- ret_expr = build2 (MODIFY_EXPR, void_type_node, except_data, uresume_fn);
- return ret_expr;
-}
-
-/* Installs BODY into function FNDECL with appropriate exception handling
- code. WD holds information of wrapper function used to pass into the
- outlining function, cilk_outline. */
-
-void
-cilk_install_body_with_frame_cleanup (tree fndecl, tree orig_body, void *wd)
-{
- tree frame = make_cilk_frame (fndecl);
- tree dtor = create_cilk_function_exit (frame, false, false);
- add_local_decl (cfun, frame);
-
- cfun->language = ggc_cleared_alloc<language_function> ();
-
- location_t loc = EXPR_LOCATION (orig_body);
- tree list = alloc_stmt_list ();
- DECL_SAVED_TREE (fndecl) = list;
- tree body = alloc_stmt_list ();
- cilk_outline (fndecl, &orig_body, (struct wrapper_data *) wd);
- append_to_statement_list (orig_body, &body);
- if (flag_exceptions)
- {
- tree except_flag = set_cilk_except_flag (frame);
- tree except_data = set_cilk_except_data (frame);
- tree catch_list = alloc_stmt_list ();
- append_to_statement_list (except_flag, &catch_list);
- append_to_statement_list (except_data, &catch_list);
- body = create_try_catch_expr (body, catch_list);
- }
- append_to_statement_list (build_stmt (loc, TRY_FINALLY_EXPR, body, dtor),
- &list);
-}
diff --git a/gcc/cp/cp-cilkplus.h b/gcc/cp/cp-cilkplus.h
deleted file mode 100644
index bfefc5a7948..00000000000
--- a/gcc/cp/cp-cilkplus.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c.
-
- Copyright (C) 2002-2017 Free Software Foundation, Inc.
- Contributed by Jason Merrill <jason@redhat.com>
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#ifndef GCC_CP_CILKPLUS_H
-#define GCC_CP_CILKPLUS_H
-
-extern bool cilk_cp_detect_spawn_and_unwrap (tree *);
-extern bool cpp_validate_cilk_plus_loop (tree);
-
-#endif /* ! GCC_CP_CILKPLUS_H */
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index f50aff739a2..49fdd05ee24 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -31,8 +31,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-iterator.h"
#include "gimplify.h"
#include "c-family/c-ubsan.h"
-#include "cilk.h"
-#include "cp-cilkplus.h"
#include "stringpool.h"
#include "attribs.h"
#include "asan.h"
@@ -628,14 +626,6 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
LHS of an assignment might also be involved in the RHS, as in bug
25979. */
case INIT_EXPR:
- if (fn_contains_cilk_spawn_p (cfun))
- {
- if (cilk_cp_detect_spawn_and_unwrap (expr_p))
- return (enum gimplify_status) gimplify_cilk_spawn (expr_p);
- if (seen_error () && contains_cilk_spawn_stmt (*expr_p))
- return GS_ERROR;
- }
-
cp_gimplify_init_expr (expr_p);
if (TREE_CODE (*expr_p) != INIT_EXPR)
return GS_OK;
@@ -643,10 +633,6 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
case MODIFY_EXPR:
modify_expr_case:
{
- if (fn_contains_cilk_spawn_p (cfun)
- && cilk_cp_detect_spawn_and_unwrap (expr_p)
- && !seen_error ())
- return (enum gimplify_status) gimplify_cilk_spawn (expr_p);
/* If the back end isn't clever enough to know that the lhs and rhs
types are the same, add an explicit conversion. */
tree op0 = TREE_OPERAND (*expr_p, 0);
@@ -759,19 +745,7 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
}
break;
- case CILK_SPAWN_STMT:
- gcc_assert(fn_contains_cilk_spawn_p (cfun)
- && cilk_cp_detect_spawn_and_unwrap (expr_p));
-
- if (!seen_error ())
- return (enum gimplify_status) gimplify_cilk_spawn (expr_p);
- return GS_ERROR;
-
case CALL_EXPR:
- if (fn_contains_cilk_spawn_p (cfun)
- && cilk_cp_detect_spawn_and_unwrap (expr_p)
- && !seen_error ())
- return (enum gimplify_status) gimplify_cilk_spawn (expr_p);
ret = GS_OK;
if (!CALL_EXPR_FN (*expr_p))
/* Internal function call. */;
@@ -1001,8 +975,7 @@ cp_fold_r (tree *stmt_p, int *walk_subtrees, void *data)
code = TREE_CODE (stmt);
if (code == OMP_FOR || code == OMP_SIMD || code == OMP_DISTRIBUTE
- || code == OMP_TASKLOOP || code == CILK_FOR || code == CILK_SIMD
- || code == OACC_LOOP)
+ || code == OMP_TASKLOOP || code == OACC_LOOP)
{
tree x;
int i, n;
@@ -1682,12 +1655,6 @@ cp_genericize (tree fndecl)
bc_label[bc_break] = NULL_TREE;
bc_label[bc_continue] = NULL_TREE;
- /* Expand all the array notations here. */
- if (flag_cilkplus
- && contains_array_notation_expr (DECL_SAVED_TREE (fndecl)))
- DECL_SAVED_TREE (fndecl)
- = expand_array_notation_exprs (DECL_SAVED_TREE (fndecl));
-
/* We do want to see every occurrence of the parms, so we can't just use
walk_tree's hash functionality. */
cp_genericize_tree (&DECL_SAVED_TREE (fndecl), true);
diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c
index 9a398e0218c..59087df64c9 100644
--- a/gcc/cp/cp-objcp-common.c
+++ b/gcc/cp/cp-objcp-common.c
@@ -468,7 +468,6 @@ cp_common_init_ts (void)
MARK_TS_TYPED (USING_STMT);
MARK_TS_TYPED (LAMBDA_EXPR);
MARK_TS_TYPED (CTOR_INITIALIZER);
- MARK_TS_TYPED (ARRAY_NOTATION_REF);
MARK_TS_TYPED (REQUIRES_EXPR);
MARK_TS_TYPED (UNARY_LEFT_FOLD_EXPR);
MARK_TS_TYPED (UNARY_RIGHT_FOLD_EXPR);
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index cb12c835298..bdfe3fdc497 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -7358,11 +7358,6 @@ extern void vtv_save_class_info (tree);
extern void vtv_recover_class_info (void);
extern void vtv_build_vtable_verify_fndecl (void);
-/* In cp/cp-array-notations.c */
-extern tree expand_array_notation_exprs (tree);
-bool cilkplus_an_triplet_types_ok_p (location_t, tree, tree, tree,
- tree);
-
/* In constexpr.c */
extern void fini_constexpr (void);
extern bool literal_type_p (tree);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 121b4a4f0db..9f557b8d00f 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -48,7 +48,6 @@ along with GCC; see the file COPYING3. If not see
#include "c-family/c-ubsan.h"
#include "debug.h"
#include "plugin.h"
-#include "cilk.h"
#include "builtins.h"
#include "gimplify.h"
#include "asan.h"
@@ -8751,7 +8750,7 @@ grokfndecl (tree ctype,
if (TYPE_NOTHROW_P (type) || nothrow_libfn_p (decl))
TREE_NOTHROW (decl) = 1;
- if (flag_openmp || flag_openmp_simd || flag_cilkplus)
+ if (flag_openmp || flag_openmp_simd)
{
/* Adjust "omp declare simd" attributes. */
tree ods = lookup_attribute ("omp declare simd", *attrlist);
@@ -15468,9 +15467,6 @@ finish_function (bool inline_p)
/* If we're saving up tree structure, tie off the function now. */
DECL_SAVED_TREE (fndecl) = pop_stmt_list (DECL_SAVED_TREE (fndecl));
- if (fn_contains_cilk_spawn_p (cfun) && !processing_template_decl)
- cfun->cilk_frame_decl = insert_cilk_frame (fndecl);
-
finish_fname_decls ();
/* If this function can't throw any exceptions, remember that. */
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index a47822a2d1b..b6a8f9ecef8 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1201,17 +1201,6 @@ dump_decl (cxx_pretty_printer *pp, tree t, int flags)
pp_cxx_right_bracket (pp);
break;
- case ARRAY_NOTATION_REF:
- dump_decl (pp, ARRAY_NOTATION_ARRAY (t), flags | TFF_EXPR_IN_PARENS);
- pp_cxx_left_bracket (pp);
- dump_decl (pp, ARRAY_NOTATION_START (t), flags | TFF_EXPR_IN_PARENS);
- pp_colon (pp);
- dump_decl (pp, ARRAY_NOTATION_LENGTH (t), flags | TFF_EXPR_IN_PARENS);
- pp_colon (pp);
- dump_decl (pp, ARRAY_NOTATION_STRIDE (t), flags | TFF_EXPR_IN_PARENS);
- pp_cxx_right_bracket (pp);
- break;
-
/* So that we can do dump_decl on an aggr type. */
case RECORD_TYPE:
case UNION_TYPE:
@@ -2305,17 +2294,6 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags)
pp_cxx_right_bracket (pp);
break;
- case ARRAY_NOTATION_REF:
- dump_expr (pp, ARRAY_NOTATION_ARRAY (t), flags | TFF_EXPR_IN_PARENS);
- pp_cxx_left_bracket (pp);
- dump_expr (pp, ARRAY_NOTATION_START (t), flags | TFF_EXPR_IN_PARENS);
- pp_colon (pp);
- dump_expr (pp, ARRAY_NOTATION_LENGTH (t), flags | TFF_EXPR_IN_PARENS);
- pp_colon (pp);
- dump_expr (pp, ARRAY_NOTATION_STRIDE (t), flags | TFF_EXPR_IN_PARENS);
- pp_cxx_right_bracket (pp);
- break;
-
case UNARY_PLUS_EXPR:
dump_unary_op (pp, "+", t, flags);
break;
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index 76a839ce730..8b8c1274bc6 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -30,7 +30,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-iterator.h"
#include "toplev.h"
#include "gimplify.h"
-#include "cp-cilkplus.h"
/* Constructor for a lambda expression. */
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index eae73fcab2f..b2de4400727 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -41,7 +41,6 @@ along with GCC; see the file COPYING3. If not see
#include "omp-offload.h"
#include "c-family/c-indentation.h"
#include "context.h"
-#include "cp-cilkplus.h"
#include "gcc-rich-location.h"
#include "tree-iterator.h"
#include "c-family/name-hint.h"
@@ -251,14 +250,8 @@ static cp_token_cache *cp_token_cache_new
static void cp_parser_initial_pragma
(cp_token *);
-static void cp_parser_cilk_simd
- (cp_parser *, cp_token *, bool *);
-static tree cp_parser_cilk_for
- (cp_parser *, tree, bool *);
static bool cp_parser_omp_declare_reduction_exprs
(tree, cp_parser *);
-static tree cp_parser_cilk_simd_vectorlength
- (cp_parser *, tree, bool);
static void cp_finalize_oacc_routine
(cp_parser *, tree, bool);
@@ -557,8 +550,6 @@ cp_debug_parser (FILE *file, cp_parser *parser)
parser->in_statement & IN_SWITCH_STMT);
cp_debug_print_flag (file, "Parsing a structured OpenMP block",
parser->in_statement & IN_OMP_BLOCK);
- cp_debug_print_flag (file, "Parsing a Cilk Plus for loop",
- parser->in_statement & IN_CILK_SIMD_FOR);
cp_debug_print_flag (file, "Parsing a an OpenMP loop",
parser->in_statement & IN_OMP_FOR);
cp_debug_print_flag (file, "Parsing an if statement",
@@ -2265,9 +2256,6 @@ static void cp_parser_ctor_initializer_opt_and_function_body
static tree cp_parser_late_parsing_omp_declare_simd
(cp_parser *, tree);
-static tree cp_parser_late_parsing_cilk_simd_fn_info
- (cp_parser *, tree);
-
static tree cp_parser_late_parsing_oacc_routine
(cp_parser *, tree);
@@ -6619,7 +6607,6 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
cp_id_kind idk = CP_ID_KIND_NONE;
cp_expr postfix_expression = NULL_TREE;
bool is_member_access = false;
- int saved_in_statement = -1;
/* Peek at the next token. */
token = cp_lexer_peek_token (parser->lexer);
@@ -6796,69 +6783,6 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
}
break;
- case RID_CILK_SPAWN:
- {
- location_t cilk_spawn_loc
- = cp_lexer_peek_token (parser->lexer)->location;
- cp_lexer_consume_token (parser->lexer);
- token = cp_lexer_peek_token (parser->lexer);
- if (token->type == CPP_SEMICOLON)
- {
- error_at (token->location, "%<_Cilk_spawn%> must be followed by "
- "an expression");
- postfix_expression = error_mark_node;
- break;
- }
- else if (!current_function_decl)
- {
- error_at (token->location, "%<_Cilk_spawn%> may only be used "
- "inside a function");
- postfix_expression = error_mark_node;
- break;
- }
- else
- {
- /* Consecutive _Cilk_spawns are not allowed in a statement. */
- saved_in_statement = parser->in_statement;
- parser->in_statement |= IN_CILK_SPAWN;
- }
- cfun->calls_cilk_spawn = 1;
- postfix_expression =
- cp_parser_postfix_expression (parser, false, false,
- false, false, &idk);
- if (!flag_cilkplus)
- {
- error_at (token->location, "-fcilkplus must be enabled to use"
- " %<_Cilk_spawn%>");
- cfun->calls_cilk_spawn = 0;
- }
- else if (saved_in_statement & IN_CILK_SPAWN)
- {
- error_at (token->location, "consecutive %<_Cilk_spawn%> keywords "
- "are not permitted");
- postfix_expression = error_mark_node;
- cfun->calls_cilk_spawn = 0;
- }
- else
- {
- location_t loc = postfix_expression.get_location ();
- postfix_expression = build_cilk_spawn (token->location,
- postfix_expression);
- /* Build a location of the form:
- _Cilk_spawn expr
- ~~~~~~~~~~~~^~~~
- with caret at the expr, ranging from the start of the
- _Cilk_spawn token to the end of the expression. */
- location_t combined_loc =
- make_location (loc, cilk_spawn_loc, get_finish (loc));
- postfix_expression.set_location (combined_loc);
- if (postfix_expression != error_mark_node)
- SET_EXPR_LOCATION (postfix_expression, input_location);
- parser->in_statement = parser->in_statement & ~IN_CILK_SPAWN;
- }
- break;
- }
-
case RID_ADDRESSOF:
case RID_BUILTIN_SHUFFLE:
case RID_BUILTIN_LAUNDER:
@@ -7320,92 +7244,6 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
return error_mark_node;
}
-/* This function parses Cilk Plus array notations. If a normal array expr. is
- parsed then the array index is passed back to the caller through *INIT_INDEX
- and the function returns a NULL_TREE. If array notation expr. is parsed,
- then *INIT_INDEX is ignored by the caller and the function returns
- a tree of type ARRAY_NOTATION_REF. If some error occurred it returns
- error_mark_node. */
-
-static tree
-cp_parser_array_notation (location_t loc, cp_parser *parser, tree *init_index,
- tree array_value)
-{
- cp_token *token = NULL;
- tree length_index, stride = NULL_TREE, value_tree, array_type;
- if (!array_value || array_value == error_mark_node)
- {
- cp_parser_skip_to_end_of_statement (parser);
- return error_mark_node;
- }
-
- array_type = TREE_TYPE (array_value);
-
- bool saved_colon_corrects = parser->colon_corrects_to_scope_p;
- parser->colon_corrects_to_scope_p = false;
- token = cp_lexer_peek_token (parser->lexer);
-
- if (!token)
- {
- cp_parser_error (parser, "expected %<:%> or numeral");
- return error_mark_node;
- }
- else if (token->type == CPP_COLON)
- {
- /* Consume the ':'. */
- cp_lexer_consume_token (parser->lexer);
-
- /* If we are here, then we have a case like this A[:]. */
- if (cp_lexer_peek_token (parser->lexer)->type != CPP_CLOSE_SQUARE)
- {
- cp_parser_error (parser, "expected %<]%>");
- cp_parser_skip_to_end_of_statement (parser);
- return error_mark_node;
- }
- *init_index = NULL_TREE;
- stride = NULL_TREE;
- length_index = NULL_TREE;
- }
- else
- {
- /* If we are here, then there are three valid possibilities:
- 1. ARRAY [ EXP ]
- 2. ARRAY [ EXP : EXP ]
- 3. ARRAY [ EXP : EXP : EXP ] */
-
- *init_index = cp_parser_expression (parser);
- if (cp_lexer_peek_token (parser->lexer)->type != CPP_COLON)
- {
- /* This indicates that we have a normal array expression. */
- parser->colon_corrects_to_scope_p = saved_colon_corrects;
- return NULL_TREE;
- }
-
- /* Consume the ':'. */
- cp_lexer_consume_token (parser->lexer);
- length_index = cp_parser_expression (parser);
- if (cp_lexer_peek_token (parser->lexer)->type == CPP_COLON)
- {
- cp_lexer_consume_token (parser->lexer);
- stride = cp_parser_expression (parser);
- }
- }
- parser->colon_corrects_to_scope_p = saved_colon_corrects;
-
- if (*init_index == error_mark_node || length_index == error_mark_node
- || stride == error_mark_node || array_type == error_mark_node)
- {
- if (cp_lexer_peek_token (parser->lexer)->type == CPP_CLOSE_SQUARE)
- cp_lexer_consume_token (parser->lexer);
- return error_mark_node;
- }
- cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE);
-
- value_tree = build_array_notation_ref (loc, array_value, *init_index,
- length_index, stride, array_type);
- return value_tree;
-}
-
/* A subroutine of cp_parser_postfix_expression that also gets hijacked
by cp_parser_builtin_offsetof. We're looking for
@@ -7449,27 +7287,6 @@ cp_parser_postfix_open_square_expression (cp_parser *parser,
cp_lexer_set_source_position (parser->lexer);
maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);
index = cp_parser_braced_list (parser, &expr_nonconst_p);
- if (flag_cilkplus
- && cp_lexer_peek_token (parser->lexer)->type == CPP_COLON)
- {
- error_at (cp_lexer_peek_token (parser->lexer)->location,
- "braced list index is not allowed with array "
- "notation");
- cp_parser_skip_to_end_of_statement (parser);
- return error_mark_node;
- }
- }
- else if (flag_cilkplus)
- {
- /* Here are have these two options:
- ARRAY[EXP : EXP] - Array notation expr with default
- stride of 1.
- ARRAY[EXP : EXP : EXP] - Array Notation with user-defined
- stride. */
- tree an_exp = cp_parser_array_notation (loc, parser, &index,
- postfix_expression);
- if (an_exp)
- return an_exp;
}
else
index = cp_parser_expression (parser);
@@ -10881,18 +10698,6 @@ cp_parser_statement (cp_parser* parser, tree in_statement_expr,
statement = cp_parser_iteration_statement (parser, if_p, false);
break;
- case RID_CILK_FOR:
- if (!flag_cilkplus)
- {
- error_at (cp_lexer_peek_token (parser->lexer)->location,
- "-fcilkplus must be enabled to use %<_Cilk_for%>");
- cp_lexer_consume_token (parser->lexer);
- statement = error_mark_node;
- }
- else
- statement = cp_parser_cilk_for (parser, integer_zero_node, if_p);
- break;
-
case RID_BREAK:
case RID_CONTINUE:
case RID_RETURN:
@@ -10900,24 +10705,6 @@ cp_parser_statement (cp_parser* parser, tree in_statement_expr,
statement = cp_parser_jump_statement (parser);
break;
- case RID_CILK_SYNC:
- cp_lexer_consume_token (parser->lexer);
- if (flag_cilkplus)
- {
- tree sync_expr = build_cilk_sync ();
- SET_EXPR_LOCATION (sync_expr,
- token->location);
- statement = finish_expr_stmt (sync_expr);
- }
- else
- {
- error_at (token->location, "-fcilkplus must be enabled to use"
- " %<_Cilk_sync%>");
- statement = error_mark_node;
- }
- cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
- break;
-
/* Objective-C++ exception-handling constructs. */
case RID_AT_TRY:
case RID_AT_CATCH:
@@ -12433,9 +12220,6 @@ cp_parser_jump_statement (cp_parser* parser)
case IN_OMP_FOR:
error_at (token->location, "break statement used with OpenMP for loop");
break;
- case IN_CILK_SIMD_FOR:
- error_at (token->location, "break statement used with Cilk Plus for loop");
- break;
}
cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
break;
@@ -12446,9 +12230,6 @@ cp_parser_jump_statement (cp_parser* parser)
case 0:
error_at (token->location, "continue statement not within a loop");
break;
- case IN_CILK_SIMD_FOR:
- error_at (token->location,
- "continue statement within %<#pragma simd%> loop body");
/* Fall through. */
case IN_ITERATION_STMT:
case IN_OMP_FOR:
@@ -20072,21 +19853,6 @@ cp_parser_direct_declarator (cp_parser* parser,
the function declaration. For example:
void func (int x) __attribute__((vector(..))); */
tree gnu_attrs = NULL_TREE;
- if (flag_cilkplus
- && cp_next_tokens_can_be_gnu_attribute_p (parser))
- {
- cp_parser_parse_tentatively (parser);
- tree attr = cp_parser_gnu_attributes_opt (parser);
- if (cp_lexer_next_token_is_not (parser->lexer,
- CPP_SEMICOLON)
- && cp_lexer_next_token_is_not (parser->lexer,
- CPP_OPEN_BRACE))
- cp_parser_abort_tentative_parse (parser);
- else if (!cp_parser_parse_definitely (parser))
- ;
- else
- gnu_attrs = attr;
- }
tree requires_clause = NULL_TREE;
late_return = (cp_parser_late_return_type_opt
(parser, declarator, requires_clause,
@@ -20891,9 +20657,6 @@ cp_parser_late_return_type_opt (cp_parser* parser, cp_declarator *declarator,
&& declarator
&& declarator->kind == cdk_id);
- bool cilk_simd_fn_vector_p = (parser->cilk_simd_fn_info
- && declarator && declarator->kind == cdk_id);
-
bool oacc_routine_p = (parser->oacc_routine
&& declarator
&& declarator->kind == cdk_id);
@@ -20905,7 +20668,7 @@ cp_parser_late_return_type_opt (cp_parser* parser, cp_declarator *declarator,
&& token->keyword != RID_REQUIRES
&& !(token->type == CPP_NAME
&& token->u.value == ridpointers[RID_REQUIRES])
- && !(declare_simd_p || cilk_simd_fn_vector_p || oacc_routine_p))
+ && !(declare_simd_p || oacc_routine_p))
return NULL_TREE;
tree save_ccp = current_class_ptr;
@@ -20928,10 +20691,6 @@ cp_parser_late_return_type_opt (cp_parser* parser, cp_declarator *declarator,
requires-clause. */
requires_clause = cp_parser_requires_clause_opt (parser);
- if (cilk_simd_fn_vector_p)
- declarator->attributes
- = cp_parser_late_parsing_cilk_simd_fn_info (parser,
- declarator->attributes);
if (declare_simd_p)
declarator->attributes
= cp_parser_late_parsing_omp_declare_simd (parser,
@@ -24995,57 +24754,6 @@ cp_parser_attributes_opt (cp_parser *parser)
return cp_parser_std_attribute_spec_seq (parser);
}
-#define CILK_SIMD_FN_CLAUSE_MASK \
- ((OMP_CLAUSE_MASK_1 << PRAGMA_CILK_CLAUSE_VECTORLENGTH) \
- | (OMP_CLAUSE_MASK_1 << PRAGMA_CILK_CLAUSE_LINEAR) \
- | (OMP_CLAUSE_MASK_1 << PRAGMA_CILK_CLAUSE_UNIFORM) \
- | (OMP_CLAUSE_MASK_1 << PRAGMA_CILK_CLAUSE_MASK) \
- | (OMP_CLAUSE_MASK_1 << PRAGMA_CILK_CLAUSE_NOMASK))
-
-/* Parses the Cilk Plus SIMD-enabled function's attribute. Syntax:
- vector [(<clauses>)] */
-
-static void
-cp_parser_cilk_simd_fn_vector_attrs (cp_parser *parser, cp_token *v_token)
-{
- bool first_p = parser->cilk_simd_fn_info == NULL;
- cp_token *token = v_token;
- if (first_p)
- {
- parser->cilk_simd_fn_info = XNEW (cp_omp_declare_simd_data);
- parser->cilk_simd_fn_info->error_seen = false;
- parser->cilk_simd_fn_info->fndecl_seen = false;
- parser->cilk_simd_fn_info->tokens = vNULL;
- parser->cilk_simd_fn_info->clauses = NULL_TREE;
- }
- int paren_scope = 0;
- if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_PAREN))
- {
- cp_lexer_consume_token (parser->lexer);
- v_token = cp_lexer_peek_token (parser->lexer);
- paren_scope++;
- }
- while (paren_scope > 0)
- {
- token = cp_lexer_peek_token (parser->lexer);
- if (token->type == CPP_OPEN_PAREN)
- paren_scope++;
- else if (token->type == CPP_CLOSE_PAREN)
- paren_scope--;
- /* Do not push the last ')' */
- if (!(token->type == CPP_CLOSE_PAREN && paren_scope == 0))
- cp_lexer_consume_token (parser->lexer);
- }
-
- token->type = CPP_PRAGMA_EOL;
- parser->lexer->next_token = token;
- cp_lexer_consume_token (parser->lexer);
-
- struct cp_token_cache *cp
- = cp_token_cache_new (v_token, cp_lexer_peek_token (parser->lexer));
- parser->cilk_simd_fn_info->tokens.safe_push (cp);
-}
-
/* Parse an (optional) series of attributes.
attributes:
@@ -25167,16 +24875,10 @@ cp_parser_gnu_attribute_list (cp_parser* parser)
vec<tree, va_gc> *vec;
int attr_flag = (attribute_takes_identifier_p (identifier)
? id_attr : normal_attr);
- if (is_cilkplus_vector_p (identifier))
- {
- cp_parser_cilk_simd_fn_vector_attrs (parser, id_token);
- continue;
- }
- else
- vec = cp_parser_parenthesized_expression_list
- (parser, attr_flag, /*cast_p=*/false,
- /*allow_expansion_p=*/false,
- /*non_constant_p=*/NULL);
+ vec = cp_parser_parenthesized_expression_list
+ (parser, attr_flag, /*cast_p=*/false,
+ /*allow_expansion_p=*/false,
+ /*non_constant_p=*/NULL);
if (vec == NULL)
arguments = error_mark_node;
else
@@ -25187,11 +24889,6 @@ cp_parser_gnu_attribute_list (cp_parser* parser)
/* Save the arguments away. */
TREE_VALUE (attribute) = arguments;
}
- else if (is_cilkplus_vector_p (identifier))
- {
- cp_parser_cilk_simd_fn_vector_attrs (parser, id_token);
- continue;
- }
if (arguments != error_mark_node)
{
@@ -31301,8 +30998,6 @@ cp_parser_omp_clause_name (cp_parser *parser)
result = PRAGMA_OMP_CLAUSE_MAP;
else if (!strcmp ("mergeable", p))
result = PRAGMA_OMP_CLAUSE_MERGEABLE;
- else if (flag_cilkplus && !strcmp ("mask", p))
- result = PRAGMA_CILK_CLAUSE_MASK;
break;
case 'n':
if (!strcmp ("nogroup", p))
@@ -31311,8 +31006,6 @@ cp_parser_omp_clause_name (cp_parser *parser)
result = PRAGMA_OMP_CLAUSE_NOTINBRANCH;
else if (!strcmp ("nowait", p))
result = PRAGMA_OMP_CLAUSE_NOWAIT;
- else if (flag_cilkplus && !strcmp ("nomask", p))
- result = PRAGMA_CILK_CLAUSE_NOMASK;
else if (!strcmp ("num_gangs", p))
result = PRAGMA_OACC_CLAUSE_NUM_GANGS;
else if (!strcmp ("num_tasks", p))
@@ -31399,8 +31092,6 @@ cp_parser_omp_clause_name (cp_parser *parser)
result = PRAGMA_OACC_CLAUSE_VECTOR;
else if (!strcmp ("vector_length", p))
result = PRAGMA_OACC_CLAUSE_VECTOR_LENGTH;
- else if (flag_cilkplus && !strcmp ("vectorlength", p))
- result = PRAGMA_CILK_CLAUSE_VECTORLENGTH;
break;
case 'w':
if (!strcmp ("wait", p))
@@ -33037,7 +32728,7 @@ cp_parser_omp_clause_aligned (cp_parser *parser, tree list)
static tree
cp_parser_omp_clause_linear (cp_parser *parser, tree list,
- bool is_cilk_simd_fn, bool declare_simd)
+ bool declare_simd)
{
tree nlist, c, step = integer_one_node;
bool colon;
@@ -33047,8 +32738,7 @@ cp_parser_omp_clause_linear (cp_parser *parser, tree list,
if (!parens.require_open (parser))
return list;
- if (!is_cilk_simd_fn
- && cp_lexer_next_token_is (parser->lexer, CPP_NAME))
+ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME))
{
tree id = cp_lexer_peek_token (parser->lexer)->u.value;
const char *p = IDENTIFIER_POINTER (id);
@@ -33107,11 +32797,6 @@ cp_parser_omp_clause_linear (cp_parser *parser, tree list,
if (!step)
step = cp_parser_expression (parser);
- if (is_cilk_simd_fn && TREE_CODE (step) == PARM_DECL)
- {
- sorry ("using parameters for %<linear%> step is not supported yet");
- step = integer_one_node;
- }
if (!parens.require_close (parser))
cp_parser_skip_to_closing_parenthesis (parser, /*recovering=*/true,
/*or_comma=*/false,
@@ -33967,13 +33652,11 @@ cp_parser_omp_all_clauses (cp_parser *parser, omp_clause_mask mask,
c_name = "untied";
break;
case PRAGMA_OMP_CLAUSE_INBRANCH:
- case PRAGMA_CILK_CLAUSE_MASK:
clauses = cp_parser_omp_clause_branch (parser, OMP_CLAUSE_INBRANCH,
clauses, token->location);
c_name = "inbranch";
break;
case PRAGMA_OMP_CLAUSE_NOTINBRANCH:
- case PRAGMA_CILK_CLAUSE_NOMASK:
clauses = cp_parser_omp_clause_branch (parser,
OMP_CLAUSE_NOTINBRANCH,
clauses, token->location);
@@ -34049,13 +33732,10 @@ cp_parser_omp_all_clauses (cp_parser *parser, omp_clause_mask mask,
break;
case PRAGMA_OMP_CLAUSE_LINEAR:
{
- bool cilk_simd_fn = false, declare_simd = false;
- if (((mask >> PRAGMA_CILK_CLAUSE_VECTORLENGTH) & 1) != 0)
- cilk_simd_fn = true;
- else if (((mask >> PRAGMA_OMP_CLAUSE_UNIFORM) & 1) != 0)
+ bool declare_simd = false;
+ if (((mask >> PRAGMA_OMP_CLAUSE_UNIFORM) & 1) != 0)
declare_simd = true;
- clauses = cp_parser_omp_clause_linear (parser, clauses,
- cilk_simd_fn, declare_simd);
+ clauses = cp_parser_omp_clause_linear (parser, clauses, declare_simd);
}
c_name = "linear";
break;
@@ -34110,10 +33790,6 @@ cp_parser_omp_all_clauses (cp_parser *parser, omp_clause_mask mask,
clauses, token->location);
c_name = "simd";
break;
- case PRAGMA_CILK_CLAUSE_VECTORLENGTH:
- clauses = cp_parser_cilk_simd_vectorlength (parser, clauses, true);
- c_name = "simdlen";
- break;
default:
cp_parser_error (parser, "expected %<#pragma omp%> clause");
goto saw_error;
@@ -34130,10 +33806,7 @@ cp_parser_omp_all_clauses (cp_parser *parser, omp_clause_mask mask,
}
}
saw_error:
- /* In Cilk Plus SIMD enabled functions there is no pragma_token, so
- no reason to skip to the end. */
- if (!(flag_cilkplus && pragma_tok == NULL))
- cp_parser_skip_to_pragma_eol (parser, pragma_tok);
+ cp_parser_skip_to_pragma_eol (parser, pragma_tok);
if (finish_p)
{
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_UNIFORM)) != 0)
@@ -34692,7 +34365,7 @@ cp_parser_omp_flush (cp_parser *parser, cp_token *pragma_tok)
/* Helper function, to parse omp for increment expression. */
static tree
-cp_parser_omp_for_cond (cp_parser *parser, tree decl, enum tree_code code)
+cp_parser_omp_for_cond (cp_parser *parser, tree decl)
{
tree cond = cp_parser_binary_expression (parser, false, true,
PREC_NOT_OPERATOR, NULL);
@@ -34711,8 +34384,6 @@ cp_parser_omp_for_cond (cp_parser *parser, tree decl, enum tree_code code)
case LE_EXPR:
break;
case NE_EXPR:
- if (code == CILK_SIMD || code == CILK_FOR)
- break;
/* Fall through: OpenMP disallows NE_EXPR. */
gcc_fallthrough ();
default:
@@ -34838,7 +34509,6 @@ cp_parser_omp_for_incr (cp_parser *parser, tree decl)
static tree
cp_parser_omp_for_loop_init (cp_parser *parser,
- enum tree_code code,
tree &this_pre_body,
vec<tree, va_gc> *for_block,
tree &init,
@@ -34901,14 +34571,8 @@ cp_parser_omp_for_loop_init (cp_parser *parser,
{
if (cp_lexer_next_token_is (parser->lexer,
CPP_OPEN_PAREN))
- {
- if (code != CILK_SIMD && code != CILK_FOR)
- error ("parenthesized initialization is not allowed in "
- "OpenMP %<for%> loop");
- else
- error ("parenthesized initialization is "
- "not allowed in for-loop");
- }
+ error ("parenthesized initialization is not allowed in "
+ "OpenMP %<for%> loop");
else
/* Trigger an error. */
cp_parser_require (parser, CPP_EQ, RT_EQ);
@@ -35001,9 +34665,6 @@ cp_parser_omp_for_loop_init (cp_parser *parser,
cp_id_kind idk;
/* If parsing a type specifier sequence failed, then
this MUST be a simple expression. */
- if (code == CILK_FOR)
- error ("%<_Cilk_for%> allows expression instead of declaration only "
- "in C, not in C++");
cp_parser_parse_tentatively (parser);
decl = cp_parser_primary_expression (parser, false, false,
false, &idk);
@@ -35137,20 +34798,12 @@ cp_parser_omp_for_loop (cp_parser *parser, enum tree_code code, tree clauses,
tree add_private_clause = NULL_TREE;
location_t loc;
- if (code != CILK_FOR
- && !cp_lexer_next_token_is_keyword (parser->lexer, RID_FOR))
+ if (!cp_lexer_next_token_is_keyword (parser->lexer, RID_FOR))
{
if (!collapse_err)
cp_parser_error (parser, "for statement expected");
return NULL;
}
- if (code == CILK_FOR
- && !cp_lexer_next_token_is_keyword (parser->lexer, RID_CILK_FOR))
- {
- if (!collapse_err)
- cp_parser_error (parser, "_Cilk_for statement expected");
- return NULL;
- }
loc = cp_lexer_consume_token (parser->lexer)->location;
matching_parens parens;
@@ -35161,8 +34814,7 @@ cp_parser_omp_for_loop (cp_parser *parser, enum tree_code code, tree clauses,
this_pre_body = push_stmt_list ();
add_private_clause
- = cp_parser_omp_for_loop_init (parser, code,
- this_pre_body, for_block,
+ = cp_parser_omp_for_loop_init (parser, this_pre_body, for_block,
init, orig_init, decl, real_decl);
cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
@@ -35266,7 +34918,7 @@ cp_parser_omp_for_loop (cp_parser *parser, enum tree_code code, tree clauses,
cond = NULL;
if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
- cond = cp_parser_omp_for_cond (parser, decl, code);
+ cond = cp_parser_omp_for_cond (parser, decl);
cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
incr = NULL;
@@ -35344,10 +34996,7 @@ cp_parser_omp_for_loop (cp_parser *parser, enum tree_code code, tree clauses,
/* Note that we saved the original contents of this flag when we entered
the structured block, and so we don't need to re-save it here. */
- if (code == CILK_SIMD || code == CILK_FOR)
- parser->in_statement = IN_CILK_SIMD_FOR;
- else
- parser->in_statement = IN_OMP_FOR;
+ parser->in_statement = IN_OMP_FOR;
/* Note that the grammar doesn't call for a structured block here,
though the loop as a whole is a structured block. */
@@ -37272,67 +36921,6 @@ cp_parser_omp_declare_simd (cp_parser *parser, cp_token *pragma_tok,
}
}
-/* Handles the delayed parsing of the Cilk Plus SIMD-enabled function.
- This function is modelled similar to the late parsing of omp declare
- simd. */
-
-static tree
-cp_parser_late_parsing_cilk_simd_fn_info (cp_parser *parser, tree attrs)
-{
- struct cp_token_cache *ce;
- cp_omp_declare_simd_data *info = parser->cilk_simd_fn_info;
- int ii = 0;
-
- if (parser->omp_declare_simd != NULL
- || lookup_attribute ("simd", attrs))
- {
- error ("%<#pragma omp declare simd%> or %<simd%> attribute cannot be "
- "used in the same function marked as a Cilk Plus SIMD-enabled "
- "function");
- parser->cilk_simd_fn_info->tokens.release ();
- XDELETE (parser->cilk_simd_fn_info);
- parser->cilk_simd_fn_info = NULL;
- return attrs;
- }
- if (!info->error_seen && info->fndecl_seen)
- {
- error ("vector attribute not immediately followed by a single function"
- " declaration or definition");
- info->error_seen = true;
- }
- if (info->error_seen)
- return attrs;
-
- FOR_EACH_VEC_ELT (info->tokens, ii, ce)
- {
- tree c, cl;
-
- cp_parser_push_lexer_for_tokens (parser, ce);
- parser->lexer->in_pragma = true;
- cl = cp_parser_omp_all_clauses (parser, CILK_SIMD_FN_CLAUSE_MASK,
- "SIMD-enabled functions attribute",
- NULL);
- cp_parser_pop_lexer (parser);
- if (cl)
- cl = tree_cons (NULL_TREE, cl, NULL_TREE);
-
- c = build_tree_list (get_identifier ("cilk simd function"), NULL_TREE);
- TREE_CHAIN (c) = attrs;
- attrs = c;
-
- c = build_tree_list (get_identifier ("omp declare simd"), cl);
- TREE_CHAIN (c) = attrs;
- if (processing_template_decl)
- ATTR_IS_DEPENDENT (c) = 1;
- attrs = c;
- }
- info->fndecl_seen = true;
- parser->cilk_simd_fn_info->tokens.release ();
- XDELETE (parser->cilk_simd_fn_info);
- parser->cilk_simd_fn_info = NULL;
- return attrs;
-}
-
/* Finalize #pragma omp declare simd clauses after direct declarator has
been parsed, and put that into "omp declare simd" attribute. */
@@ -38720,36 +38308,6 @@ cp_parser_initial_pragma (cp_token *first_token)
cp_lexer_get_preprocessor_token (NULL, first_token);
}
-/* Parses the grainsize pragma for the _Cilk_for statement.
- Syntax:
- #pragma cilk grainsize = <VALUE>. */
-
-static void
-cp_parser_cilk_grainsize (cp_parser *parser, cp_token *pragma_tok, bool *if_p)
-{
- if (cp_parser_require (parser, CPP_EQ, RT_EQ))
- {
- tree exp = cp_parser_binary_expression (parser, false, false,
- PREC_NOT_OPERATOR, NULL);
- cp_parser_skip_to_pragma_eol (parser, pragma_tok);
- if (!exp || exp == error_mark_node)
- {
- error_at (pragma_tok->location, "invalid grainsize for _Cilk_for");
- return;
- }
-
- /* Make sure the next token is _Cilk_for, it is invalid otherwise. */
- if (cp_lexer_next_token_is_keyword (parser->lexer, RID_CILK_FOR))
- cp_parser_cilk_for (parser, exp, if_p);
- else
- warning_at (cp_lexer_peek_token (parser->lexer)->location, 0,
- "%<#pragma cilk grainsize%> is not followed by "
- "%<_Cilk_for%>");
- return;
- }
- cp_parser_skip_to_pragma_eol (parser, pragma_tok);
-}
-
/* Normal parsing of a pragma token. Here we can (and must) use the
regular lexer. */
@@ -39005,39 +38563,6 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p)
return true;
}
- case PRAGMA_CILK_SIMD:
- if (context == pragma_external)
- {
- error_at (pragma_tok->location,
- "%<#pragma simd%> must be inside a function");
- break;
- }
- stmt = push_omp_privatization_clauses (false);
- cp_parser_cilk_simd (parser, pragma_tok, if_p);
- pop_omp_privatization_clauses (stmt);
- return true;
-
- case PRAGMA_CILK_GRAINSIZE:
- if (context == pragma_external)
- {
- error_at (pragma_tok->location,
- "%<#pragma cilk grainsize%> must be inside a function");
- break;
- }
-
- /* Ignore the pragma if Cilk Plus is not enabled. */
- if (flag_cilkplus)
- {
- cp_parser_cilk_grainsize (parser, pragma_tok, if_p);
- return true;
- }
- else
- {
- error_at (pragma_tok->location, "-fcilkplus must be enabled to use "
- "%<#pragma cilk grainsize%>");
- break;
- }
-
default:
gcc_assert (id >= PRAGMA_FIRST_EXTERNAL);
c_invoke_pragma_handler (id);
@@ -39100,314 +38625,6 @@ c_parse_file (void)
the_parser = NULL;
}
-/* Parses the Cilk Plus #pragma simd and SIMD-enabled function attribute's
- vectorlength clause:
- Syntax:
- vectorlength ( constant-expression ) */
-
-static tree
-cp_parser_cilk_simd_vectorlength (cp_parser *parser, tree clauses,
- bool is_simd_fn)
-{
- location_t loc = cp_lexer_peek_token (parser->lexer)->location;
- tree expr;
- /* The vectorlength clause in #pragma simd behaves exactly like OpenMP's
- safelen clause. Thus, vectorlength is represented as OMP 4.0
- safelen. For SIMD-enabled function it is represented by OMP 4.0
- simdlen. */
- if (!is_simd_fn)
- check_no_duplicate_clause (clauses, OMP_CLAUSE_SAFELEN, "vectorlength",
- loc);
- else
- check_no_duplicate_clause (clauses, OMP_CLAUSE_SIMDLEN, "vectorlength",
- loc);
-
- matching_parens parens;
- if (!parens.require_open (parser))
- return error_mark_node;
-
- expr = cp_parser_constant_expression (parser);
- expr = maybe_constant_value (expr);
-
- /* If expr == error_mark_node, then don't emit any errors nor
- create a clause. if any of the above functions returns
- error mark node then they would have emitted an error message. */
- if (expr == error_mark_node)
- ;
- else if (!TREE_TYPE (expr)
- || !TREE_CONSTANT (expr)
- || !INTEGRAL_TYPE_P (TREE_TYPE (expr)))
- error_at (loc, "vectorlength must be an integer constant");
- else if (TREE_CONSTANT (expr)
- && !pow2p_hwi (TREE_INT_CST_LOW (expr)))
- error_at (loc, "vectorlength must be a power of 2");
- else
- {
- tree c;
- if (!is_simd_fn)
- {
- c = build_omp_clause (loc, OMP_CLAUSE_SAFELEN);
- OMP_CLAUSE_SAFELEN_EXPR (c) = expr;
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- else
- {
- c = build_omp_clause (loc, OMP_CLAUSE_SIMDLEN);
- OMP_CLAUSE_SIMDLEN_EXPR (c) = expr;
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- }
-
- if (!parens.require_close (parser))
- return error_mark_node;
- return clauses;
-}
-
-/* Handles the Cilk Plus #pragma simd linear clause.
- Syntax:
- linear ( simd-linear-variable-list )
-
- simd-linear-variable-list:
- simd-linear-variable
- simd-linear-variable-list , simd-linear-variable
-
- simd-linear-variable:
- id-expression
- id-expression : simd-linear-step
-
- simd-linear-step:
- conditional-expression */
-
-static tree
-cp_parser_cilk_simd_linear (cp_parser *parser, tree clauses)
-{
- location_t loc = cp_lexer_peek_token (parser->lexer)->location;
-
- if (!cp_parser_require (parser, CPP_OPEN_PAREN, RT_OPEN_PAREN))
- return clauses;
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_NAME))
- {
- cp_parser_error (parser, "expected identifier");
- cp_parser_skip_to_closing_parenthesis (parser, false, false, true);
- return error_mark_node;
- }
-
- bool saved_colon_corrects_to_scope_p = parser->colon_corrects_to_scope_p;
- parser->colon_corrects_to_scope_p = false;
- while (1)
- {
- cp_token *token = cp_lexer_peek_token (parser->lexer);
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_NAME))
- {
- cp_parser_error (parser, "expected variable-name");
- clauses = error_mark_node;
- break;
- }
-
- tree var_name = cp_parser_id_expression (parser, false, true, NULL,
- false, false);
- tree decl = cp_parser_lookup_name_simple (parser, var_name,
- token->location);
- if (decl == error_mark_node)
- {
- cp_parser_name_lookup_error (parser, var_name, decl, NLE_NULL,
- token->location);
- clauses = error_mark_node;
- }
- else
- {
- tree e = NULL_TREE;
- tree step_size = integer_one_node;
-
- /* If present, parse the linear step. Otherwise, assume the default
- value of 1. */
- if (cp_lexer_peek_token (parser->lexer)->type == CPP_COLON)
- {
- cp_lexer_consume_token (parser->lexer);
-
- e = cp_parser_assignment_expression (parser);
- e = maybe_constant_value (e);
-
- if (e == error_mark_node)
- {
- /* If an error has occurred, then the whole pragma is
- considered ill-formed. Thus, no reason to keep
- parsing. */
- clauses = error_mark_node;
- break;
- }
- else if (type_dependent_expression_p (e)
- || value_dependent_expression_p (e)
- || (TREE_TYPE (e)
- && INTEGRAL_TYPE_P (TREE_TYPE (e))
- && (TREE_CONSTANT (e)
- || DECL_P (e))))
- step_size = e;
- else
- cp_parser_error (parser,
- "step size must be an integer constant "
- "expression or an integer variable");
- }
-
- /* Use the OMP_CLAUSE_LINEAR, which has the same semantics. */
- tree l = build_omp_clause (loc, OMP_CLAUSE_LINEAR);
- OMP_CLAUSE_DECL (l) = decl;
- OMP_CLAUSE_LINEAR_STEP (l) = step_size;
- OMP_CLAUSE_CHAIN (l) = clauses;
- clauses = l;
- }
- if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA))
- cp_lexer_consume_token (parser->lexer);
- else if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_PAREN))
- break;
- else
- {
- error_at (cp_lexer_peek_token (parser->lexer)->location,
- "expected %<,%> or %<)%> after %qE", decl);
- clauses = error_mark_node;
- break;
- }
- }
- parser->colon_corrects_to_scope_p = saved_colon_corrects_to_scope_p;
- cp_parser_skip_to_closing_parenthesis (parser, false, false, true);
- return clauses;
-}
-
-/* Returns the name of the next clause. If the clause is not
- recognized, then PRAGMA_CILK_CLAUSE_NONE is returned and the next
- token is not consumed. Otherwise, the appropriate enum from the
- pragma_simd_clause is returned and the token is consumed. */
-
-static pragma_omp_clause
-cp_parser_cilk_simd_clause_name (cp_parser *parser)
-{
- pragma_omp_clause clause_type;
- cp_token *token = cp_lexer_peek_token (parser->lexer);
-
- if (token->keyword == RID_PRIVATE)
- clause_type = PRAGMA_CILK_CLAUSE_PRIVATE;
- else if (!token->u.value || token->type != CPP_NAME)
- return PRAGMA_CILK_CLAUSE_NONE;
- else if (id_equal (token->u.value, "vectorlength"))
- clause_type = PRAGMA_CILK_CLAUSE_VECTORLENGTH;
- else if (id_equal (token->u.value, "linear"))
- clause_type = PRAGMA_CILK_CLAUSE_LINEAR;
- else if (id_equal (token->u.value, "firstprivate"))
- clause_type = PRAGMA_CILK_CLAUSE_FIRSTPRIVATE;
- else if (id_equal (token->u.value, "lastprivate"))
- clause_type = PRAGMA_CILK_CLAUSE_LASTPRIVATE;
- else if (id_equal (token->u.value, "reduction"))
- clause_type = PRAGMA_CILK_CLAUSE_REDUCTION;
- else
- return PRAGMA_CILK_CLAUSE_NONE;
-
- cp_lexer_consume_token (parser->lexer);
- return clause_type;
-}
-
-/* Parses all the #pragma simd clauses. Returns a list of clauses found. */
-
-static tree
-cp_parser_cilk_simd_all_clauses (cp_parser *parser, cp_token *pragma_token)
-{
- tree clauses = NULL_TREE;
-
- while (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL)
- && clauses != error_mark_node)
- {
- pragma_omp_clause c_kind;
- c_kind = cp_parser_cilk_simd_clause_name (parser);
- if (c_kind == PRAGMA_CILK_CLAUSE_VECTORLENGTH)
- clauses = cp_parser_cilk_simd_vectorlength (parser, clauses, false);
- else if (c_kind == PRAGMA_CILK_CLAUSE_LINEAR)
- clauses = cp_parser_cilk_simd_linear (parser, clauses);
- else if (c_kind == PRAGMA_CILK_CLAUSE_PRIVATE)
- /* Use the OpenMP 4.0 equivalent function. */
- clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_PRIVATE, clauses);
- else if (c_kind == PRAGMA_CILK_CLAUSE_FIRSTPRIVATE)
- /* Use the OpenMP 4.0 equivalent function. */
- clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_FIRSTPRIVATE,
- clauses);
- else if (c_kind == PRAGMA_CILK_CLAUSE_LASTPRIVATE)
- /* Use the OMP 4.0 equivalent function. */
- clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_LASTPRIVATE,
- clauses);
- else if (c_kind == PRAGMA_CILK_CLAUSE_REDUCTION)
- /* Use the OMP 4.0 equivalent function. */
- clauses = cp_parser_omp_clause_reduction (parser, clauses);
- else
- {
- clauses = error_mark_node;
- cp_parser_error (parser, "expected %<#pragma simd%> clause");
- break;
- }
- }
-
- cp_parser_skip_to_pragma_eol (parser, pragma_token);
-
- if (clauses == error_mark_node)
- return error_mark_node;
- else
- return finish_omp_clauses (clauses, C_ORT_CILK);
-}
-
-/* Main entry-point for parsing Cilk Plus <#pragma simd> for loops. */
-
-static void
-cp_parser_cilk_simd (cp_parser *parser, cp_token *pragma_token, bool *if_p)
-{
- tree clauses = cp_parser_cilk_simd_all_clauses (parser, pragma_token);
-
- if (clauses == error_mark_node)
- return;
-
- if (cp_lexer_next_token_is_not_keyword (parser->lexer, RID_FOR))
- {
- error_at (cp_lexer_peek_token (parser->lexer)->location,
- "for statement expected");
- return;
- }
-
- tree sb = begin_omp_structured_block ();
- int save = cp_parser_begin_omp_structured_block (parser);
- tree ret = cp_parser_omp_for_loop (parser, CILK_SIMD, clauses, NULL, if_p);
- if (ret)
- cpp_validate_cilk_plus_loop (OMP_FOR_BODY (ret));
- cp_parser_end_omp_structured_block (parser, save);
- add_stmt (finish_omp_structured_block (sb));
-}
-
-/* Main entry-point for parsing Cilk Plus _Cilk_for
- loops. The return value is error_mark_node
- when errors happen and CILK_FOR tree on success. */
-
-static tree
-cp_parser_cilk_for (cp_parser *parser, tree grain, bool *if_p)
-{
- if (cp_lexer_next_token_is_not_keyword (parser->lexer, RID_CILK_FOR))
- gcc_unreachable ();
-
- tree sb = begin_omp_structured_block ();
- int save = cp_parser_begin_omp_structured_block (parser);
-
- tree clauses = build_omp_clause (EXPR_LOCATION (grain), OMP_CLAUSE_SCHEDULE);
- OMP_CLAUSE_SCHEDULE_KIND (clauses) = OMP_CLAUSE_SCHEDULE_CILKFOR;
- OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clauses) = grain;
- clauses = finish_omp_clauses (clauses, C_ORT_CILK);
-
- tree ret = cp_parser_omp_for_loop (parser, CILK_FOR, clauses, NULL, if_p);
- if (ret)
- cpp_validate_cilk_plus_loop (ret);
- else
- ret = error_mark_node;
-
- cp_parser_end_omp_structured_block (parser, save);
- add_stmt (finish_omp_structured_block (sb));
- return ret;
-}
-
/* Create an identifier for a generic parameter type (a synthesized
template parameter implied by `auto' or a concept identifier). */
diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h
index f4f4a010964..872842a6565 100644
--- a/gcc/cp/parser.h
+++ b/gcc/cp/parser.h
@@ -309,8 +309,6 @@ struct GTY(()) cp_parser {
#define IN_OMP_BLOCK 4
#define IN_OMP_FOR 8
#define IN_IF_STMT 16
-#define IN_CILK_SIMD_FOR 32
-#define IN_CILK_SPAWN 64
unsigned char in_statement;
/* TRUE if we are presently parsing the body of a switch statement.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f85e6237af1..706e3a972f6 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -10135,7 +10135,7 @@ tsubst_attribute (tree t, tree *decl_p, tree args,
tree val = TREE_VALUE (t);
if (val == NULL_TREE)
/* Nothing to do. */;
- else if ((flag_openmp || flag_openmp_simd || flag_cilkplus)
+ else if ((flag_openmp || flag_openmp_simd)
&& is_attribute_p ("omp declare simd",
get_attribute_name (t)))
{
@@ -16418,8 +16418,6 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
case OMP_FOR:
case OMP_SIMD:
- case CILK_SIMD:
- case CILK_FOR:
case OMP_DISTRIBUTE:
case OMP_TASKLOOP:
case OACC_LOOP:
@@ -16431,9 +16429,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
enum c_omp_region_type ort = C_ORT_OMP;
int i;
- if (TREE_CODE (t) == CILK_SIMD || TREE_CODE (t) == CILK_FOR)
- ort = C_ORT_CILK;
- else if (TREE_CODE (t) == OACC_LOOP)
+ if (TREE_CODE (t) == OACC_LOOP)
ort = C_ORT_ACC;
r = push_omp_privatization_clauses (OMP_FOR_INIT (t) == NULL_TREE);
@@ -16712,13 +16708,6 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
error ("use %<...%> to expand argument pack");
RETURN (error_mark_node);
- case CILK_SPAWN_STMT:
- cfun->calls_cilk_spawn = 1;
- RETURN (build_cilk_spawn (EXPR_LOCATION (t), RECUR (CILK_SPAWN_FN (t))));
-
- case CILK_SYNC_STMT:
- RETURN (build_cilk_sync ());
-
case COMPOUND_EXPR:
tmp = RECUR (TREE_OPERAND (t, 0));
if (tmp == NULL_TREE)
@@ -17312,17 +17301,6 @@ tsubst_copy_and_build (tree t,
RECUR (TREE_OPERAND (t, 1)),
complain|decltype_flag));
- case ARRAY_NOTATION_REF:
- {
- tree start_index, length, stride;
- op1 = tsubst_non_call_postfix_expression (ARRAY_NOTATION_ARRAY (t),
- args, complain, in_decl);
- start_index = RECUR (ARRAY_NOTATION_START (t));
- length = RECUR (ARRAY_NOTATION_LENGTH (t));
- stride = RECUR (ARRAY_NOTATION_STRIDE (t));
- RETURN (build_array_notation_ref (EXPR_LOCATION (t), op1, start_index,
- length, stride, TREE_TYPE (op1)));
- }
case SIZEOF_EXPR:
if (PACK_EXPANSION_P (TREE_OPERAND (t, 0))
|| ARGUMENT_PACK_P (TREE_OPERAND (t, 0)))
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index c316ad29409..141921dcc61 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -614,10 +614,6 @@ finish_goto_stmt (tree destination)
TREE_USED (destination) = 1;
else
{
- if (check_no_cilk (destination,
- "Cilk array notation cannot be used as a computed goto expression",
- "%<_Cilk_spawn%> statement cannot be used as a computed goto expression"))
- destination = error_mark_node;
destination = mark_rvalue_use (destination);
if (!processing_template_decl)
{
@@ -804,10 +800,6 @@ begin_while_stmt (void)
void
finish_while_stmt_cond (tree cond, tree while_stmt, bool ivdep)
{
- if (check_no_cilk (cond,
- "Cilk array notation cannot be used as a condition for while statement",
- "%<_Cilk_spawn%> statement cannot be used as a condition for while statement"))
- cond = error_mark_node;
cond = maybe_convert_cond (cond);
finish_cond (&WHILE_COND (while_stmt), cond);
begin_maybe_infinite_loop (cond);
@@ -864,10 +856,6 @@ finish_do_body (tree do_stmt)
void
finish_do_stmt (tree cond, tree do_stmt, bool ivdep)
{
- if (check_no_cilk (cond,
- "Cilk array notation cannot be used as a condition for a do-while statement",
- "%<_Cilk_spawn%> statement cannot be used as a condition for a do-while statement"))
- cond = error_mark_node;
cond = maybe_convert_cond (cond);
end_maybe_infinite_loop (cond);
if (ivdep && cond != error_mark_node)
@@ -984,10 +972,6 @@ finish_init_stmt (tree for_stmt)
void
finish_for_cond (tree cond, tree for_stmt, bool ivdep)
{
- if (check_no_cilk (cond,
- "Cilk array notation cannot be used in a condition for a for-loop",
- "%<_Cilk_spawn%> statement cannot be used in a condition for a for-loop"))
- cond = error_mark_node;
cond = maybe_convert_cond (cond);
finish_cond (&FOR_COND (for_stmt), cond);
begin_maybe_infinite_loop (cond);
@@ -1152,11 +1136,6 @@ finish_switch_cond (tree cond, tree switch_stmt)
{
tree orig_type = NULL;
- if (check_no_cilk (cond,
- "Cilk array notation cannot be used as a condition for switch statement",
- "%<_Cilk_spawn%> statement cannot be used as a condition for switch statement"))
- cond = error_mark_node;
-
if (!processing_template_decl)
{
/* Convert the condition to an integer or enumeration type. */
@@ -4080,8 +4059,6 @@ simplify_aggr_init_expr (tree *tp)
= CALL_EXPR_OPERATOR_SYNTAX (aggr_init_expr);
CALL_EXPR_ORDERED_ARGS (call_expr) = CALL_EXPR_ORDERED_ARGS (aggr_init_expr);
CALL_EXPR_REVERSE_ARGS (call_expr) = CALL_EXPR_REVERSE_ARGS (aggr_init_expr);
- /* Preserve CILK_SPAWN flag. */
- EXPR_CILK_SPAWN (call_expr) = EXPR_CILK_SPAWN (aggr_init_expr);
if (style == ctor)
{
@@ -5910,20 +5887,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
}
if (TREE_CODE (type) == REFERENCE_TYPE)
type = TREE_TYPE (type);
- if (ort == C_ORT_CILK)
- {
- if (!INTEGRAL_TYPE_P (type)
- && !SCALAR_FLOAT_TYPE_P (type)
- && TREE_CODE (type) != POINTER_TYPE)
- {
- error ("linear clause applied to non-integral, "
- "non-floating, non-pointer variable with %qT type",
- TREE_TYPE (t));
- remove = true;
- break;
- }
- }
- else if (OMP_CLAUSE_LINEAR_KIND (c) != OMP_CLAUSE_LINEAR_REF)
+ if (OMP_CLAUSE_LINEAR_KIND (c) != OMP_CLAUSE_LINEAR_REF)
{
if (!INTEGRAL_TYPE_P (type)
&& TREE_CODE (type) != POINTER_TYPE)
@@ -6347,8 +6311,6 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
else if (t == error_mark_node)
remove = true;
else if (!type_dependent_expression_p (t)
- && (OMP_CLAUSE_SCHEDULE_KIND (c)
- != OMP_CLAUSE_SCHEDULE_CILKFOR)
&& !INTEGRAL_TYPE_P (TREE_TYPE (t)))
{
error ("schedule chunk size expression must be integral");
@@ -6359,27 +6321,14 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
t = mark_rvalue_use (t);
if (!processing_template_decl)
{
- if (OMP_CLAUSE_SCHEDULE_KIND (c)
- == OMP_CLAUSE_SCHEDULE_CILKFOR)
- {
- t = convert_to_integer (long_integer_type_node, t);
- if (t == error_mark_node)
- {
- remove = true;
- break;
- }
- }
- else
- {
- t = maybe_constant_value (t);
- if (TREE_CODE (t) == INTEGER_CST
- && tree_int_cst_sgn (t) != 1)
- {
- warning_at (OMP_CLAUSE_LOCATION (c), 0,
- "chunk size value must be positive");
- t = integer_one_node;
- }
- }
+ t = maybe_constant_value (t);
+ if (TREE_CODE (t) == INTEGER_CST
+ && tree_int_cst_sgn (t) != 1)
+ {
+ warning_at (OMP_CLAUSE_LOCATION (c), 0,
+ "chunk size value must be positive");
+ t = integer_one_node;
+ }
t = fold_build_cleanup_point_expr (TREE_TYPE (t), t);
}
OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (c) = t;
@@ -7076,7 +7025,6 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
case OMP_CLAUSE_THREADS:
case OMP_CLAUSE_SIMD:
case OMP_CLAUSE_DEFAULTMAP:
- case OMP_CLAUSE__CILK_FOR_COUNT_:
case OMP_CLAUSE_AUTO:
case OMP_CLAUSE_INDEPENDENT:
case OMP_CLAUSE_SEQ:
@@ -7998,7 +7946,7 @@ finish_omp_for (location_t locus, enum tree_code code, tree declv,
tree body, tree pre_body, vec<tree> *orig_inits, tree clauses)
{
tree omp_for = NULL, orig_incr = NULL;
- tree decl = NULL, init, cond, incr, orig_decl = NULL_TREE, block = NULL_TREE;
+ tree decl = NULL, init, cond, incr;
tree last = NULL_TREE;
location_t elocus;
int i;
@@ -8164,8 +8112,6 @@ finish_omp_for (location_t locus, enum tree_code code, tree declv,
"iteration variable %qE", decl);
return NULL;
}
- if (code == CILK_FOR && i == 0)
- orig_decl = decl;
if (handle_omp_for_class_iterator (i, locus, code, declv, orig_declv,
initv, condv, incrv, &body,
&pre_body, clauses, &last,
@@ -8223,9 +8169,6 @@ finish_omp_for (location_t locus, enum tree_code code, tree declv,
if (IS_EMPTY_STMT (pre_body))
pre_body = NULL;
- if (code == CILK_FOR && !processing_template_decl)
- block = push_stmt_list ();
-
omp_for = c_finish_omp_for (locus, code, declv, orig_declv, initv, condv,
incrv, body, pre_body);
@@ -8235,8 +8178,6 @@ finish_omp_for (location_t locus, enum tree_code code, tree declv,
if (omp_for == NULL)
{
- if (block)
- pop_stmt_list (block);
return NULL;
}
@@ -8338,115 +8279,6 @@ finish_omp_for (location_t locus, enum tree_code code, tree declv,
}
}
- if (block)
- {
- tree omp_par = make_node (OMP_PARALLEL);
- TREE_TYPE (omp_par) = void_type_node;
- OMP_PARALLEL_CLAUSES (omp_par) = NULL_TREE;
- tree bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
- TREE_SIDE_EFFECTS (bind) = 1;
- BIND_EXPR_BODY (bind) = pop_stmt_list (block);
- OMP_PARALLEL_BODY (omp_par) = bind;
- if (OMP_FOR_PRE_BODY (omp_for))
- {
- add_stmt (OMP_FOR_PRE_BODY (omp_for));
- OMP_FOR_PRE_BODY (omp_for) = NULL_TREE;
- }
- init = TREE_VEC_ELT (OMP_FOR_INIT (omp_for), 0);
- decl = TREE_OPERAND (init, 0);
- cond = TREE_VEC_ELT (OMP_FOR_COND (omp_for), 0);
- incr = TREE_VEC_ELT (OMP_FOR_INCR (omp_for), 0);
- tree t = TREE_OPERAND (cond, 1), c, clauses, *pc;
- clauses = OMP_FOR_CLAUSES (omp_for);
- OMP_FOR_CLAUSES (omp_for) = NULL_TREE;
- for (pc = &clauses; *pc; )
- if (OMP_CLAUSE_CODE (*pc) == OMP_CLAUSE_SCHEDULE)
- {
- gcc_assert (OMP_FOR_CLAUSES (omp_for) == NULL_TREE);
- OMP_FOR_CLAUSES (omp_for) = *pc;
- *pc = OMP_CLAUSE_CHAIN (*pc);
- OMP_CLAUSE_CHAIN (OMP_FOR_CLAUSES (omp_for)) = NULL_TREE;
- }
- else
- {
- gcc_assert (OMP_CLAUSE_CODE (*pc) == OMP_CLAUSE_FIRSTPRIVATE);
- pc = &OMP_CLAUSE_CHAIN (*pc);
- }
- if (TREE_CODE (t) != INTEGER_CST)
- {
- TREE_OPERAND (cond, 1) = get_temp_regvar (TREE_TYPE (t), t);
- c = build_omp_clause (input_location, OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = TREE_OPERAND (cond, 1);
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- if (TREE_CODE (incr) == MODIFY_EXPR)
- {
- t = TREE_OPERAND (TREE_OPERAND (incr, 1), 1);
- if (TREE_CODE (t) != INTEGER_CST)
- {
- TREE_OPERAND (TREE_OPERAND (incr, 1), 1)
- = get_temp_regvar (TREE_TYPE (t), t);
- c = build_omp_clause (input_location, OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = TREE_OPERAND (TREE_OPERAND (incr, 1), 1);
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- }
- t = TREE_OPERAND (init, 1);
- if (TREE_CODE (t) != INTEGER_CST)
- {
- TREE_OPERAND (init, 1) = get_temp_regvar (TREE_TYPE (t), t);
- c = build_omp_clause (input_location, OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = TREE_OPERAND (init, 1);
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- if (orig_decl && orig_decl != decl)
- {
- c = build_omp_clause (input_location, OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = orig_decl;
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- if (last)
- {
- c = build_omp_clause (input_location, OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = last;
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- c = build_omp_clause (input_location, OMP_CLAUSE_PRIVATE);
- OMP_CLAUSE_DECL (c) = decl;
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- c = build_omp_clause (input_location, OMP_CLAUSE__CILK_FOR_COUNT_);
- OMP_CLAUSE_OPERAND (c, 0)
- = cilk_for_number_of_iterations (omp_for);
- OMP_CLAUSE_CHAIN (c) = clauses;
- OMP_PARALLEL_CLAUSES (omp_par) = finish_omp_clauses (c, C_ORT_CILK);
- add_stmt (omp_par);
- return omp_par;
- }
- else if (code == CILK_FOR && processing_template_decl)
- {
- tree c, clauses = OMP_FOR_CLAUSES (omp_for);
- if (orig_decl && orig_decl != decl)
- {
- c = build_omp_clause (input_location, OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = orig_decl;
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- if (last)
- {
- c = build_omp_clause (input_location, OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = last;
- OMP_CLAUSE_CHAIN (c) = clauses;
- clauses = c;
- }
- OMP_FOR_CLAUSES (omp_for) = clauses;
- }
return omp_for;
}
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 245657866df..c76dea46479 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -165,7 +165,6 @@ lvalue_kind (const_tree ref)
case INDIRECT_REF:
case ARROW_EXPR:
case ARRAY_REF:
- case ARRAY_NOTATION_REF:
case PARM_DECL:
case RESULT_DECL:
case PLACEHOLDER_EXPR:
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 8ba6a124aa9..8454719118e 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -3196,22 +3196,6 @@ cp_build_array_ref (location_t loc, tree array, tree idx,
return error_mark_node;
}
- /* If an array's index is an array notation, then its rank cannot be
- greater than one. */
- if (flag_cilkplus && contains_array_notation_expr (idx))
- {
- size_t rank = 0;
-
- /* If find_rank returns false, then it should have reported an error,
- thus it is unnecessary for repetition. */
- if (!find_rank (loc, idx, idx, true, &rank))
- return error_mark_node;
- if (rank > 1)
- {
- error_at (loc, "rank of the array%'s index is greater than 1");
- return error_mark_node;
- }
- }
if (TREE_TYPE (array) == error_mark_node
|| TREE_TYPE (idx) == error_mark_node)
return error_mark_node;
@@ -6640,17 +6624,6 @@ cp_build_compound_expr (tree lhs, tree rhs, tsubst_flags_t complain)
if (lhs == error_mark_node || rhs == error_mark_node)
return error_mark_node;
- if (flag_cilkplus
- && (TREE_CODE (lhs) == CILK_SPAWN_STMT
- || TREE_CODE (rhs) == CILK_SPAWN_STMT))
- {
- location_t loc = (EXPR_HAS_LOCATION (lhs) ? EXPR_LOCATION (lhs)
- : EXPR_LOCATION (rhs));
- error_at (loc,
- "spawned function call cannot be part of a comma expression");
- return error_mark_node;
- }
-
if (TREE_CODE (rhs) == TARGET_EXPR)
{
/* If the rhs is a TARGET_EXPR, then build the compound
@@ -8983,13 +8956,6 @@ check_return_expr (tree retval, bool *no_warning)
*no_warning = false;
- if (flag_cilkplus && retval && contains_cilk_spawn_stmt (retval))
- {
- error_at (EXPR_LOCATION (retval), "use of %<_Cilk_spawn%> in a return "
- "statement is not allowed");
- return NULL_TREE;
- }
-
/* A `volatile' function is one that isn't supposed to return, ever.
(This is a G++ extension, used to get better code for functions
that call the `volatile' function.) */
diff --git a/gcc/cppbuiltin.c b/gcc/cppbuiltin.c
index 720e231da5c..bc20eb62543 100644
--- a/gcc/cppbuiltin.c
+++ b/gcc/cppbuiltin.c
@@ -110,8 +110,6 @@ define_builtin_macros_for_compilation_flags (cpp_reader *pfile)
cpp_define_formatted (pfile, "__FINITE_MATH_ONLY__=%d",
flag_finite_math_only);
- if (flag_cilkplus)
- cpp_define (pfile, "__cilk=200");
if (flag_check_pointer_bounds)
cpp_define (pfile, "__CHKP__");
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 9349f95d0da..30f89b09699 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -85,7 +85,6 @@ extensions, accepted by GCC in C90 mode and in C++.
* Object Size Checking:: Built-in functions for limited buffer overflow
checking.
* Pointer Bounds Checker builtins:: Built-in functions for Pointer Bounds Checker.
-* Cilk Plus Builtins:: Built-in functions for the Cilk Plus language extension.
* Other Builtins:: Other built-in functions.
* Target Builtins:: Built-in functions specific to particular targets.
* Target Format Checks:: Format checks specific to particular targets.
@@ -3295,9 +3294,6 @@ The optional argument @var{mask} may have the value
and instructs the compiler to generate non-masked or masked
clones correspondingly. By default, all clones are generated.
-The attribute should not be used together with Cilk Plus @code{vector}
-attribute on the same function.
-
If the attribute is specified and @code{#pragma omp declare simd} is
present on a declaration and the @option{-fopenmp} or @option{-fopenmp-simd}
switch is specified, then the attribute is ignored.
@@ -10935,32 +10931,6 @@ the built-in function returns -1.
@end deftypefn
-@node Cilk Plus Builtins
-@section Cilk Plus C/C++ Language Extension Built-in Functions
-
-GCC provides support for the following built-in reduction functions if Cilk Plus
-is enabled. Cilk Plus can be enabled using the @option{-fcilkplus} flag.
-
-@itemize @bullet
-@item @code{__sec_implicit_index}
-@item @code{__sec_reduce}
-@item @code{__sec_reduce_add}
-@item @code{__sec_reduce_all_nonzero}
-@item @code{__sec_reduce_all_zero}
-@item @code{__sec_reduce_any_nonzero}
-@item @code{__sec_reduce_any_zero}
-@item @code{__sec_reduce_max}
-@item @code{__sec_reduce_min}
-@item @code{__sec_reduce_max_ind}
-@item @code{__sec_reduce_min_ind}
-@item @code{__sec_reduce_mul}
-@item @code{__sec_reduce_mutating}
-@end itemize
-
-Further details and examples about these built-in functions are described
-in the Cilk Plus language manual which can be found at
-@uref{https://www.cilkplus.org}.
-
@node Other Builtins
@section Other Built-in Functions Provided by GCC
@cindex built-in functions
diff --git a/gcc/doc/generic.texi b/gcc/doc/generic.texi
index 1a37615dcc0..17f38df3d4c 100644
--- a/gcc/doc/generic.texi
+++ b/gcc/doc/generic.texi
@@ -3234,30 +3234,6 @@ several statements chained together.
Used to represent a @code{break} statement. There are no additional
fields.
-@item CILK_SPAWN_STMT
-
-Used to represent a spawning function in the Cilk Plus language extension.
-This tree has one field that holds the name of the spawning function.
-@code{_Cilk_spawn} can be written in C in the following way:
-
-@smallexample
-@code{_Cilk_spawn} <function_name> (<parameters>);
-@end smallexample
-
-Detailed description for usage and functionality of @code{_Cilk_spawn} can be
-found at @uref{https://www.cilkplus.org}.
-
-@item CILK_SYNC_STMT
-
-This statement is part of the Cilk Plus language extension. It indicates that
-the current function cannot continue in parallel with its spawned children.
-There are no additional fields. @code{_Cilk_sync} can be written in C in the
-following way:
-
-@smallexample
-@code{_Cilk_sync};
-@end smallexample
-
@item CLEANUP_STMT
Used to represent an action that should take place upon exit from the
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 02a0c1e6d49..2de3db1fbc3 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -2098,18 +2098,6 @@ Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
are ignored.
-@item -fcilkplus
-@opindex fcilkplus
-@cindex Enable Cilk Plus
-Enable the usage of Cilk Plus language extension features for C/C++.
-When the option @option{-fcilkplus} is specified, enable the usage of
-the Cilk Plus Language extension features for C/C++. The present
-implementation follows ABI version 1.2. This is an experimental
-feature that is only partially complete, and whose interface may
-change in future versions of GCC as the official specification
-changes. Currently, all features but @code{_Cilk_for} have been
-implemented.
-
@item -fgnu-tm
@opindex fgnu-tm
When the option @option{-fgnu-tm} is specified, the compiler
diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi
index 2bf786c2568..ef3c35cc268 100644
--- a/gcc/doc/passes.texi
+++ b/gcc/doc/passes.texi
@@ -18,7 +18,6 @@ where near complete.
@menu
* Parsing pass:: The language front end turns text into bits.
-* Cilk Plus Transformation:: Transform Cilk Plus Code to equivalent C/C++.
* Gimplification pass:: The bits are turned into something we can optimize.
* Pass manager:: Sequencing the optimization passes.
* Tree SSA passes:: Optimizations on a high-level representation.
@@ -104,68 +103,6 @@ that is more descriptive than "rest_of".
The middle-end will, at its option, emit the function and data
definitions immediately or queue them for later processing.
-@node Cilk Plus Transformation
-@section Cilk Plus Transformation
-@cindex CILK_PLUS
-
-If Cilk Plus generation (flag @option{-fcilkplus}) is enabled, all the Cilk
-Plus code is transformed into equivalent C and C++ functions. Majority of this
-transformation occurs toward the end of the parsing and right before the
-gimplification pass.
-
-These are the major components to the Cilk Plus language extension:
-@itemize @bullet
-@item Array Notations:
-During parsing phase, all the array notation specific information is stored in
-@code{ARRAY_NOTATION_REF} tree using the function
-@code{c_parser_array_notation}. During the end of parsing, we check the entire
-function to see if there are any array notation specific code (using the
-function @code{contains_array_notation_expr}). If this function returns
-true, then we expand them using either @code{expand_array_notation_exprs} or
-@code{build_array_notation_expr}. For the cases where array notations are
-inside conditions, they are transformed using the function
-@code{fix_conditional_array_notations}. The C language-specific routines are
-located in @file{c/c-array-notation.c} and the equivalent C++ routines are in
-the file @file{cp/cp-array-notation.c}. Common routines such as functions to
-initialize built-in functions are stored in @file{array-notation-common.c}.
-
-@item Cilk keywords:
-@itemize @bullet
-@item @code{_Cilk_spawn}:
-The @code{_Cilk_spawn} keyword is parsed and the function it contains is marked
-as a spawning function. The spawning function is called the spawner. At
-the end of the parsing phase, appropriate built-in functions are
-added to the spawner that are defined in the Cilk runtime. The appropriate
-locations of these functions, and the internal structures are detailed in
-@code{cilk_init_builtins} in the file @file{cilk-common.c}. The pointers to
-Cilk functions and fields of internal structures are described
-in @file{cilk.h}. The built-in functions are described in
-@file{cilk-builtins.def}.
-
-During gimplification, a new "spawn-helper" function is created.
-The spawned function is replaced with a spawn helper function in the spawner.
-The spawned function-call is moved into the spawn helper. The main function
-that does these transformations is @code{gimplify_cilk_spawn} in
-@file{c-family/cilk.c}. In the spawn-helper, the gimplification function
-@code{gimplify_call_expr}, inserts a function call @code{__cilkrts_detach}.
-This function is expanded by @code{builtin_expand_cilk_detach} located in
-@file{c-family/cilk.c}.
-
-@item @code{_Cilk_sync}:
-@code{_Cilk_sync} is parsed like a keyword. During gimplification,
-the function @code{gimplify_cilk_sync} in @file{c-family/cilk.c}, will replace
-this keyword with a set of functions that are stored in the Cilk runtime.
-One of the internal functions inserted during gimplification,
-@code{__cilkrts_pop_frame} must be expanded by the compiler and is
-done by @code{builtin_expand_cilk_pop_frame} in @file{cilk-common.c}.
-
-@end itemize
-@end itemize
-
-Documentation about Cilk Plus and language specification is provided under the
-"Learn" section in @w{@uref{https://www.cilkplus.org}}. It is worth mentioning
-that the current implementation follows ABI 1.1.
-
@node Gimplification pass
@section Gimplification pass
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 7daca45b491..60b6b77abc6 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2116,9 +2116,6 @@ Target supports wide characters.
@item automatic_stack_alignment
Target supports automatic stack alignment.
-@item cilkplus_runtime
-Target supports the Cilk Plus runtime library.
-
@item cxa_atexit
Target uses @code{__cxa_atexit}.
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 43e6d590c25..f70755679f4 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1041,7 +1041,6 @@ proper position among the other output files. */
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o " CHKP_SPEC " \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
%:include(libgomp.spec)%(link_gomp)}\
- %{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
%(mflib) " STACK_SPLIT_SPEC "\
%{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
@@ -1216,15 +1215,9 @@ static const char *const multilib_defaults_raw[] = MULTILIB_DEFAULTS;
#define GTM_SELF_SPECS "%{fgnu-tm: -pthread}"
#endif
-/* Likewise for -fcilkplus. */
-#ifndef CILK_SELF_SPECS
-#define CILK_SELF_SPECS "%{fcilkplus: -pthread}"
-#endif
-
static const char *const driver_self_specs[] = {
"%{fdump-final-insns:-fdump-final-insns=.} %<fdump-final-insns",
- DRIVER_SELF_SPECS, CONFIGURE_SPECS, GOMP_SELF_SPECS, GTM_SELF_SPECS,
- CILK_SELF_SPECS
+ DRIVER_SELF_SPECS, CONFIGURE_SPECS, GOMP_SELF_SPECS, GTM_SELF_SPECS
};
#ifndef OPTION_DEFAULT_SPECS
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index ad2be72e3a6..aeca2628ec1 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -1710,7 +1710,7 @@ open_base_files (void)
"backend.h", "predict.h", "tree.h",
"rtl.h", "gimple.h", "fold-const.h", "insn-codes.h", "splay-tree.h",
"alias.h", "insn-config.h", "flags.h", "expmed.h", "dojump.h",
- "explow.h", "calls.h", "cilk.h", "memmodel.h", "emit-rtl.h", "varasm.h",
+ "explow.h", "calls.h", "memmodel.h", "emit-rtl.h", "varasm.h",
"stmt.h", "expr.h", "alloc-pool.h", "cselib.h", "insn-addr.h",
"optabs.h", "libfuncs.h", "debug.h", "internal-fn.h", "gimple-fold.h",
"tree-eh.h", "gimple-iterator.h", "gimple-ssa.h", "tree-cfg.h",
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 8bcc4e31bfb..e952f337812 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -1389,18 +1389,12 @@ dump_gimple_omp_for (pretty_printer *buffer, gomp_for *gs, int spc,
case GF_OMP_FOR_KIND_TASKLOOP:
kind = " taskloop";
break;
- case GF_OMP_FOR_KIND_CILKFOR:
- kind = " _Cilk_for";
- break;
case GF_OMP_FOR_KIND_OACC_LOOP:
kind = " oacc_loop";
break;
case GF_OMP_FOR_KIND_SIMD:
kind = " simd";
break;
- case GF_OMP_FOR_KIND_CILKSIMD:
- kind = " cilksimd";
- break;
default:
gcc_unreachable ();
}
@@ -1432,36 +1426,25 @@ dump_gimple_omp_for (pretty_printer *buffer, gomp_for *gs, int spc,
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:
pp_string (buffer, "#pragma acc loop");
break;
case GF_OMP_FOR_KIND_SIMD:
pp_string (buffer, "#pragma omp simd");
break;
- case GF_OMP_FOR_KIND_CILKSIMD:
- pp_string (buffer, "#pragma simd");
- break;
case GF_OMP_FOR_KIND_GRID_LOOP:
pp_string (buffer, "#pragma omp for grid_loop");
break;
default:
gcc_unreachable ();
}
- if (gimple_omp_for_kind (gs) != GF_OMP_FOR_KIND_CILKFOR)
- dump_omp_clauses (buffer, gimple_omp_for_clauses (gs), spc, flags);
+ dump_omp_clauses (buffer, gimple_omp_for_clauses (gs), spc, flags);
for (i = 0; i < gimple_omp_for_collapse (gs); i++)
{
if (i)
spc += 2;
- if (gimple_omp_for_kind (gs) == GF_OMP_FOR_KIND_CILKFOR)
- pp_string (buffer, "_Cilk_for (");
- else
- {
- newline_and_indent (buffer, spc);
- pp_string (buffer, "for (");
- }
+ newline_and_indent (buffer, spc);
+ pp_string (buffer, "for (");
dump_generic_node (buffer, gimple_omp_for_index (gs, i), spc,
flags, false);
pp_string (buffer, " = ");
@@ -1507,8 +1490,6 @@ dump_gimple_omp_for (pretty_printer *buffer, gomp_for *gs, int spc,
if (!gimple_seq_empty_p (gimple_omp_body (gs)))
{
- if (gimple_omp_for_kind (gs) == GF_OMP_FOR_KIND_CILKFOR)
- dump_omp_clauses (buffer, gimple_omp_for_clauses (gs), spc, flags);
newline_and_indent (buffer, spc + 2);
pp_left_brace (buffer);
pp_newline (buffer);
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 334def89398..0fcdd05aaba 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -156,13 +156,11 @@ enum gf_mask {
GF_OMP_FOR_KIND_FOR = 0,
GF_OMP_FOR_KIND_DISTRIBUTE = 1,
GF_OMP_FOR_KIND_TASKLOOP = 2,
- GF_OMP_FOR_KIND_CILKFOR = 3,
GF_OMP_FOR_KIND_OACC_LOOP = 4,
GF_OMP_FOR_KIND_GRID_LOOP = 5,
/* Flag for SIMD variants of OMP_FOR kinds. */
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 << 4,
GF_OMP_FOR_COMBINED_INTO = 1 << 5,
/* The following flag must not be used on GF_OMP_FOR_KIND_GRID_LOOP loop
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 8769505b313..2c2abd76c08 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -56,7 +56,6 @@ along with GCC; see the file COPYING3. If not see
#include "omp-general.h"
#include "omp-low.h"
#include "gimple-low.h"
-#include "cilk.h"
#include "gomp-constants.h"
#include "splay-tree.h"
#include "gimple-walk.h"
@@ -1458,15 +1457,6 @@ gimplify_return_expr (tree stmt, gimple_seq *pre_p)
if (ret_expr == error_mark_node)
return GS_ERROR;
- /* Implicit _Cilk_sync must be inserted right before any return statement
- if there is a _Cilk_spawn in the function. If the user has provided a
- _Cilk_sync, the optimizer should remove this duplicate one. */
- if (fn_contains_cilk_spawn_p (cfun))
- {
- tree impl_sync = build0 (CILK_SYNC_STMT, void_type_node);
- gimplify_and_add (impl_sync, pre_p);
- }
-
if (!ret_expr
|| TREE_CODE (ret_expr) == RESULT_DECL
|| ret_expr == error_mark_node)
@@ -3098,19 +3088,6 @@ maybe_fold_stmt (gimple_stmt_iterator *gsi)
return fold_stmt (gsi);
}
-/* Add a gimple call to __builtin_cilk_detach to GIMPLE sequence PRE_P,
- with the pointer to the proper cilk frame. */
-static void
-gimplify_cilk_detach (gimple_seq *pre_p)
-{
- tree frame = cfun->cilk_frame_decl;
- tree ptrf = build1 (ADDR_EXPR, cilk_frame_ptr_type_decl,
- frame);
- gcall *detach = gimple_build_call (cilk_detach_fndecl, 1,
- ptrf);
- gimplify_seq_add_stmt(pre_p, detach);
-}
-
/* Gimplify the CALL_EXPR node *EXPR_P into the GIMPLE sequence PRE_P.
WANT_VALUE is true if the result of the call is desired. */
@@ -3148,8 +3125,6 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
vargs.quick_push (CALL_EXPR_ARG (*expr_p, i));
}
- if (EXPR_CILK_SPAWN (*expr_p))
- gimplify_cilk_detach (pre_p);
gcall *call = gimple_build_call_internal_vec (ifn, vargs);
gimple_call_set_nothrow (call, TREE_NOTHROW (*expr_p));
gimplify_seq_add_stmt (pre_p, call);
@@ -3380,8 +3355,6 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
gimple_stmt_iterator gsi;
call = gimple_build_call_from_tree (*expr_p, fnptrtype);
notice_special_calls (call);
- if (EXPR_CILK_SPAWN (*expr_p))
- gimplify_cilk_detach (pre_p);
gimplify_seq_add_stmt (pre_p, call);
gsi = gsi_last (*pre_p);
maybe_fold_stmt (&gsi);
@@ -5340,7 +5313,6 @@ is_gimple_stmt (tree t)
case OMP_PARALLEL:
case OMP_FOR:
case OMP_SIMD:
- case CILK_SIMD:
case OMP_DISTRIBUTE:
case OACC_LOOP:
case OMP_SECTIONS:
@@ -5673,8 +5645,6 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
??? This doesn't make it a default-def. */
SSA_NAME_DEF_STMT (*to_p) = gimple_build_nop ();
- if (EXPR_CILK_SPAWN (*from_p))
- gimplify_cilk_detach (pre_p);
assign = call_stmt;
}
else
@@ -8422,7 +8392,6 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
case OMP_CLAUSE_GRAINSIZE:
case OMP_CLAUSE_NUM_TASKS:
case OMP_CLAUSE_HINT:
- case OMP_CLAUSE__CILK_FOR_COUNT_:
case OMP_CLAUSE_ASYNC:
case OMP_CLAUSE_WAIT:
case OMP_CLAUSE_NUM_GANGS:
@@ -9225,7 +9194,6 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, gimple_seq body, tree *list_p,
case OMP_CLAUSE_DEFAULTMAP:
case OMP_CLAUSE_USE_DEVICE_PTR:
case OMP_CLAUSE_IS_DEVICE_PTR:
- case OMP_CLAUSE__CILK_FOR_COUNT_:
case OMP_CLAUSE_ASYNC:
case OMP_CLAUSE_WAIT:
case OMP_CLAUSE_INDEPENDENT:
@@ -9520,7 +9488,6 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
switch (TREE_CODE (for_stmt))
{
case OMP_FOR:
- case CILK_FOR:
case OMP_DISTRIBUTE:
break;
case OACC_LOOP:
@@ -9533,7 +9500,6 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
ort = ORT_TASK;
break;
case OMP_SIMD:
- case CILK_SIMD:
ort = ORT_SIMD;
break;
default:
@@ -10208,8 +10174,6 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
{
case OMP_FOR: kind = GF_OMP_FOR_KIND_FOR; break;
case OMP_SIMD: kind = GF_OMP_FOR_KIND_SIMD; break;
- case CILK_SIMD: kind = GF_OMP_FOR_KIND_CILKSIMD; break;
- case CILK_FOR: kind = GF_OMP_FOR_KIND_CILKFOR; break;
case OMP_DISTRIBUTE: kind = GF_OMP_FOR_KIND_DISTRIBUTE; break;
case OMP_TASKLOOP: kind = GF_OMP_FOR_KIND_TASKLOOP; break;
case OACC_LOOP: kind = GF_OMP_FOR_KIND_OACC_LOOP; break;
@@ -11805,8 +11769,6 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
case OMP_FOR:
case OMP_SIMD:
- case CILK_SIMD:
- case CILK_FOR:
case OMP_DISTRIBUTE:
case OMP_TASKLOOP:
case OACC_LOOP:
@@ -11994,22 +11956,6 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
break;
}
- case CILK_SYNC_STMT:
- {
- if (!fn_contains_cilk_spawn_p (cfun))
- {
- error_at (EXPR_LOCATION (*expr_p),
- "expected %<_Cilk_spawn%> before %<_Cilk_sync%>");
- ret = GS_ERROR;
- }
- else
- {
- gimplify_cilk_sync (expr_p, pre_p);
- ret = GS_ALL_DONE;
- }
- break;
- }
-
default:
switch (TREE_CODE_CLASS (TREE_CODE (*expr_p)))
{
diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c
index 4b5cd70ea85..9fb195a6973 100644
--- a/gcc/ipa-fnsummary.c
+++ b/gcc/ipa-fnsummary.c
@@ -79,7 +79,6 @@ along with GCC; see the file COPYING3. If not see
#include "cfgloop.h"
#include "tree-scalar-evolution.h"
#include "ipa-utils.h"
-#include "cilk.h"
#include "cfgexpand.h"
#include "gimplify.h"
#include "stringpool.h"
@@ -891,8 +890,6 @@ ipa_dump_fn_summary (FILE *f, struct cgraph_node *node)
fprintf (f, " always_inline");
if (s->inlinable)
fprintf (f, " inlinable");
- if (s->contains_cilk_spawn)
- fprintf (f, " contains_cilk_spawn");
if (s->fp_expressions)
fprintf (f, " fp_expression");
fprintf (f, "\n global time: %f\n", s->time.to_double ());
@@ -2439,8 +2436,6 @@ compute_fn_summary (struct cgraph_node *node, bool early)
else
info->inlinable = tree_inlinable_function_p (node->decl);
- info->contains_cilk_spawn = fn_contains_cilk_spawn_p (cfun);
-
/* Type attributes can use parameter indices to describe them. */
if (TYPE_ATTRIBUTES (TREE_TYPE (node->decl)))
node->local.can_change_signature = false;
@@ -3263,7 +3258,6 @@ inline_read_section (struct lto_file_decl_data *file_data, const char *data,
bp = streamer_read_bitpack (&ib);
info->inlinable = bp_unpack_value (&bp, 1);
- info->contains_cilk_spawn = bp_unpack_value (&bp, 1);
info->fp_expressions = bp_unpack_value (&bp, 1);
count2 = streamer_read_uhwi (&ib);
@@ -3417,7 +3411,7 @@ ipa_fn_summary_write (void)
info->time.stream_out (ob);
bp = bitpack_create (ob->main_stream);
bp_pack_value (&bp, info->inlinable, 1);
- bp_pack_value (&bp, info->contains_cilk_spawn, 1);
+ bp_pack_value (&bp, false, 1);
bp_pack_value (&bp, info->fp_expressions, 1);
streamer_write_bitpack (&bp);
streamer_write_uhwi (ob, vec_safe_length (info->conds));
diff --git a/gcc/ipa-fnsummary.h b/gcc/ipa-fnsummary.h
index b345bbc4fd7..ecf1d6012c5 100644
--- a/gcc/ipa-fnsummary.h
+++ b/gcc/ipa-fnsummary.h
@@ -98,9 +98,6 @@ struct GTY(()) ipa_fn_summary
/* False when there something makes inlining impossible (such as va_arg). */
unsigned inlinable : 1;
- /* True when function contains cilk spawn (and thus we can not inline
- into it). */
- unsigned contains_cilk_spawn : 1;
/* True wen there is only one caller of the function before small function
inlining. */
unsigned int single_caller : 1;
@@ -145,7 +142,7 @@ struct GTY(()) ipa_fn_summary
This is useful for debugging. */
ipa_fn_summary ()
: estimated_self_stack_size (0), self_size (0), min_size (0),
- inlinable (false), contains_cilk_spawn (false), single_caller (false),
+ inlinable (false), single_caller (false),
fp_expressions (false), estimated_stack_size (false),
stack_frame_offset (false), time (0), size (0), conds (NULL),
size_time_table (NULL), loop_iterations (NULL), loop_stride (NULL),
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 54a441f142d..2acfe2a7460 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -47,7 +47,6 @@ along with GCC; see the file COPYING3. If not see
#include "cfgloop.h"
#include "tree-scalar-evolution.h"
#include "ipa-utils.h"
-#include "cilk.h"
#include "cfgexpand.h"
#include "gimplify.h"
diff --git a/gcc/ira.c b/gcc/ira.c
index 8c93d3df518..a9ed17ea308 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -2286,9 +2286,6 @@ ira_setup_eliminable_regset (void)
&& cfun->can_throw_non_call_exceptions)
|| crtl->accesses_prior_frames
|| (SUPPORTS_STACK_ALIGNMENT && crtl->stack_realign_needed)
- /* We need a frame pointer for all Cilk Plus functions that use
- Cilk keywords. */
- || (flag_cilkplus && cfun->is_cilk_function)
|| targetm.frame_pointer_required ());
/* The chance that FRAME_POINTER_NEEDED is changed from inspecting
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 841362a91e2..372d2dba86c 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -282,7 +282,6 @@ merge_and_complain (struct cl_decoded_option **decoded_options,
case OPT_fopenmp:
case OPT_fopenacc:
- case OPT_fcilkplus:
case OPT_fcheck_pointer_bounds:
/* For selected options we can merge conservatively. */
for (j = 0; j < *decoded_options_count; ++j)
@@ -292,7 +291,6 @@ merge_and_complain (struct cl_decoded_option **decoded_options,
append_option (decoded_options, decoded_options_count, foption);
/* -fopenmp > -fno-openmp,
-fopenacc > -fno-openacc,
- -fcilkplus > -fno-cilkplus,
-fcheck_pointer_bounds > -fcheck_pointer_bounds */
else if (foption->value > (*decoded_options)[j].value)
(*decoded_options)[j] = *foption;
@@ -549,7 +547,6 @@ append_compiler_options (obstack *argv_obstack, struct cl_decoded_option *opts,
case OPT_fopenmp:
case OPT_fopenacc:
case OPT_fopenacc_dim_:
- case OPT_fcilkplus:
case OPT_foffload_abi_:
case OPT_O:
case OPT_Ofast:
@@ -626,7 +623,6 @@ append_linker_options (obstack *argv_obstack, struct cl_decoded_option *opts,
case OPT_fopenmp:
case OPT_fopenacc:
- case OPT_fcilkplus:
/* Ignore -fno-XXX form of these options, as otherwise
corresponding builtins will not be enabled. */
if (option->value == 0)
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 88f29705e65..c2ba3dc50c4 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -34,7 +34,6 @@ along with GCC; see the file COPYING3. If not see
#include "debug.h"
#include "lto-tree.h"
#include "lto.h"
-#include "cilk.h"
#include "stringpool.h"
#include "attribs.h"
@@ -1262,9 +1261,6 @@ lto_init (void)
va_list_type_node);
}
- if (flag_cilkplus)
- cilk_init_builtins ();
-
targetm.init_builtins ();
build_common_builtin_nodes ();
diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
index 46d0bea6d42..4aadc6f4170 100644
--- a/gcc/omp-expand.c
+++ b/gcc/omp-expand.c
@@ -53,7 +53,6 @@ along with GCC; see the file COPYING3. If not see
#include "omp-offload.h"
#include "tree-cfgcleanup.h"
#include "symbol-summary.h"
-#include "cilk.h"
#include "gomp-constants.h"
#include "gimple-pretty-print.h"
#include "hsa-common.h"
@@ -728,45 +727,6 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
}
}
-/* Insert a function call whose name is FUNC_NAME with the information from
- ENTRY_STMT into the basic_block BB. */
-
-static void
-expand_cilk_for_call (basic_block bb, gomp_parallel *entry_stmt,
- vec <tree, va_gc> *ws_args)
-{
- tree t, t1, t2;
- gimple_stmt_iterator gsi;
- vec <tree, va_gc> *args;
-
- gcc_assert (vec_safe_length (ws_args) == 2);
- tree func_name = (*ws_args)[0];
- tree grain = (*ws_args)[1];
-
- tree clauses = gimple_omp_parallel_clauses (entry_stmt);
- tree count = omp_find_clause (clauses, OMP_CLAUSE__CILK_FOR_COUNT_);
- gcc_assert (count != NULL_TREE);
- count = OMP_CLAUSE_OPERAND (count, 0);
-
- gsi = gsi_last_bb (bb);
- t = gimple_omp_parallel_data_arg (entry_stmt);
- if (t == NULL)
- t1 = null_pointer_node;
- else
- t1 = build_fold_addr_expr (t);
- t2 = build_fold_addr_expr (gimple_omp_parallel_child_fn (entry_stmt));
-
- vec_alloc (args, 4);
- args->quick_push (t2);
- args->quick_push (t1);
- args->quick_push (count);
- args->quick_push (grain);
- t = build_call_expr_loc_vec (UNKNOWN_LOCATION, func_name, args);
-
- force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, false,
- GSI_CONTINUE_LINKING);
-}
-
/* Build the function call to GOMP_task to actually
generate the task operation. BB is the block where to insert the code. */
@@ -1161,18 +1121,7 @@ expand_omp_taskreg (struct omp_region *region)
else
exit_bb = region->exit;
- bool is_cilk_for
- = (flag_cilkplus
- && gimple_code (entry_stmt) == GIMPLE_OMP_PARALLEL
- && omp_find_clause (gimple_omp_parallel_clauses (entry_stmt),
- OMP_CLAUSE__CILK_FOR_COUNT_) != NULL_TREE);
-
- if (is_cilk_for)
- /* If it is a _Cilk_for statement, it is modelled *like* a parallel for,
- and the inner statement contains the name of the built-in function
- and grain. */
- ws_args = region->inner->ws_args;
- else if (is_combined_parallel (region))
+ if (is_combined_parallel (region))
ws_args = region->ws_args;
else
ws_args = NULL;
@@ -1430,11 +1379,7 @@ expand_omp_taskreg (struct omp_region *region)
}
}
- /* Emit a library call to launch the children threads. */
- if (is_cilk_for)
- expand_cilk_for_call (new_bb,
- as_a <gomp_parallel *> (entry_stmt), ws_args);
- else if (gimple_code (entry_stmt) == GIMPLE_OMP_PARALLEL)
+ if (gimple_code (entry_stmt) == GIMPLE_OMP_PARALLEL)
expand_parallel_call (region, new_bb,
as_a <gomp_parallel *> (entry_stmt), ws_args);
else
@@ -4342,193 +4287,6 @@ expand_omp_for_static_chunk (struct omp_region *region,
}
}
-/* A subroutine of expand_omp_for. Generate code for _Cilk_for loop.
- Given parameters:
- for (V = N1; V cond N2; V += STEP) BODY;
-
- where COND is "<" or ">" or "!=", we generate pseudocode
-
- for (ind_var = low; ind_var < high; ind_var++)
- {
- V = n1 + (ind_var * STEP)
-
- <BODY>
- }
-
- In the above pseudocode, low and high are function parameters of the
- child function. In the function below, we are inserting a temp.
- variable that will be making a call to two OMP functions that will not be
- found in the body of _Cilk_for (since OMP_FOR cannot be mixed
- with _Cilk_for). These functions are replaced with low and high
- by the function that handles taskreg. */
-
-
-static void
-expand_cilk_for (struct omp_region *region, struct omp_for_data *fd)
-{
- bool broken_loop = region->cont == NULL;
- basic_block entry_bb = region->entry;
- basic_block cont_bb = region->cont;
-
- gcc_assert (EDGE_COUNT (entry_bb->succs) == 2);
- gcc_assert (broken_loop
- || BRANCH_EDGE (entry_bb)->dest == FALLTHRU_EDGE (cont_bb)->dest);
- basic_block l0_bb = FALLTHRU_EDGE (entry_bb)->dest;
- basic_block l1_bb, l2_bb;
-
- if (!broken_loop)
- {
- gcc_assert (BRANCH_EDGE (cont_bb)->dest == l0_bb);
- gcc_assert (EDGE_COUNT (cont_bb->succs) == 2);
- l1_bb = split_block (cont_bb, last_stmt (cont_bb))->dest;
- l2_bb = BRANCH_EDGE (entry_bb)->dest;
- }
- else
- {
- BRANCH_EDGE (entry_bb)->flags &= ~EDGE_ABNORMAL;
- l1_bb = split_edge (BRANCH_EDGE (entry_bb));
- l2_bb = single_succ (l1_bb);
- }
- basic_block exit_bb = region->exit;
- basic_block l2_dom_bb = NULL;
-
- gimple_stmt_iterator gsi = gsi_last_bb (entry_bb);
-
- /* Below statements until the "tree high_val = ..." are pseudo statements
- used to pass information to be used by expand_omp_taskreg.
- low_val and high_val will be replaced by the __low and __high
- parameter from the child function.
-
- The call_exprs part is a place-holder, it is mainly used
- to distinctly identify to the top-level part that this is
- where we should put low and high (reasoning given in header
- comment). */
-
- gomp_parallel *par_stmt
- = as_a <gomp_parallel *> (last_stmt (region->outer->entry));
- tree child_fndecl = gimple_omp_parallel_child_fn (par_stmt);
- tree t, low_val = NULL_TREE, high_val = NULL_TREE;
- for (t = DECL_ARGUMENTS (child_fndecl); t; t = TREE_CHAIN (t))
- {
- if (id_equal (DECL_NAME (t), "__high"))
- high_val = t;
- else if (id_equal (DECL_NAME (t), "__low"))
- low_val = t;
- }
- gcc_assert (low_val && high_val);
-
- tree type = TREE_TYPE (low_val);
- tree ind_var = create_tmp_reg (type, "__cilk_ind_var");
- gcc_assert (gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_FOR);
-
- /* Not needed in SSA form right now. */
- gcc_assert (!gimple_in_ssa_p (cfun));
- if (l2_dom_bb == NULL)
- l2_dom_bb = l1_bb;
-
- tree n1 = low_val;
- tree n2 = high_val;
-
- gimple *stmt = gimple_build_assign (ind_var, n1);
-
- /* Replace the GIMPLE_OMP_FOR statement. */
- gsi_replace (&gsi, stmt, true);
-
- if (!broken_loop)
- {
- /* Code to control the increment goes in the CONT_BB. */
- gsi = gsi_last_bb (cont_bb);
- stmt = gsi_stmt (gsi);
- gcc_assert (gimple_code (stmt) == GIMPLE_OMP_CONTINUE);
- stmt = gimple_build_assign (ind_var, PLUS_EXPR, ind_var,
- build_one_cst (type));
-
- /* Replace GIMPLE_OMP_CONTINUE. */
- gsi_replace (&gsi, stmt, true);
- }
-
- /* Emit the condition in L1_BB. */
- gsi = gsi_after_labels (l1_bb);
- t = fold_build2 (MULT_EXPR, TREE_TYPE (fd->loop.step),
- fold_convert (TREE_TYPE (fd->loop.step), ind_var),
- fd->loop.step);
- if (POINTER_TYPE_P (TREE_TYPE (fd->loop.n1)))
- t = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (fd->loop.n1),
- fd->loop.n1, fold_convert (sizetype, t));
- else
- t = fold_build2 (PLUS_EXPR, TREE_TYPE (fd->loop.n1),
- fd->loop.n1, fold_convert (TREE_TYPE (fd->loop.n1), t));
- t = fold_convert (TREE_TYPE (fd->loop.v), t);
- expand_omp_build_assign (&gsi, fd->loop.v, t);
-
- /* The condition is always '<' since the runtime will fill in the low
- and high values. */
- stmt = gimple_build_cond (LT_EXPR, ind_var, n2, NULL_TREE, NULL_TREE);
- gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
-
- /* Remove GIMPLE_OMP_RETURN. */
- gsi = gsi_last_bb (exit_bb);
- gsi_remove (&gsi, true);
-
- /* Connect the new blocks. */
- remove_edge (FALLTHRU_EDGE (entry_bb));
-
- edge e, ne;
- if (!broken_loop)
- {
- remove_edge (BRANCH_EDGE (entry_bb));
- make_edge (entry_bb, l1_bb, EDGE_FALLTHRU);
-
- e = BRANCH_EDGE (l1_bb);
- ne = FALLTHRU_EDGE (l1_bb);
- e->flags = EDGE_TRUE_VALUE;
- }
- else
- {
- single_succ_edge (entry_bb)->flags = EDGE_FALLTHRU;
-
- ne = single_succ_edge (l1_bb);
- e = make_edge (l1_bb, l0_bb, EDGE_TRUE_VALUE);
-
- }
- ne->flags = EDGE_FALSE_VALUE;
- e->probability = profile_probability::guessed_always ().apply_scale (7, 8);
- ne->probability = e->probability.invert ();
-
- set_immediate_dominator (CDI_DOMINATORS, l1_bb, entry_bb);
- set_immediate_dominator (CDI_DOMINATORS, l2_bb, l2_dom_bb);
- set_immediate_dominator (CDI_DOMINATORS, l0_bb, l1_bb);
-
- if (!broken_loop)
- {
- struct loop *loop = alloc_loop ();
- loop->header = l1_bb;
- loop->latch = cont_bb;
- add_loop (loop, l1_bb->loop_father);
- loop->safelen = INT_MAX;
- }
-
- /* Pick the correct library function based on the precision of the
- induction variable type. */
- tree lib_fun = NULL_TREE;
- if (TYPE_PRECISION (type) == 32)
- lib_fun = cilk_for_32_fndecl;
- else if (TYPE_PRECISION (type) == 64)
- lib_fun = cilk_for_64_fndecl;
- else
- gcc_unreachable ();
-
- gcc_assert (fd->sched_kind == OMP_CLAUSE_SCHEDULE_CILKFOR);
-
- /* WS_ARGS contains the library function flavor to call:
- __libcilkrts_cilk_for_64 or __libcilkrts_cilk_for_32), and the
- user-defined grain value. If the user does not define one, then zero
- is passed in by the parser. */
- vec_alloc (region->ws_args, 2);
- region->ws_args->quick_push (lib_fun);
- region->ws_args->quick_push (fd->chunk_size);
-}
-
/* A subroutine of expand_omp_for. Generate code for a simd non-worksharing
loop. Given parameters:
@@ -5875,8 +5633,6 @@ expand_omp_for (struct omp_region *region, gimple *inner_stmt)
if (gimple_omp_for_kind (fd.for_stmt) & GF_OMP_FOR_SIMD)
expand_omp_simd (region, &fd);
- else if (gimple_omp_for_kind (fd.for_stmt) == GF_OMP_FOR_KIND_CILKFOR)
- expand_cilk_for (region, &fd);
else if (gimple_omp_for_kind (fd.for_stmt) == GF_OMP_FOR_KIND_OACC_LOOP)
{
gcc_assert (!inner_stmt);
@@ -8221,7 +7977,7 @@ public:
/* opt_pass methods: */
virtual unsigned int execute (function *)
{
- bool gate = ((flag_cilkplus != 0 || flag_openacc != 0 || flag_openmp != 0
+ bool gate = ((flag_openacc != 0 || flag_openmp != 0
|| flag_openmp_simd != 0)
&& !seen_error ());
diff --git a/gcc/omp-general.c b/gcc/omp-general.c
index af955bce783..0f53661e0cf 100644
--- a/gcc/omp-general.c
+++ b/gcc/omp-general.c
@@ -143,8 +143,6 @@ omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd,
fd->sched_modifiers = 0;
fd->chunk_size = NULL_TREE;
fd->simd_schedule = false;
- if (gimple_omp_for_kind (fd->for_stmt) == GF_OMP_FOR_KIND_CILKFOR)
- fd->sched_kind = OMP_CLAUSE_SCHEDULE_CILKFOR;
collapse_iter = NULL;
collapse_count = NULL;
@@ -252,9 +250,7 @@ omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd,
loop->cond_code = gimple_omp_for_cond (for_stmt, i);
loop->n2 = gimple_omp_for_final (for_stmt, i);
- gcc_assert (loop->cond_code != NE_EXPR
- || gimple_omp_for_kind (for_stmt) == GF_OMP_FOR_KIND_CILKSIMD
- || gimple_omp_for_kind (for_stmt) == GF_OMP_FOR_KIND_CILKFOR);
+ gcc_assert (loop->cond_code != NE_EXPR);
omp_adjust_for_condition (loc, &loop->cond_code, &loop->n2);
t = gimple_omp_for_incr (for_stmt, i);
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 33e633cd627..5076c63fd73 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -1174,7 +1174,6 @@ scan_sharing_clauses (tree clauses, omp_context *ctx,
case OMP_CLAUSE_PRIORITY:
case OMP_CLAUSE_GRAINSIZE:
case OMP_CLAUSE_NUM_TASKS:
- case OMP_CLAUSE__CILK_FOR_COUNT_:
case OMP_CLAUSE_NUM_GANGS:
case OMP_CLAUSE_NUM_WORKERS:
case OMP_CLAUSE_VECTOR_LENGTH:
@@ -1486,7 +1485,6 @@ scan_sharing_clauses (tree clauses, omp_context *ctx,
case OMP_CLAUSE_NOGROUP:
case OMP_CLAUSE_DEFAULTMAP:
case OMP_CLAUSE_USE_DEVICE_PTR:
- case OMP_CLAUSE__CILK_FOR_COUNT_:
case OMP_CLAUSE_ASYNC:
case OMP_CLAUSE_WAIT:
case OMP_CLAUSE_NUM_GANGS:
@@ -1529,41 +1527,15 @@ scan_sharing_clauses (tree clauses, omp_context *ctx,
}
}
-/* Create a new name for omp child function. Returns an identifier. If
- IS_CILK_FOR is true then the suffix for the child function is
- "_cilk_for_fn." */
+/* Create a new name for omp child function. Returns an identifier. */
static tree
-create_omp_child_function_name (bool task_copy, bool is_cilk_for)
+create_omp_child_function_name (bool task_copy)
{
- if (is_cilk_for)
- return clone_function_name (current_function_decl, "_cilk_for_fn");
return clone_function_name (current_function_decl,
task_copy ? "_omp_cpyfn" : "_omp_fn");
}
-/* Returns the type of the induction variable for the child function for
- _Cilk_for and the types for _high and _low variables based on TYPE. */
-
-static tree
-cilk_for_check_loop_diff_type (tree type)
-{
- if (TYPE_PRECISION (type) <= TYPE_PRECISION (uint32_type_node))
- {
- if (TYPE_UNSIGNED (type))
- return uint32_type_node;
- else
- return integer_type_node;
- }
- else
- {
- if (TYPE_UNSIGNED (type))
- return uint64_type_node;
- else
- return long_long_integer_type_node;
- }
-}
-
/* Return true if CTX may belong to offloaded code: either if current function
is offloaded, or any enclosing context corresponds to a target region. */
@@ -1586,24 +1558,10 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
{
tree decl, type, name, t;
- tree cilk_for_count
- = (flag_cilkplus && gimple_code (ctx->stmt) == GIMPLE_OMP_PARALLEL)
- ? omp_find_clause (gimple_omp_parallel_clauses (ctx->stmt),
- OMP_CLAUSE__CILK_FOR_COUNT_) : NULL_TREE;
- tree cilk_var_type = NULL_TREE;
-
- name = create_omp_child_function_name (task_copy,
- cilk_for_count != NULL_TREE);
+ name = create_omp_child_function_name (task_copy);
if (task_copy)
type = build_function_type_list (void_type_node, ptr_type_node,
ptr_type_node, NULL_TREE);
- else if (cilk_for_count)
- {
- type = TREE_TYPE (OMP_CLAUSE_OPERAND (cilk_for_count, 0));
- cilk_var_type = cilk_for_check_loop_diff_type (type);
- type = build_function_type_list (void_type_node, ptr_type_node,
- cilk_var_type, cilk_var_type, NULL_TREE);
- }
else
type = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
@@ -1660,32 +1618,6 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
DECL_CONTEXT (t) = decl;
DECL_RESULT (decl) = t;
- /* _Cilk_for's child function requires two extra parameters called
- __low and __high that are set the by Cilk runtime when it calls this
- function. */
- if (cilk_for_count)
- {
- t = build_decl (DECL_SOURCE_LOCATION (decl),
- PARM_DECL, get_identifier ("__high"), cilk_var_type);
- DECL_ARTIFICIAL (t) = 1;
- DECL_NAMELESS (t) = 1;
- DECL_ARG_TYPE (t) = ptr_type_node;
- DECL_CONTEXT (t) = current_function_decl;
- TREE_USED (t) = 1;
- DECL_CHAIN (t) = DECL_ARGUMENTS (decl);
- DECL_ARGUMENTS (decl) = t;
-
- t = build_decl (DECL_SOURCE_LOCATION (decl),
- PARM_DECL, get_identifier ("__low"), cilk_var_type);
- DECL_ARTIFICIAL (t) = 1;
- DECL_NAMELESS (t) = 1;
- DECL_ARG_TYPE (t) = ptr_type_node;
- DECL_CONTEXT (t) = current_function_decl;
- TREE_USED (t) = 1;
- DECL_CHAIN (t) = DECL_ARGUMENTS (decl);
- DECL_ARGUMENTS (decl) = t;
- }
-
tree data_name = get_identifier (".omp_data_i");
t = build_decl (DECL_SOURCE_LOCATION (decl), PARM_DECL, data_name,
ptr_type_node);
@@ -1695,8 +1627,6 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
DECL_CONTEXT (t) = current_function_decl;
TREE_USED (t) = 1;
TREE_READONLY (t) = 1;
- if (cilk_for_count)
- DECL_CHAIN (t) = DECL_ARGUMENTS (decl);
DECL_ARGUMENTS (decl) = t;
if (!task_copy)
ctx->receiver_decl = t;
@@ -8988,7 +8918,7 @@ execute_lower_omp (void)
/* This pass always runs, to provide PROP_gimple_lomp.
But often, there is nothing to do. */
- if (flag_cilkplus == 0 && flag_openacc == 0 && flag_openmp == 0
+ if (flag_openacc == 0 && flag_openmp == 0
&& flag_openmp_simd == 0)
return 0;
@@ -9080,16 +9010,6 @@ diagnose_sb_0 (gimple_stmt_iterator *gsi_p,
const char* kind = NULL;
- if (flag_cilkplus)
- {
- if ((branch_ctx
- && gimple_code (branch_ctx) == GIMPLE_OMP_FOR
- && gimple_omp_for_kind (branch_ctx) == GF_OMP_FOR_KIND_CILKSIMD)
- || (label_ctx
- && gimple_code (label_ctx) == GIMPLE_OMP_FOR
- && gimple_omp_for_kind (label_ctx) == GF_OMP_FOR_KIND_CILKSIMD))
- kind = "Cilk Plus";
- }
if (flag_openacc)
{
if ((branch_ctx && is_gimple_omp_oacc (branch_ctx))
@@ -9361,7 +9281,7 @@ public:
/* opt_pass methods: */
virtual bool gate (function *)
{
- return flag_cilkplus || flag_openacc || flag_openmp || flag_openmp_simd;
+ return flag_openacc || flag_openmp || flag_openmp_simd;
}
virtual unsigned int execute (function *)
{
diff --git a/gcc/omp-simd-clone.c b/gcc/omp-simd-clone.c
index 5cd85642546..432c77d124f 100644
--- a/gcc/omp-simd-clone.c
+++ b/gcc/omp-simd-clone.c
@@ -112,19 +112,11 @@ simd_clone_clauses_extract (struct cgraph_node *node, tree clauses,
if (n > 0 && args.last () == void_type_node)
n--;
- /* To distinguish from an OpenMP simd clone, Cilk Plus functions to
- be cloned have a distinctive artificial label in addition to "omp
- declare simd". */
- bool cilk_clone
- = (flag_cilkplus
- && lookup_attribute ("cilk simd function",
- DECL_ATTRIBUTES (node->decl)));
-
/* Allocate one more than needed just in case this is an in-branch
clone which will require a mask argument. */
struct cgraph_simd_clone *clone_info = simd_clone_struct_alloc (n + 1);
clone_info->nargs = n;
- clone_info->cilk_elemental = cilk_clone;
+ clone_info->cilk_elemental = false;
if (!clauses)
goto out;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6f3b47585d5..95bcafeb781 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,176 @@
+2017-11-28 Julia Koval <julia.koval@intel.com>
+ Sebastian Peryt <sebastian.peryt@intel.com>
+
+ * c-c++-common/attr-simd-3.c: Delete.
+ * c-c++-common/cilk-plus/AN/an-if.c: Delete.
+ * c-c++-common/cilk-plus/AN/array_test1.c: Delete.
+ * c-c++-common/cilk-plus/AN/array_test2.c: Delete.
+ * c-c++-common/cilk-plus/AN/array_test_ND.c: Delete.
+ * c-c++-common/cilk-plus/AN/builtin_fn_custom.c: Delete.
+ * c-c++-common/cilk-plus/AN/builtin_fn_mutating.c: Delete.
+ * c-c++-common/cilk-plus/AN/builtin_func_double.c: Delete.
+ * c-c++-common/cilk-plus/AN/builtin_func_double2.c: Delete.
+ * c-c++-common/cilk-plus/AN/comma_exp.c: Delete.
+ * c-c++-common/cilk-plus/AN/conditional.c: Delete.
+ * c-c++-common/cilk-plus/AN/decl-ptr-colon.c: Delete.
+ * c-c++-common/cilk-plus/AN/dimensionless-arrays.c: Delete.
+ * c-c++-common/cilk-plus/AN/exec-once.c: Delete.
+ * c-c++-common/cilk-plus/AN/exec-once2.c: Delete.
+ * c-c++-common/cilk-plus/AN/fn_ptr-2.c: Delete.
+ * c-c++-common/cilk-plus/AN/fn_ptr.c: Delete.
+ * c-c++-common/cilk-plus/AN/fp_triplet_values.c: Delete.
+ * c-c++-common/cilk-plus/AN/gather-scatter-errors.c: Delete.
+ * c-c++-common/cilk-plus/AN/gather_scatter.c: Delete.
+ * c-c++-common/cilk-plus/AN/if_test.c: Delete.
+ * c-c++-common/cilk-plus/AN/if_test_errors.c: Delete.
+ * c-c++-common/cilk-plus/AN/misc.c: Delete.
+ * c-c++-common/cilk-plus/AN/n-ptr-test.c: Delete.
+ * c-c++-common/cilk-plus/AN/parser_errors.c: Delete.
+ * c-c++-common/cilk-plus/AN/parser_errors2.c: Delete.
+ * c-c++-common/cilk-plus/AN/parser_errors3.c: Delete.
+ * c-c++-common/cilk-plus/AN/parser_errors4.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr57457-2.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr57457.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr57490.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr57541-2.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr57541.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr57577.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr58942.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr61191.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr61455-2.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr61455.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr61962.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr61963.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr62008.c: Delete.
+ * c-c++-common/cilk-plus/AN/pr63884.c: Delete.
+ * c-c++-common/cilk-plus/AN/rank_mismatch.c: Delete.
+ * c-c++-common/cilk-plus/AN/rank_mismatch2.c: Delete.
+ * c-c++-common/cilk-plus/AN/rank_mismatch3.c: Delete.
+ * c-c++-common/cilk-plus/AN/sec_implicit.c: Delete.
+ * c-c++-common/cilk-plus/AN/sec_implicit2.c: Delete.
+ * c-c++-common/cilk-plus/AN/sec_implicit_ex.c: Delete.
+ * c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c: Delete.
+ * c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c: Delete.
+ * c-c++-common/cilk-plus/AN/sec_reduce_return.c: Delete.
+ * c-c++-common/cilk-plus/AN/side-effects-1.c: Delete.
+ * c-c++-common/cilk-plus/AN/test_builtin_return.c: Delete.
+ * c-c++-common/cilk-plus/AN/test_sec_limits.c: Delete.
+ * c-c++-common/cilk-plus/AN/tst_lngth.c: Delete.
+ * c-c++-common/cilk-plus/AN/vla.c: Delete.
+ * c-c++-common/cilk-plus/CK/Wparentheses-1.c: Delete.
+ * c-c++-common/cilk-plus/CK/cilk-for-2.c: Delete.
+ * c-c++-common/cilk-plus/CK/cilk-for-3.c: Delete.
+ * c-c++-common/cilk-plus/CK/cilk-fors.c: Delete.
+ * c-c++-common/cilk-plus/CK/cilk_for_errors.c: Delete.
+ * c-c++-common/cilk-plus/CK/cilk_for_grain.c: Delete.
+ * c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c: Delete.
+ * c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c: Delete.
+ * c-c++-common/cilk-plus/CK/compound_cilk_spawn.c: Delete.
+ * c-c++-common/cilk-plus/CK/concec_cilk_spawn.c: Delete.
+ * c-c++-common/cilk-plus/CK/errors.c: Delete.
+ * c-c++-common/cilk-plus/CK/fib.c: Delete.
+ * c-c++-common/cilk-plus/CK/fib_init_expr_xy.c: Delete.
+ * c-c++-common/cilk-plus/CK/fib_no_return.c: Delete.
+ * c-c++-common/cilk-plus/CK/fib_no_sync.c: Delete.
+ * c-c++-common/cilk-plus/CK/invalid_spawns.c: Delete.
+ * c-c++-common/cilk-plus/CK/invalid_sync.c: Delete.c
+ * c-c++-common/cilk-plus/CK/nested_cilk_for.c: Delete.
+ * c-c++-common/cilk-plus/CK/no_args_error.c: Delete.
+ * c-c++-common/cilk-plus/CK/pr59631.c: Delete.
+ * c-c++-common/cilk-plus/CK/pr60197-2.c: Delete.
+ * c-c++-common/cilk-plus/CK/pr60197.c: Delete.
+ * c-c++-common/cilk-plus/CK/pr60469.c: Delete.
+ * c-c++-common/cilk-plus/CK/pr60586.c: Delete.
+ * c-c++-common/cilk-plus/CK/pr63307.c: Delete.
+ * c-c++-common/cilk-plus/CK/pr69826-1.c: Delete.
+ * c-c++-common/cilk-plus/CK/pr69826-2.c: Delete.
+ * c-c++-common/cilk-plus/CK/pr79428-4.c: Delete.
+ * c-c++-common/cilk-plus/CK/pr79428-7.c: Delete.
+ * c-c++-common/cilk-plus/CK/spawn_in_return.c: Delete.
+ * c-c++-common/cilk-plus/CK/spawnee_inline.c: Delete.
+ * c-c++-common/cilk-plus/CK/spawner_inline.c: Delete.
+ * c-c++-common/cilk-plus/CK/spawning_arg.c: Delete.
+ * c-c++-common/cilk-plus/CK/steal_check.c: Delete.
+ * c-c++-common/cilk-plus/CK/sync_wo_spawn.c: Delete.
+ * c-c++-common/cilk-plus/CK/test__cilk.c: Delete.
+ * c-c++-common/cilk-plus/CK/varargs_test.c: Delete.
+ * c-c++-common/cilk-plus/PS/Wparentheses-1.c: Delete.
+ * c-c++-common/cilk-plus/PS/body.c: Delete.
+ * c-c++-common/cilk-plus/PS/clauses1.c: Delete.
+ * c-c++-common/cilk-plus/PS/clauses2.c: Delete.
+ * c-c++-common/cilk-plus/PS/clauses3.c: Delete.
+ * c-c++-common/cilk-plus/PS/clauses4.c: Delete.
+ * c-c++-common/cilk-plus/PS/for1.c: Delete.
+ * c-c++-common/cilk-plus/PS/for2.c: Delete.
+ * c-c++-common/cilk-plus/PS/for3.c: Delete.
+ * c-c++-common/cilk-plus/PS/pr69363.c: Delete.
+ * c-c++-common/cilk-plus/PS/reduction-1.c: Delete.
+ * c-c++-common/cilk-plus/PS/reduction-2.c: Delete.
+ * c-c++-common/cilk-plus/PS/reduction-3.c: Delete.
+ * c-c++-common/cilk-plus/PS/run-1.c: Delete.
+ * c-c++-common/cilk-plus/PS/safelen.c: Delete.
+ * c-c++-common/cilk-plus/PS/vectorlength-2.c: Delete.
+ * c-c++-common/cilk-plus/PS/vectorlength-3.c: Delete.
+ * c-c++-common/cilk-plus/PS/vectorlength.c: Delete.
+ * c-c++-common/cilk-plus/SE/ef_error.c: Delete.
+ * c-c++-common/cilk-plus/SE/ef_error2.c: Delete.
+ * c-c++-common/cilk-plus/SE/ef_error3.c: Delete.
+ * c-c++-common/cilk-plus/SE/ef_test.c: Delete.
+ * c-c++-common/cilk-plus/SE/ef_test2.c: Delete.
+ * c-c++-common/cilk-plus/SE/vlength_errors.c: Delete.
+ * g++.dg/cilk-plus/AN/array_function.c: Delete.
+ * g++.dg/cilk-plus/AN/array_test1_tplt.c: Delete.
+ * g++.dg/cilk-plus/AN/array_test2_tplt.c: Delete.
+ * g++.dg/cilk-plus/AN/array_test_ND_tplt.c: Delete.
+ * g++.dg/cilk-plus/AN/braced_list.c: Delete.
+ * g++.dg/cilk-plus/AN/builtin_fn_custom_tplt.c: Delete.
+ * g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.c: Delete.
+ * g++.dg/cilk-plus/AN/fp_triplet_values_tplt.c: Delete.
+ * g++.dg/cilk-plus/AN/postincr_test.c: Delete.
+ * g++.dg/cilk-plus/AN/preincr_test.c: Delete.
+ * g++.dg/cilk-plus/CK/catch_exc.c: Delete.
+ * g++.dg/cilk-plus/CK/cf3.c: Delete.
+ * g++.dg/cilk-plus/CK/cilk-for-tplt.c: Delete.
+ * g++.dg/cilk-plus/CK/const_spawn.c: Delete.
+ * g++.dg/cilk-plus/CK/fib-opr-overload.c: Delete.
+ * g++.dg/cilk-plus/CK/fib-tplt.c: Delete.
+ * g++.dg/cilk-plus/CK/for1.c: Delete.
+ * g++.dg/cilk-plus/CK/lambda_spawns.c: Delete.
+ * g++.dg/cilk-plus/CK/lambda_spawns_tplt.c: Delete.
+ * g++.dg/cilk-plus/CK/pr60586.c: Delete.
+ * g++.dg/cilk-plus/CK/pr66326.c: Delete.
+ * g++.dg/cilk-plus/CK/pr68001.c: Delete.
+ * g++.dg/cilk-plus/CK/pr68997.c: Delete.
+ * g++.dg/cilk-plus/CK/pr69024.c: Delete.
+ * g++.dg/cilk-plus/CK/pr69048.c: Delete.
+ * g++.dg/cilk-plus/CK/pr69267.c: Delete.
+ * g++.dg/cilk-plus/CK/pr80038.c: Delete.
+ * g++.dg/cilk-plus/CK/stl_iter.c: Delete.
+ * g++.dg/cilk-plus/CK/stl_rev_iter.c: Delete.
+ * g++.dg/cilk-plus/CK/stl_test.c: Delete.
+ * g++.dg/cilk-plus/cilk-plus.exp
+ * g++.dg/cilk-plus/ef_test.C: Delete.
+ * g++.dg/cilk-plus/for.C: Delete.
+ * g++.dg/cilk-plus/for2.C: Delete.
+ * g++.dg/cilk-plus/for3.C: Delete.
+ * g++.dg/cilk-plus/for4.C: Delete.
+ * g++.dg/cilk-plus/pr60967.C: Delete.
+ * g++.dg/cilk-plus/pr69028.C: Delete.
+ * g++.dg/cilk-plus/pr70565.C: Delete.
+ * g++.dg/pr57662.C: Delete.
+ * gcc.dg/cilk-plus/cilk-plus.exp
+ * gcc.dg/cilk-plus/for1.c: Delete.
+ * gcc.dg/cilk-plus/for2.c: Delete.
+ * gcc.dg/cilk-plus/jump-openmp.c: Delete.
+ * gcc.dg/cilk-plus/jump.c: Delete.
+ * gcc.dg/cilk-plus/pr69798-1.c: Delete.
+ * gcc.dg/cilk-plus/pr69798-2.c: Delete.
+ * gcc.dg/cilk-plus/pr78306.c: Delete.
+ * gcc.dg/cilk-plus/pr79116.c: Delete.
+ * gcc.dg/graphite/id-28.c: Delete.
+ * lib/cilk-plus-dg.exp: Delete.
+ * lib/target-supports.exp (cilkplus_runtime): Delete.
+
2017-11-28 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/81020
diff --git a/gcc/testsuite/c-c++-common/attr-simd-3.c b/gcc/testsuite/c-c++-common/attr-simd-3.c
deleted file mode 100644
index 56552bd7e08..00000000000
--- a/gcc/testsuite/c-c++-common/attr-simd-3.c
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do compile { target cilkplus } } */
-/* { dg-options "-fcilkplus" } */
-/* { dg-prune-output "undeclared here \\(not in a function\\)|\[^\n\r\]* was not declared in this scope" } */
-
-void f () __attribute__((__simd__, __vector__)); /* { dg-error "in the same function marked as a Cilk Plus" "PR68158" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/an-if.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/an-if.c
deleted file mode 100644
index 4ac46abc404..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/an-if.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus -fdump-tree-original" } */
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-#include <assert.h>
-
-const int n = 8;
-
-float x[8], y[8], z[8];
-
-int main() {
- int i = 0;
- float x_sum =0;
- for(i=1; i<=5; i+=4 ) {
- x[0:n] = 3;
- y[0:n] = i;
- z[0:n] = 0;
-#if HAVE_IO
- printf("x\ty\tz\n");
- for( size_t k=0; k<n; ++k ) {
- printf("%g\t%g\t%g\n",x[k],y[k],z[k]);
- }
- x_sum = __sec_reduce_add (x[0:n]);
- printf("sec_reduce_add (x[0:n]) = %6.3f\n", x_sum);
-#endif
- assert( __sec_reduce_add(x[0:n])==3*n );
- assert( __sec_reduce_add(y[0:n])==i*n );
- assert( __sec_reduce_add(z[0:n])==0 );
-
- if (x[0:n] >= y[0:n]) {
- z[0:n] = x[0:n] - y[0:n];
- } else {
- z[0:n] = x[0:n] + y[0:n];
- }
-#if HAVE_IO
- printf("x\ty\tz\n");
- for( size_t k=0; k<n; ++k ) {
- printf("%g\t%g\t%g\n",x[k],y[k],z[k]);
- }
-#endif
- assert( __sec_reduce_add(x[0:n])==3*n );
- assert( __sec_reduce_add(y[0:n])==i*n );
- assert( __sec_reduce_add(z[0:n])==(3>=i?3-i:3+i)*n );
- }
- return 0;
-}
-
-/* The C++ FE once emitted a bogus error_mark_node for this test case. */
-/* { dg-final { scan-tree-dump-not "<<< error >>>" "original" } } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c
deleted file mode 100644
index 282a55d6fc6..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test1.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#include <stdlib.h>
-
-int main2 (char **argv);
-
-int main(void)
-{
- int x = 0;
- const char *array[] = {"a.out", "5"};
- x = main2 ((char **)array);
- return x;
-}
-
-int main2 (char **argv)
-{
- int array[10], ii = 0, x = 2, z= 0 , y = 0 ;
- for (ii = 0; ii < 10; ii++)
- array[ii] = 10;
-
- array[0:10:1] = 15;
-
- for (ii = 0; ii < 10; ii++)
- if (array[ii] != 15)
- return 5;
- array[0:5:2] = 20;
-
- for (ii = 0; ii < 10; ii += 2)
- if (array[ii] != 20)
- return 4;
-
-
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
-
- array[x:5:z] = 50;
-
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != 50)
- return 3;
-
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
- y = 10-atoi(argv[1]);
-
- array[x:y:z] = 505;
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != 505)
- return 4;
-
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
- y = 10-atoi(argv[1]);
-
- array[x:y:((10-atoi(argv[1]))/atoi(argv[1]))] = 25;
-
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != 25)
- return 5;
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
- y = 10-atoi(argv[1]);
-
- array[atoi(argv[1]):(10-atoi(argv[1])):((10-atoi(argv[1]))/atoi(argv[1]))] =
- 1400;
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != 1400)
- return 6;
-
-
- array[atoi("5"):5:1] = 5555;
-
- for (ii = atoi ("5"); ii < 10; ii++)
- if (array[ii] != 5555)
- return 7;
-
-
- array[atoi("5"):atoi("5"):atoi("1")] = 9999;
- for (ii = atoi ("5"); ii < (atoi ("5") + atoi ("5")); ii += atoi ("1"))
- if (array[ii] != 9999)
- return 8;
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c
deleted file mode 100644
index 60f2de2834a..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test2.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#include <stdlib.h>
-int main2 (char **argv);
-int main(void)
-{
- int x = 0;
- const char *array[] = {"a.out", "5"};
- x = main2 ((char **)array);
- return x;
-}
-
-
-int main2(char **argv)
-{
- int array[10], array2[10], ii = 0, x = 2, z= 0 , y = 0 ;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 10;
- array2[ii] = 5000000;
- }
-
- array2[0:10:1] = array[0:10:1];
-
- for (ii = 0; ii < 10; ii++)
- if (array2[ii] != array[ii])
- return 1;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 10;
- array2[ii] = 5000000;
- }
-
- array2[0:5:2] = array[0:5:2];
-
- for (ii = 0; ii < 10; ii += 2)
- if (array[ii] != array2[ii])
- return 2;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 10;
- array2[ii] = 5000000;
- }
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
-
- array2[x:5:z] = array[x:5:z];
-
- for (ii = x; ii < 5; ii += z)
- if (array2[ii] != array[ii])
- return 3;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 500;
- array2[ii] = 1000000;
- }
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
- y = 10-atoi(argv[1]);
-
- array2[x:y:z] = array[x:y:z];
- for (ii = x; ii < 10; ii = ii + z)
- if (array2[ii] != array[ii])
- return 4;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 500;
- array2[ii] = 1000000;
- }
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
- y = 10-atoi(argv[1]);
-
- array[x:y:((10-atoi(argv[1]))/atoi(argv[1]))] =
- array2[x:y:((10-atoi(argv[1]))/atoi(argv[1]))];
-
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != array2[ii])
- return 5;
-
-
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
- y = 10-atoi(argv[1]);
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 500;
- array2[ii] = 1000000;
- }
-
- array[atoi(argv[1]):(10-atoi(argv[1])):((10-atoi(argv[1]))/atoi(argv[1]))] =
- array2[atoi(argv[1]):(10-atoi(argv[1])):((10-atoi(argv[1]))/atoi(argv[1]))];
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != array2[ii])
- return 6;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 4;
- array2[ii] = 2;
- }
-
- array[atoi("5"):5:1] = array2[atoi("5"):5:1];
-
- for (ii = atoi ("5"); ii < 10; ii++)
- if (array[ii] != array2[ii])
- return (7);
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 5;
- array2[ii] = 1;
- }
- array[atoi("5"):atoi("5"):atoi("1")] = array2[atoi("5"):atoi("5"):atoi("1")];
-
- for (ii = 5; ii < 10; ii++)
- if (array2[ii] != array[ii])
- return 8;
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c
deleted file mode 100644
index e89bbab268b..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/array_test_ND.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#include <stdlib.h>
-int main2(char **argv);
-int main(void)
-{
- int x = 0;
- const char *array[] = {"a.out", "10", "15"};
- x = main2 ((char **)array);
- return x;
-}
-
-int main2(char **argv)
-{
- int array[10][15], ii = 0, jj = 0,x = 0, z= 1 , y = 10 ;
- int array_2[10][15];
- int argc = 3;
- __asm volatile ("" : "+r" (argc));
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj< 15; jj++) {
- array[ii][jj] = ii+jj;
- array_2[ii][jj] = 0;
- }
- }
- array_2[0:5:2][0:5:3] = array[0:5:2][0:5:3] + 1 + 5 + array[0][5] + x;
-
- for (ii = 0; ii < 10; ii += 2)
- {
- for (jj = 0; jj < 15; jj += 3)
- {
- if (array_2[ii][jj] != array[ii][jj] + 1 + 5 + array[0][5] + x)
- return 2;
- }
- }
-
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj< 15; jj++) {
- array[ii][jj] = ii+jj;
- array_2[ii][jj] = 0;
- }
- }
- x = atoi(argv[1]);
- y = atoi(argv[2]);
- array_2[0:x:1][0:y:1] = array[0:x:1][0:y:1] + x + y + array[0:x:1][0:y:1];
-
- for (ii = 0; ii < x; ii++)
- {
- for (jj = 0; jj < y; jj++)
- {
- if (array_2[ii][jj] != array[ii][jj] + x + y + array[ii][jj])
- return 3;
- }
- }
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj< 15; jj++) {
- array[ii][jj] = ii+jj;
- array_2[ii][jj] = 0;
- }
- }
- x = atoi(argv[1]);
- y = atoi(argv[2]);
- z = (20- atoi (argv[1]))/atoi(argv[1]);
- /* (20-10)/10 evaluates to 1 all the time :-). */
- array_2[0:x:z][0:y:z] = array[0:x:z][0:y:z] + array[0:x:z][0:y:z] + y + z;
-
- for (ii = 0; ii < x; ii += z)
- {
- for (jj = 0; jj < y; jj += z)
- {
- if (array_2[ii][jj] != array[ii][jj] + array[ii][jj] + y + z)
- return 4;
- }
- }
-
-
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj< 15; jj++) {
- array[ii][jj] = ii+jj;
- array_2[ii][jj] = 0;
- }
- }
- x = argc-3;
- y = 20-atoi(argv[1]);
- z = (20- atoi (argv[1]))/atoi(argv[1]);
- /* (20-10)/10 evaluates to 1 all the time :-). */
- array_2[(argc-3):(20-atoi(argv[1])):(20-atoi(argv[1]))/atoi(argv[1])][(argc-3):(30-atoi(argv[2])): ((30-atoi(argv[2]))/atoi(argv[2]))] = array[(argc-3):20-atoi(argv[1]):(20-atoi(argv[1]))/atoi(argv[1])][(argc-3):(30-atoi(argv[2])): (30-atoi(argv[2]))/atoi(argv[2])] + array[(argc-3):20-atoi(argv[1]):(20-atoi(argv[1]))/atoi(argv[1])][(argc-3):(30-atoi(argv[2])): (30-atoi(argv[2]))/atoi(argv[2])] * array[(argc-3):20-atoi(argv[1]):(20-atoi(argv[1]))/atoi(argv[1])][(argc-3):(30-atoi(argv[2])): (30-atoi(argv[2]))/atoi(argv[2])];
-
- for (ii = 0; ii < 10; ii++)
- {
- for (jj = 0; jj < 15; jj++)
- {
- if (array_2[ii][jj] != array[ii][jj] + array[ii][jj] * array[ii][jj])
- return 5;
- }
- }
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c
deleted file mode 100644
index 8f6770b870e..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_custom.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-/* { dg-additional-options "-ffloat-store" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-
-#define NUMBER 100
-#if HAVE_IO
-#include <stdio.h>
-#endif
-/* #include <stdlib.h> */
-
-double my_func (double x, double y)
-{
- if (x > y)
- return x;
- else
- return y;
-}
-
-
-/* char __sec_reduce_add (int *); */
-int main(void)
-{
- int ii,array[NUMBER], y = 0, y_int = 0, array2[NUMBER];
- double x, yy, array3[NUMBER], array4[NUMBER];
- double max_value = 0.000, min_value = 0.000, add_value, mul_value = 1.00;
- int max_index = 0, min_index = 0;
- for (ii = 0; ii < NUMBER; ii++)
- {
- array[ii] = 1+ii;
- array2[ii]= 2;
- }
-
- for (ii = 0; ii < NUMBER; ii++)
- {
- if (ii%2 && ii)
- array3[ii] = (double)(1.0000/(double)ii);
- else
- array3[ii] = (double) ii + 0.10;
- array4[ii] = (double) (1.00000/ (double)(ii+1));
- }
-
- /* array[:] = 5; */
- x = __sec_reduce (0, array3[:] * array4[:], my_func);
- y = __sec_reduce_max_ind ( array3[:] * array4[:]);
-
- /* Initialize it to the first variable. */
- max_value = array3[0] * array4[0];
- for (ii = 0; ii < NUMBER; ii++)
- if (array3[ii] * array4[ii] > max_value) {
- max_value = array3[ii] * array4[ii];
- max_index = ii;
- }
-
-
-
-#if HAVE_IO
- for (ii = 0; ii < NUMBER; ii++)
- printf("%5.3f ", array3[ii] * array4[ii]);
- printf("\n");
- printf("Max = %5.3f\t Max Index = %2d\n", x, y);
-#endif
-
- if (x != max_value)
- return 1;
-
- if (y != max_index)
- return 2;
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c
deleted file mode 100644
index 760d315d54c..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_fn_mutating.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-/* { dg-additional-options "-ffloat-store" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-
-#define NUMBER 100
-#if HAVE_IO
-#include <stdio.h>
-#endif
-/* #include <stdlib.h> */
-
-void my_func (double *x, double y)
-{
- if (*x < y)
- *x = y;
-}
-
-
-int main(void)
-{
- int ii,array[NUMBER], y = 0, y_int = 0, array2[NUMBER];
- double x = 0.000, yy, array3[NUMBER], array4[NUMBER];
- double max_value = 0.000, min_value = 0.000, add_value, mul_value = 1.00;
- int max_index = 0, min_index = 0;
-#if 1
- for (ii = 0; ii < NUMBER; ii++)
- {
- array[ii] = 1+ii;
- array2[ii]= 2;
- }
-
- for (ii = 0; ii < NUMBER; ii++)
- {
- if (ii%2 && ii)
- array3[ii] = (double)(1.0000/(double)ii);
- else
- array3[ii] = (double) ii + 0.10;
- array4[ii] = (double) (1.00000/ (double)(ii+1));
- }
-#endif
- /* array[:] = 5; */
- __sec_reduce_mutating (&x, array3[:] * array4[:], my_func);
-#if 1
- y = __sec_reduce_max_ind ( array3[:] * array4[:]);
-
- /* Initialize it to the first variable. */
- max_value = array3[0] * array4[0];
- for (ii = 0; ii < NUMBER; ii++)
- if (array3[ii] * array4[ii] > max_value) {
- max_index = ii;
- }
-
- for (ii = 0; ii < NUMBER; ii++)
- my_func (&max_value, array3[ii] * array4[ii]);
-
-#if HAVE_IO
- for (ii = 0; ii < NUMBER; ii++)
- printf("%5.3f ", array3[ii] * array4[ii]);
- printf("\n");
- printf("Max = %5.3f\t Max Index = %2d\n", x, y);
- printf("Max = %5.3f\t Max Index = %2d\n", max_value, max_index);
-#endif
-
- if (x != max_value)
- return 1;
-
- if (y != max_index)
- return 2;
-#endif
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c
deleted file mode 100644
index 0c05994ee30..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double.c
+++ /dev/null
@@ -1,124 +0,0 @@
-#if HAVE_IO
-#include <stdio.h>
-#endif
-/* #include <stdlib.h> */
-
-/* char __sec_reduce_add (int *); */
-int main(void)
-{
- int ii,array[10], y = 0, y_int = 0, array2[10];
- double x, yy, array3[10], array4[10];
- double max_value = 0.000, min_value = 0.000, add_value, mul_value = 1.00;
- int max_index = 0, min_index = 0;
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 1+ii;
- array2[ii]= 2;
- }
-
- for (ii = 0; ii < 10; ii++)
- {
- if (ii%2 && ii)
- array3[ii] = (double)(1.0000/(double)ii);
- else
- array3[ii] = (double) ii + 0.10;
- array4[ii] = (double) (1.00000/ (double)(ii+1));
- }
-
- /* array[:] = 5; */
- x = __sec_reduce_max (array3[:] * array4[:]);
- y = __sec_reduce_max_ind ( array3[:] * array4[:]);
-
- /* Initialize it to the first variable. */
- max_value = array3[0] * array4[0];
- for (ii = 0; ii < 10; ii++)
- if (array3[ii] * array4[ii] > max_value) {
- max_value = array3[ii] * array4[ii];
- max_index = ii;
- }
-
-
-
-#if HAVE_IO
- for (ii = 0; ii < 10; ii++)
- printf("%5.3f ", array3[ii] * array4[ii]);
- printf("\n");
- printf("Max = %5.3f\t Max Index = %2d\n", x, y);
-#endif
-
- if (x != max_value)
- return 1;
-
- if (y != max_index)
- return 2;
-
- x = __sec_reduce_min (array3[:] * array4[:]);
- y = __sec_reduce_min_ind ( array3[:] * array4[:]);
-#if HAVE_IO
- for (ii = 0; ii < 10; ii++)
- printf("%5.3f ", array3[ii] * array4[ii]);
- printf("\n");
- printf("Min = %5.3f\t Min Index = %2d\n", x, y);
-#endif
-
- /* Initialize it to the first variable. */
- min_value = array3[0] * array4[0];
- for (ii = 0; ii < 10; ii++)
- if (array3[ii] * array4[ii] < min_value) {
- min_value = array3[ii] * array4[ii];
- min_index = ii;
- }
-
- if (x != min_value)
- return 3;
- if (y != min_index)
- return 4;
-
- x = __sec_reduce_add (array3[:] * array4[:]);
- yy = __sec_reduce_mul ( array3[:] * array4[:]);
-#if HAVE_IO
- for (ii = 0; ii < 10; ii++)
- printf("%5.3f ", array3[ii] * array4[ii]);
- printf("\n");
- printf("Add = %5.3f\t Mul = %f\n", x, yy);
-#endif
-
- /* Initialize it to the first variable. */
- add_value = 0.0000;
- mul_value = 1.0000;
- for (ii = 0; ii < 10; ii++)
- {
- add_value += (array3[ii] * array4[ii]);
- mul_value *= (array3[ii] * array4[ii]);
- }
-
- if (x != add_value)
- return 5;
- if (yy != mul_value)
- return 6;
-
- for (ii = 0; ii < 10; ii++)
- {
- if (ii%2 && ii)
- array3[ii] = (double)(1.0000/(double)ii);
- else
- array3[ii] = (double) ii + 0.00;
- array4[ii] = (double) (1.00000/ (double)(ii+1));
- }
- y_int = __sec_reduce_any_zero (array3[:] * array4[:]);
- y = __sec_reduce_all_zero ( array3[:] * array4[:]);
-
- if (y_int != 1)
- return 7;
-
- if (y != 0)
- return 8;
-
-#if HAVE_IO
- for (ii = 0; ii < 10; ii++)
- printf("%5.3f ", array3[ii] * array4[ii]);
- printf("\n");
- printf("Any Zeros = %d\t All Zeros = %d\n", y_int, y);
-#endif
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c
deleted file mode 100644
index 65549121b19..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/builtin_func_double2.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#define NUMBER 100
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-int main(void)
-{
- int argc = 1;
- int ii,array[NUMBER], y = 0, y_int = 0, array2[NUMBER], y_int2=0, y2=0;
- double x, yy, array3[NUMBER], array4[NUMBER];
- int all_zero, all_nonzero, any_zero, any_nonzero;
- for (ii = 0; ii < NUMBER; ii++)
- {
- array[ii] = 0;
- array2[ii] = 5;
- if (ii%2 && ii)
- array3[ii] = (double)(1.0000/(double)ii);
- else
- array3[ii] = (double) ii + 0.00;
- array4[ii] = (double) (1.00000/ (double)(ii+1));
- }
- __asm volatile ("" : "+r" (argc));
- y_int = __sec_reduce_any_nonzero (array3[:] + array[4]);
- y_int2 = __sec_reduce_any_zero (array3[:] + array[4]);
- y = __sec_reduce_all_nonzero ((array3[:] + array4[:]) * (argc-1));
- y2 = __sec_reduce_all_zero ((array3[:] + array4[:]) * (argc-1));
-
- any_zero = 0;
- any_nonzero = 0;
- for (ii = 0; ii < NUMBER; ii++)
- {
- if ((array3[ii] + array[4]) == 0)
- any_zero = 1;
- else
- any_nonzero = 1;
- }
-
- if (any_nonzero != y_int)
- return 1;
- if (any_zero != y_int2)
- return 2;
-
-
- all_zero = 0;
- all_nonzero = 0;
- for (ii = 0; ii < NUMBER; ii++)
- {
- if (((array3[ii] + array4[ii]) * (argc-1)) == 0)
- all_zero = 1;
- else
- all_nonzero = 1;
- }
-
- if (y != all_nonzero)
- return 3;
- if (all_zero != y2)
- return 4;
-
-
-#if HAVE_IO
- for (ii = 0; ii < NUMBER; ii++) {
- printf("%5.3f ", array3[ii] +array4[ii]);
- }
- printf("\n");
- for (ii = 0; ii < NUMBER; ii++) {
- printf("%5.3f ", (array3[ii] + array4[ii]) * (argc-1));
- }
- printf("\n");
- printf("Any Non-zeros (1st line) = %d\t All non-zeros (1st line) = %d\n",
- y_int, y);
- printf("Any zeros (2nd line) = %d\t All zeros (2nd line) = %d\n", y_int2, y2);
-#endif
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c
deleted file mode 100644
index 845d916ab96..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/comma_exp.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#include <stdlib.h>
-
-int main2 (char **argv);
-int main(void)
-{
- int x = 0;
- const char *array[] = {"a.out", "5"};
- x = main2 ((char **)array);
- return x;
-}
-
-int main2 (char **argv)
-{
- int argc = 2;
- int array[10], array2[10], ii = 0, x = 2, z= 0 , y = 0 ;
- __asm volatile ("" : "+r" (argc));
- for (ii = 0; ii < 10; ii++)
- array[ii] = 10;
-
- for (ii = 0; ii < 10; ii++)
- array2[ii] = 1;
-
- array[0:10:1] = (array[:], 15);
-
- for (ii = 0; ii < 10; ii++)
- if (array[ii] != 15)
- return 1;
- array[0:5:2] = (argc+2, 20);
-
- for (ii = 0; ii < 10; ii += 2)
- if (array[ii] != 20)
- return 2;
-
-
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
-
- array[x:5:z] = 50;
-
- array[:] = (atoi(argv[1]), (array2[0:10]+5));
-
- for (ii = 0; ii < 10; ii++)
- if (array[ii] != 6)
- return (3);
-
- array[:] = (atoi(argv[1]), (array2[0:10]+array2[0:10]));
- for (ii = 0; ii < 10; ii++)
- if (array[ii] != 2)
- return 4;
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c
deleted file mode 100644
index 07c50173bfb..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/conditional.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#include <stdlib.h>
-int main(void)
-{
- int argc = 1;
- short array[1000], array2[1000], *array3, cond[1000], ii = 0;
-
- __asm volatile ("" : "+r" (argc));
- for (ii = 0; ii < 1000; ii++) {
- cond[ii] = 1;
- array[ii] = 1000;
- array2[ii] = 2000;
- }
- array2[:] = cond[:] ? array[:] : array2[:];
-
- for (ii = 0; ii < 1000; ii++) {
- if (array2[ii] != 1000)
- return 1;
- }
-
- array2[0:500:2] = cond[0:500] ? array[0:500:1] : array2[0:500:2];
-
- for (ii = 0; ii < 1000; ii++) {
- if (array2[ii] != 1000)
- return 2;
- }
-
- for (ii = 0; ii < 1000; ii++) {
- cond[ii] = ii % 2; /* This should give 0, 1, 0, 1, 0, 1, 0,... */
- array2[ii] = 5;
- array[ii] = 3;
- }
- array3 = (short *) malloc (sizeof (short) * 1000);
- array3[0:1000:argc] = cond[:] ? array[0:(argc * 1000)] : array2[argc-1:1000];
-
- for (ii = 0; ii < 1000; ii++) {
- if ((cond[ii] == 0 && array3[ii] != 5)
- || (cond[ii] == 1 && array3[ii] != 3))
- return 3;
- }
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/decl-ptr-colon.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/decl-ptr-colon.c
deleted file mode 100644
index 4b54f4d06f7..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/decl-ptr-colon.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* { dg-do compile { target c } } */
-/* { dg-options "-fcilkplus" } */
-
-int main(void)
-{
- extern int func(int);
- int array3[:], x, q; /* { dg-error "array notations cannot be used in declaration" } */
- int array3[1:2:x]; /* { dg-error "array notations cannot be used in declaration" } */
- extern char array3[1:func(x)]; /* { dg-error "array notations cannot be used in declaration" } */
- int *a, ***b;
- extern char *c;
- int array2[10];
-
- a[:] = 5; /* { dg-error "start-index and length fields necessary for using array notations in pointers" } */
- c[1:2] = 3; /* This is OK. */
- (array2)[:] = 5; /* This is OK. */
- b[1:2][1:func(x)][:] = 3; /* { dg-error "start-index and length fields necessary for using array notations in pointers" } */
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/dimensionless-arrays.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/dimensionless-arrays.c
deleted file mode 100644
index 690e89a27d7..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/dimensionless-arrays.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* { dg-options "-fcilkplus" } */
-
-extern int a[];
-extern int *b;
-
-void foo()
-{
- a[:] = 5; // { dg-error "start-index and length fields necessary for using array notation" }
- b[:] = 5; // { dg-error "start-index and length fields necessary for using" }
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c
deleted file mode 100644
index 00b018a2c85..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#define NUMBER 1000
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-int func (int *x)
-{
- int q = *x;
- q++;
- *x = q;
-#if HAVE_IO
- printf("%d\n", (q));
-#endif
- return *x;
-}
-int main (void)
-{
- char array[NUMBER], array2[NUMBER];
- int ii, d = 2;
-#if 1
- for (ii = 0; ii < NUMBER; ii++) {
- array[ii] = 5;
- array2[ii]= 2;
- }
-#endif
- d = func (&d); /* d = 1 */
- array2[:] = d * array[:] + (char) func (&d); /* 3 * 5 + 4 */
-#if HAVE_IO
- for (ii = 0; ii < NUMBER; ii++)
- printf("array2[%d] = %d\n", ii, array2[ii]);
-#endif
- for (ii = 0; ii < NUMBER; ii++)
- if (array2[ii] != (3 * 5 + 4))
- return 1;
-
- return 0;
-}
-
-
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c
deleted file mode 100644
index d9f39dd66a8..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/exec-once2.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#ifdef HAVE_IO
-#include <stdio.h>
-#endif
-
-
-int func1(int x)
-{
- /* If x == 2 then it should return 0. */
- return (x - 2);
-}
-
-int func2(int x)
-{
- /* If x == 2 then it should return 1000. */
- return (x * 500);
-}
-
-int func3 (int x)
-{
- /* If x == 2 then it should return 1. */
- /* If x == 1 then it should return 0. */
- return (x-1);
-}
-
-int func4(int x)
-{
- if (x > 0)
- return x;
- else
- return x--;
-}
-
-
-/* This program makes an assumption that argc == 1. */
-int main (void)
-{
- int argc = 1;
- int array[2500];
-
- /* This is done to make sure the compiler does not optimize out argc. */
- __asm volatile ("" : "+r" (argc));
- /* This should set array[0->999] to 5. */
- array[argc-1:func2(++argc):1] = 5;
- array[1000:500:1] = 10; /* set all variables in array[1000-->1499] to 10. */
- array[1500:500:1] = 15; /* set all variables in array[1500-->1999] to 15. */
- array[2000:500:1] = 20; /* set all variables in array[2000-->2499] to 20. */
- array[2000:500:1] = 25; /* set all variables in array[2500-->2999] to 25. */
- array[2000:500:1] = 30; /* set all variables in array[3000-->3499] to 30. */
-
- argc = func3 (argc); /* This will set argc back to 1. */
-#if HAVE_IO
- printf("argc = %d\n", argc);
-#endif
- /* If the parameters inside the function get evaluated only once, then this
- if statement must work fine, i.e. the triplet values will be 0, 1000, 1.
-
- Otherwise, the program should crash or give some uneasy value. */
-
- /* If done correctly, it should boil down to: array[0:1000:1]. */
- if (array[func3(argc):func2(++argc)] != 5) {
-#ifdef HAVE_IO
- printf ("Should not be there(1).\n");
-#endif
- return 1;
- }
-
- /* If done correctly, it should boil down to: array[999:500:-1]. */
- if (func4(array[func2(argc)-1:func2(argc--):func1(argc)]) != 5) {
-#ifdef HAVE_IO
- printf ("Should not be there(2).\n");
-#endif
- return 2;
- }
-
- /* If done correctly, it should boil down to: array[1000:500:1]. */
- if (func4 (func4(array[func2(argc++):500: func1(argc--)])) != 5) {
-#ifdef HAVE_IO
- printf ("Should not be there(3).\n");
-#endif
- return 3;
- }
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr-2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr-2.c
deleted file mode 100644
index 4e1990fcc34..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr-2.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-typedef void (*f) (void *);
-f b[1024];
-void *c[1024][1024];
-
-int
-main (void)
-{
- (b[:]) (c[:][:]); /* { dg-error "rank mismatch" "" { xfail *-*-* } } */
- return 0;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c
deleted file mode 100644
index fa6d9003a00..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/fn_ptr.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-typedef int (*foo)(int);
-
-int main(void)
-{
- int array[10], array2[10][10];
- foo func_array[10];
- foo func_array2[10][10];
- foo ***func_array_ptr;
- int argc = 5;
-
- array[:] = func_array[:](10);
- func_array[0:5](10);
- func_array2[0:5][:](10);
- array2[0:5][:] = func_array2[0:5][:](10);
- func_array_ptr[0:5][0:4][0:argc:2](argc);
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c
deleted file mode 100644
index b2ac7bcc85a..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/fp_triplet_values.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-float q;
-
-void func (int *x)
-{
- *x = 5;
-}
-
-int main (void)
-{
- int array[10], array2[10];
- array2[:] = array[1.5:2]; /* { dg-error "start-index of array notation triplet is not an integer" } */
- array2[:] = array[1:2.32333333333]; /* { dg-error "length of array notation triplet is not an integer" } */
- array2[1:2:1.5] = array[:]; /* { dg-error "stride of array notation triplet is not an integer" } */
- func (&array2[1:2.34:3]); /* { dg-error "length of array notation triplet is not an integer" } */
- array2[1.43:9]++; /* { dg-error "start-index of array notation triplet is not an integer" } */
- array2[1:9.3]++; /* { dg-error "length of array notation triplet is not an integer" } */
- array2[1:9:0.3]++; /* { dg-error "stride of array notation triplet is not an integer" } */
-
- ++array2[1:q:3]; /* { dg-error "length of array notation triplet is not an integer" } */
- array2[:] = array[q:1:3]; /* { dg-error "start-index of array notation triplet is not an integer" } */
- array2[:] = array[1:q:3]; /* { dg-error "length of array notation triplet is not an integer" } */
- array2[:] = array[1:3:q]; /* { dg-error "stride of array notation triplet is not an integer" } */
- func (&array2[1:q:3]); /* { dg-error "length of array notation triplet is not an integer" } */
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
deleted file mode 100644
index f425fbec0f5..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather-scatter-errors.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- extern int func (int);
- int array[10][10], array2[10];
- int argc = 1;
- array2[array[:][:]] = 5; /* { dg-error "rank of the array's index is greater than 1" } */
-
- array2[array[:][:]] = 5; /* { dg-error "rank of the array's index is greater than 1" } */
- func (array2[array[:][:]]); /* { dg-error "rank of the array's index is greater than 1" } */
- func (array2[array[argc:func(5)][0:10:2]]); /* { dg-error "rank of the array's index is greater than 1" } */
-
- array[array2[:]][array2[:]] = 5; /* This is OK. */
- array[array2[:]][array2[:]] = array2[array[:][:]]; /* { dg-error "rank of the array's index is greater than 1" } */
- array[array2[:]][array2[:]] = array2[array[0:10:1][:]]; /* { dg-error "rank of the array's index is greater than 1" } */
- array[array2[:]][array2[:]] = array2[array[:][argc:func (argc)]]; /* { dg-error "rank of the array's index is greater than 1" } */
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c
deleted file mode 100644
index faee3fcebf6..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/gather_scatter.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#define NUMBER 20
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-float array4[NUMBER][NUMBER][NUMBER][NUMBER];
-int main(void)
-{
- int array[NUMBER][NUMBER], array2[NUMBER], array3[NUMBER], x = 0, y;
- int x_correct, y_correct, ii, jj = 0, kk = 0, ll = 0;
- for (ii = 0; ii < NUMBER; ii++)
- {
- for (jj = 0; jj < NUMBER; jj++)
- {
- array[ii][jj] = 1+ii;
- array2[ii]= 2;
- array3[ii]= 3;
- }
- }
-
- array[array2[:]][array3[:]] = 1000;
-
- for (ii = 0; ii < NUMBER; ii++)
- if (array[array2[ii]][array3[ii]] != 1000)
- return 1;
-
-#if HAVE_IO
- for (ii = 0; ii < NUMBER; ii++) {
- for (jj = 0; jj < NUMBER; jj++) {
- printf("%4d\t", array[ii][jj]);
- }
- printf("\n");
- }
-#endif
-
- array4[array2[:]][array3[0:NUMBER:1]][array2[0:NUMBER:1]][array3[0:NUMBER:1]] =
- (float)array[array2[:]][array3[:]];
-
- for (ii = 0; ii < NUMBER; ii++)
- if (array4[array2[ii]][array3[ii]][array2[ii]][array3[ii]] !=
- (float)array[array2[ii]][array3[ii]])
- return 2;
-
-#if HAVE_IO
- for (ii = 0; ii < NUMBER; ii++) {
- for (jj = 0; jj < NUMBER; jj++) {
- for (kk = 0; kk < NUMBER; kk++) {
- for (ll = 0; ll < NUMBER; ll++) {
- printf("%4d\n", array4[ii][jj][kk][ll]);
- }
- }
- }
- }
-#endif
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c
deleted file mode 100644
index 4e5b1583778..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-#include <stdlib.h>
-int main2 (char **argv);
-int main(int argc, char **argv)
-{
- int x = 0;
- const char *array[] = {"a.out", "10", "15"};
- x = main2 ((char **) array);
- return x;
-}
-
-
-int main2 (char **argv)
-{
- int x = 3, y, z, array[10], array2[10], TwodArray[10][10], jj,kk,ll ;
- int array2_check[10], array2d_check[10][10], array2d[10][10];
- int FourDArray[10][10][10][10], array4[10][10][10][10];
- int array4_check[10][10][10][10];
- int ii = 0, argc = 3;
-
- __asm volatile ("" : "+r" (argc));
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = argc%3;
- array2[ii]= 10;
- array2_check[ii] = 10;
- }
-
- if (!array[:])
- array2[:] = 5;
- else
- array2[:] = 10;
-
-
- for (ii = 0; ii < 10; ii++)
- {
- if (!array[ii])
- array2_check[ii] = 5;
- else
- array2_check[ii] = 10;
- }
-
- for (ii = 0; ii < 10; ii++)
- if (array2_check[ii] != array2[ii])
- return 2;
-
-
-
- if (!(array[0:10:1] + array[0:10:1]))
- array2[:] = 5;
- else
- array2[:] = 10;
-
- for (ii = 0; ii < 10; ii++)
- {
- if (!(array[ii]+ array[ii]))
- array2_check[ii] = 5;
- else
- array2_check[ii] = 10;
- }
-
- for (ii = 0; ii < 10; ii++)
- if (array2_check[ii] != array2[ii])
- return 3;
-
- x = atoi (argv[1])-10;
- y = atoi (argv[1])/2;
- z = (atoi (argv[1]))/5;
-
- for (ii = 0; ii < 10; ii++)
- {
- if (ii % 2)
- array[ii] = 0;
- else
- array[ii] = 1;
- }
-
- /*printf("x = %2d y = %2d z = %2d\n", x, y, z); */
-
- for (ii = 0; ii < 10; ii++)
- array[ii] = 10;
-
- /* This if loop will change all the 10's to 5's */
- if (array[x:y:z] != 9)
- array2[:] = 5;
- else
- array2[:] = 10;
-
- for (ii = x; ii < (x+y); ii += z)
- {
- if (array[ii] != 9)
- array2_check[ii] = 5;
- else
- array2_check[ii] = 10;
- }
-
- for (ii = 0; ii < 10; ii++)
- if (array2_check[ii] != array2[ii])
- return 4;
-
- for (ii = 0; ii < 10; ii++) {
- array2[ii] = 10;
- array2_check[ii] = 10;
- }
-
- /* This if loop will change all the 10's to 5's */
- if (array[atoi(argv[1])-10:atoi(argv[1])/2: atoi(argv[1])/5])
- array2[atoi(argv[1])-10: atoi (argv[1])/2: atoi(argv[1])/5] = 5;
- else
- array2[atoi(argv[1])-10: atoi (argv[1])/2: atoi(argv[1])/5] = 10;
-
- for (ii = atoi(argv[1])-10; ii < atoi(argv[1]) + (atoi (argv[1])-10);
- ii +=atoi(argv[1])/5)
- if (array[ii])
- array2_check[ii] = 5;
- else
- array2_check[ii] = 10;
-
- for (ii = 0; ii < 10; ii++)
- if (array2_check[ii] != array2[ii]) {
-#if HAVE_IO
- printf("array2[%2d] = %2d array2_check[%2d] = %2d\n", ii, array2[ii],
- ii, array2_check[ii]);
-#endif
- return 5;
- }
-
- for (ii = 0; ii < 10; ii++)
- for (jj = 0; jj < 10; jj++)
- TwodArray[ii][jj] = atoi(argv[1]);
-
-
- for (ii = 0; ii < 10; ii++)
- for (ii = 0; ii < 10; ii++) {
- array2d[ii][jj] = 10;
- array2d_check[ii][jj] = 10;
- }
-
- /* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
- if (TwodArray[:][:] != 10)
- array2d[:][:] = 10;
- else
- array2d[:][:] = 5;
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj < 10; jj++) {
- if (TwodArray[ii][jj] != 10)
- array2d_check[ii][jj] = 10;
- else
- array2d_check[ii][jj] = 5;
- }
- }
-
- for (ii = 0; ii < 10; ii++)
- for (jj = 0; jj < 10; jj++)
- if (array2d[ii][jj] != array2d_check[ii][jj])
- return 6;
-
- for (ii = 0; ii < 10; ii++)
- for (jj = 0; jj < 10; jj++)
- for (kk = 0; kk < 10; kk++)
- for (ll = 0; ll < 10; ll++)
- {
- array4[ii][jj][kk][ll] = 10;
- array4_check[ii][jj][kk][ll] = 10;
- }
-
- for (ii = 0; ii < 10; ii++)
- for (jj = 0; jj < 10; jj++)
- for (kk = 0; kk < 10; kk++)
- for (ll = 0; ll < 10; ll++)
- FourDArray[ii][jj][kk][ll] = atoi(argv[1]);
-
- /* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
- if (FourDArray[:][:][:][:] != 10)
- array4[:][:][:][:] = 10;
- else
- array4[:][:][:][:] = 5;
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj < 10; jj++) {
- for (kk = 0; kk < 10; kk++) {
- for (ll = 0; ll < 10; ll++) {
- if (FourDArray[ii][jj][kk][ll] != 10)
- array4_check[ii][jj][kk][ll] = 10;
- else
- array4_check[ii][jj][kk][ll] = 5;
- }
- }
- }
- }
-
- for (ii = 0; ii < 10; ii++)
- for (jj = 0; jj < 10; jj++)
- for (kk = 0; kk < 10; kk++)
- for (ll = 0; ll < 10; ll++)
- if (array4_check[ii][jj][kk][ll] != array4[ii][jj][kk][ll])
- return 7;
-
- for (ii = 0; ii < 10; ii++)
- for (jj = 0; jj < 10; jj++)
- for (kk = 0; kk < 10; kk++)
- for (ll = 0; ll < 10; ll++)
- {
- array4[ii][jj][kk][ll] = 10;
- array4_check[ii][jj][kk][ll] = 10;
- }
-
- for (ii = 0; ii < 10; ii++)
- for (jj = 0; jj < 10; jj++)
- for (kk = 0; kk < 10; kk++)
- for (ll = 0; ll < 10; ll++)
- FourDArray[ii][jj][kk][ll] = atoi(argv[1]);
-
- /* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
- if (FourDArray[0:10:1][0:5:2][9:10:-1][0:5:2] != 10)
- array4[0:10:1][0:5:2][9:10:-1][0:5:2] = 10;
- else
- array4[0:10:1][0:5:2][9:10:-1][0:5:2] = 5;
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj < 10; jj += 2) {
- for (kk = 9; kk >= 0; kk--) {
- for (ll = 0; ll < 10; ll += 2) {
- if (FourDArray[ii][jj][kk][ll] != 10)
- array4_check[ii][jj][kk][ll] = 10;
- else
- array4_check[ii][jj][kk][ll] = 5;
- }
- }
- }
- }
-
- for (ii = 0; ii < 10; ii++)
- for (jj = 0; jj < 10; jj++)
- for (kk = 0; kk < 10; kk++)
- for (ll = 0; ll < 10; ll++)
- if (array4_check[ii][jj][kk][ll] != array4[ii][jj][kk][ll]) {
-#if HAVE_IO
- printf("array4_check[%d][%d][%d][%d] = %d\n",ii, jj, kk, ll,
- array4_check[ii][jj][kk][ll]);
- printf("array4[%d][%d][%d][%d] = %d\n",ii, jj, kk, ll,
- array4[ii][jj][kk][ll]);
-#endif
- return 8;
- }
-
- for (ii = 0; ii < 10; ii++)
- for (jj = 0; jj < 10; jj++)
- for (kk = 0; kk < 10; kk++)
- for (ll = 0; ll < 10; ll++)
- FourDArray[ii][jj][kk][ll] = atoi(argv[1]);
-
- for (ii = 0; ii < 10; ii++)
- for (jj = 0; jj < 10; jj++)
- for (kk = 0; kk < 10; kk++)
- for (ll = 0; ll < 10; ll++)
- {
- array4[ii][jj][kk][ll] = 10;
- array4_check[ii][jj][kk][ll] = 10;
- }
-
-
- /* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
- if (FourDArray[0:10:1][0:5:2][9:10:-1][x:y:z] +
- FourDArray[0:10:1][0:5:2][9:10:-1][x:y:z] != 20)
- array4[0:10:1][0:5:2][9:10:-1][x:y:z] = 10;
- else
- array4[0:10][0:5:2][9:10:-1][x:y:z] = 5;
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj < 10; jj += 2) {
- for (kk = 9; kk >= 0; kk--) {
- for (ll = 0; ll < 10; ll += 2) {
- if (FourDArray[ii][jj][kk][ll] != 10)
- array4_check[ii][jj][kk][ll] = 10;
- else
- array4_check[ii][jj][kk][ll] = 5;
- }
- }
- }
- }
-
- for (ii = 0; ii < 10; ii++)
- for (jj = 0; jj < 10; jj++)
- for (kk = 0; kk < 10; kk++)
- for (ll = 0; ll < 10; ll++)
- if (array4_check[ii][jj][kk][ll] != array4[ii][jj][kk][ll]) {
-#if HAVE_IO
- printf("array4_check[%d][%d][%d][%d] = %d\n",ii, jj, kk, ll,
- array4_check[ii][jj][kk][ll]);
- printf("array4[%d][%d][%d][%d] = %d\n",ii, jj, kk, ll,
- array4[ii][jj][kk][ll]);
-#endif
- return 9;
- }
-
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test_errors.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test_errors.c
deleted file mode 100644
index 579d396948e..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/if_test_errors.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-#include <stdlib.h>
-int main (void)
-{
- int x = 3, y, z, array[10], array2[10], TwodArray[10][10], jj,kk,ll ;
- int array2_check[10], array2d_check[10][10], array2d[10][10];
- int FourDArray[10][10][10][10], array4[10][10][10][10];
- int array4_check[10][10][10][10];
- int ii = 0;
-
- x = 5;
- y = 10;
- z = 2;
-
- if (!array[:]) /* This is OK! */
- array2[:] = 5;
- else
- array2[:] = 10;
- if (!(array[0:10:1] + array[0:10:1])) /* { dg-error "condition and the then-block" "" { target c } } */
- array2d[:][:] = 5; /* { dg-error "rank mismatch with controlling expression of parent" "" { target c++ } } */
- else
- array2[:] = 10;
-
- if (!(array[0:10:1] + array[0:10:1])) /* { dg-error "condition and the else-block" "" { target c } } */
- array2[:] = 5;
- else
- array2d[:][:] = 10; /* { dg-error "rank mismatch with controlling expression of parent" "" { target c++ } } */
-
-
- if (TwodArray[:][:] != 10) /* { dg-error "condition and the then-block" "" { target c } } */
- array2[:] = 10; /* { dg-error "rank mismatch with controlling expression of parent" "" { target c++ } } */
- else
- array2[:] = 5;
-
- if (FourDArray[43][:][:][:] != 10) /* This is OK! */
- array4[45][:][:][:] = 10;
- else
- array4[32][:][:][:] = 5;
-
- /* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
- if (FourDArray[42][0:10:1][9:10:-1][0:5:2] != 10) /* { dg-error "condition and the then-block" "" { target c } } */
- array4[0:10:1][0:5:2][9:10:-1][0:5:2] = 10; /* { dg-error "rank mismatch with controlling expression of parent" "" { target c++ } } */
- else
- array4[0:10:1][0:5:2][9:10:-1][0:5:2] = 5;
-
- /* atoi(argv[1]) == 10, so it will convert all 10's to 5's */
- if (FourDArray[0:10:1][0:5:2][9:10:-1][x:y:z] +
- FourDArray[0:10:1][0:5:2][9:-10:1][x:y:z] != 20)
- array4[0:10:1][0:5:2][9:10:-1][x:y:z] = 10;
- else
- array4[0:10][0:5:2][9:10:-1][x:y:z] = 5;
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c
deleted file mode 100644
index dcc414f1209..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/misc.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- int array[10], array2[10][10];
- int x, ii, jj ;
-
- switch (array[:]) { /* { dg-error "cannot be used as a condition for switch statement" } */
- case 1:
- x = 5;
- break;
- case 2:
- x = 2;
- break;
- default:
- x = 9;
- }
-
- switch (array2[:][:]) { /* { dg-error "cannot be used as a condition for switch statement" } */
- case 1:
- x = 5;
- break;
- case 2:
- x = 2;
- break;
- default:
- x = 9;
- }
-
- switch (array[:] + x) { /* { dg-error "cannot be used as a condition for switch statement" } */
- case 1:
- x = 5;
- break;
- case 2:
- x = 2;
- break;
- default:
- x = 9;
- }
-
- switch (array2[:][1:x:4] + x) { /* { dg-error "cannot be used as a condition for switch statement" } */
- case 1:
- x = 5;
- break;
- case 2:
- x = 2;
- break;
- default:
- x = 9;
- }
-
- for (ii = 0; ii < array[:]; ii++) /* { dg-error "cannot be used in a condition for a for-loop" } */
- {
- x = 2;
- }
-
- for (ii = 0; ii < array2[:][:]; ii++) /* { dg-error "cannot be used in a condition for a for-loop" } */
- {
- x = 3;
- }
-
- for (; array2[:][:] < 2;) /* { dg-error "cannot be used in a condition for a for-loop" } */
- x = 4;
-
-
- while (array2[:][:]) /* { dg-error "cannot be used as a condition for while statement" } */
- x = 3;
-
- while (array[1:1:1]) /* { dg-error "cannot be used as a condition for while statement" } */
- x = 1;
-
- while (ii != array2[1:x:3][1:2:1]) /* { dg-error "cannot be used as a condition for while statement" } */
- x = 2;
-
- do {
- x = 3;
- } while (ii != array2[:][:]); /* { dg-error "cannot be used as a condition for a do-while statement" } */
-
- do {
- x = 2;
- } while (ii != (x + array2[:][1:x:2]) + 2); /* { dg-error "cannot be used as a condition for a do-while statement" } */
-
- do {
- x += 3;
- if (x == 5)
- return array2[:][:]; /* { dg-error "array notation expression cannot be used as a return value" } */
- } while (ii != 0);
-
- for (ii = 0; ii < 10; ii++)
- if (ii % 2)
- return array[1:x:ii]; /* { dg-error "array notation expression cannot be used as a return value" } */
-
- for (ii = 0; ii < x; ii++)
- if (ii)
- return array2[:][:]; /* { dg-error "array notation expression cannot be used as a return value" } */
-
- for (array[:] = 0; ii < x; ii++) /* This should be OK. */
- x= 2;
-
- for (ii = 0; ii < 10; array[:]++) /* This is OK. */
- x = 5;
-
- for (jj = 0; jj < 10; array2[:][:]++) /* This is OK. */
- x = 3;
-
- for (jj = 0; jj < 10; array2[:][1:x:4]++, jj++) /* This is OK. */
- x = 3;
-
- return x;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/n-ptr-test.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/n-ptr-test.c
deleted file mode 100644
index 750446c87d2..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/n-ptr-test.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#define NUMBER 10
-#include <stdlib.h>
-
-int ***func2 (int ***a1, int ***a2, int size)
-{
- a1[0:size:1][0:size:1][0:size] += (a2[0:size][0:size][0:size:1] + size);
- return a1;
-}
-
-int main (void)
-{
- int ii, jj, kk;
- int ***array3, ***array2 = NULL, ***array = NULL;
-
- array = (int ***) malloc (sizeof (int **) * NUMBER);
- array2 = (int ***) malloc (sizeof (int **) * NUMBER);
- for (ii = 0; ii < NUMBER; ii++) {
- array[ii] = (int **) malloc (sizeof (int *) * NUMBER);
- array2[ii] = (int **) malloc (sizeof (int *) * NUMBER);
- for (jj = 0; jj < NUMBER; jj++) {
- array[ii][jj] = (int *) malloc (sizeof (int) * NUMBER);
- array2[ii][jj] = (int *) malloc (sizeof (int) * NUMBER);
- }
- }
-
- for (ii = 0; ii < NUMBER; ii++) {
- for (jj = 0; jj < NUMBER; jj++) {
- for (kk = 0; kk < NUMBER; kk++) {
- array[ii][jj][kk] = 5;
- array2[ii][jj][kk]= 2;
- }
- }
- }
- array3 = func2 ((int ***)array, (int ***)array2, NUMBER);
-
- for (ii = 0; ii < NUMBER; ii++) {
- for (jj = 0; jj < NUMBER; jj++) {
- for (kk = 0; kk < NUMBER; kk++) {
- if (array3[ii][jj][kk] != (7 + NUMBER))
- return 1;
- }
- }
- }
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c
deleted file mode 100644
index fd4fe5419b6..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- int array[10][10], array2[10];
-
- array2[:] = array2[: ; /* { dg-error "expected ']'" } */
-
- return 0; /* { dg-error "expected ';' before" "" { target c } } */
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c
deleted file mode 100644
index d003d7cc2bb..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors2.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- int array[10][10], array2[10];
-
- array2[:] = array2[1:2:] ; /* { dg-error "expected expression before" "" { target c } } */
- /* { dg-error "expected primary-expression before" "" { target c++ } .-1 } */
- /* { dg-error "expected ';' before" "" { target c } .-2 } */
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c
deleted file mode 100644
index 14256e9579e..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors3.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- int array[10][10], array2[10];
-
- array2[:] = array2[1: :] ; /* { dg-error "expected expression before" "" { target c } } */
- /* { dg-error "expected primary-expression before" "" { target c++ } .-1 } */
- /* { dg-error "expected ';' before" "" { target c } .-2 } */
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c
deleted file mode 100644
index a0efc04d25e..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/parser_errors4.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- int array[10][10], array2[10];
-
- array2[:] = array2[ : : ] ; /* { dg-error " expected ']' before ':' token" } */
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457-2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457-2.c
deleted file mode 100644
index ac11b9209b1..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457-2.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-/* Test-case contains no array notation but is compiled with -fcilkplus.
- It will still print the too few arguments func, thereby saying the
- if-statement after the for-loop to check for !flag_enable_cilkplus ||
- !is_cilkplus_reduce_function (fundecl) is not valid is always taken. */
-
-int func (int, int); /* { dg-message "declared here" } */
-
-int main (void)
-{
- int a = 5, b = 2;
- return func (a); /* { dg-error "too few arguments to function" } */
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457.c
deleted file mode 100644
index 68a1fd81185..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57457.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-/* This test has no array notation components in it and thus should compile
- fine without crashing. */
-
-typedef unsigned int size_t;
-typedef int (*__compar_fn_t) (const void *, const void *);
-extern void *bsearch (const void *__key, const void *__base,
- size_t __nmemb, size_t __size, __compar_fn_t
- __compar)
- __attribute__ ((__nonnull__ (1, 2, 5))) ;
-extern __inline __attribute__ ((__gnu_inline__)) void *
-bsearch (const void *__key, const void *__base, size_t __nmemb, size_t
- __size,
- __compar_fn_t __compar)
-{
- size_t __l, __u, __idx;
- const void *__p;
- int __comparison;
- __l = 0;
- __u = __nmemb;
- while (__l < __u)
- {
- __idx = (__l + __u) / 2;
- __p = (void *) (((const char *) __base) +
- (__idx * __size));
- __comparison = (*__compar) (__key,
- __p);
- if (__comparison < 0)
- __u = __idx;
- else if (__comparison > 0)
- __l = __idx + 1;
- else
- return (void *)
- __p;
- }
- return ((void *)0);
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57490.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57490.c
deleted file mode 100644
index db38b30b5f3..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57490.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-const int n = 8;
-float x[8], y[8], z[8];
-int main() {
- int i = 0;
- float x_sum =0;
- for(i=1; i<=5; i+=4 ) {
- x[0:n] = 3;
- y[0:n] = i;
- z[0:n] = 0;
- (void)((__sec_reduce_add(x[0:n])==3*n) || (__builtin_abort (), 0));
- (void)((__sec_reduce_add(y[0:n])==i*n) || (__builtin_abort (), 0));
- (void)((__sec_reduce_add(z[0:n])==0) || (__builtin_abort (), 0));
-
- if (x[0:n] >= y[0:n]) {
- z[0:n] = x[0:n] - y[0:n];
- } else {
- z[0:n] = x[0:n] + y[0:n];
- }
- (void)((__sec_reduce_add(x[0:n])==3*n) || (__builtin_abort (), 0));
- (void)((__sec_reduce_add(y[0:n])==i*n) || (__builtin_abort (), 0));
- (void)((__sec_reduce_add(z[0:n])==(3>=i?3-i:3+i)*n)
- || (__builtin_abort (), 0));
- }
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541-2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541-2.c
deleted file mode 100644
index 89a3d57ebdd..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541-2.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* PR middle-end/57541 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-void foo1 ()
-{
- int a;
- a = __sec_reduce_add (1); /* { dg-error "Invalid builtin arguments" } */
-}
-
-void foo2 ()
-{
- int a;
- a = __sec_reduce_add (); /* { dg-error "Invalid builtin arguments" } */
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c
deleted file mode 100755
index b47de1e7ebc..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* PR middle-end/57541 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int A[10];
-
-void foo () {
- /* C compiler uses the term "undeclared" whereas C++ compiler uses
- "not declared". Thus, grepping for declared seem to be the easiest. */
- char c = (char)N; /* { dg-error "declared" } */
- /* { dg-message "note: each" "defined" { target c } .-1 } */
- short s = (short)N;
- long l = (long)N;
- A[l:s:c];
-}
-
-void foo1 (int N) {
- char c = (char)N;
- short s = (short)N;
- A[l:s:c]; /* { dg-error "declared" } */
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57577.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57577.c
deleted file mode 100644
index 98ab9e1665e..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57577.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-#define NUMBER 100
-int A[NUMBER], B[NUMBER][NUMBER];
-int foo (int a);
-
-int main () {
- A[:] = foo (B[:][:]); /* { dg-error "rank mismatch between" } */
- A[0] = foo (B[:][:]); /* { dg-error "cannot be scalar when" } */
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr58942.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr58942.c
deleted file mode 100644
index 87903af3c86..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr58942.c
+++ /dev/null
@@ -1,8 +0,0 @@
-/* PR c/58942 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int foo (int*p, int i)
-{
- return __sec_reduce_max_ind(p[1:i]);
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c
deleted file mode 100644
index 8c32ad9a267..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* PR c/61191 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-double f(double * A, double * B)
-{
- return __sec_reduce_add((B[0:500])(; /* { dg-error "called object" "" { target c } } */
-/* { dg-error "expected expression before ';' token" "" { target c } .-1 } */
-/* { dg-error "expected primary-expression before ';' token" "" { target c++ } .-2 } */
-/* { dg-error "expected" "" { target c } .-3 } */
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455-2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455-2.c
deleted file mode 100644
index 60b424873d9..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455-2.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* PR c++/61455 */
-/* { dg-options "-fcilkplus" } */
-
-int a[3] = {2, 3, 4};
-
-int main ()
-{
- int c = 10;
- int b = __sec_reduce_add(a[:]);
- if (b+c != 19)
- __builtin_abort();
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455.c
deleted file mode 100644
index 35a11b66c91..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61455.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/* PR c++/61455 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-void foo ()
-{
- int a[2];
- int b = a[:]; /* { dg-error "cannot be scalar" } */
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c
deleted file mode 100644
index 08d4fe23628..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* PR other/61962 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-struct FloatStruct
-{
- float *f;
-};
-
-/* Either SRC or DST must be a struct, otherwise the bug does not occur. */
-void f (struct FloatStruct* dst, float *src, unsigned int length)
-{
- dst->f[0:length] = src[0:length];
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c
deleted file mode 100644
index 205671a5b50..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/* PR other/61963 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-void f (int * int *a) /* { dg-error "expected" } */
-{
- a[0:64] = 0; /* { dg-error "was not declared" "" { target c++ } } */
- a[0:64] = 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr62008.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr62008.c
deleted file mode 100644
index eec57dc0359..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr62008.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* PR other/62008 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-void f(int *a, int w, int h)
-{
- int tmp[w][h];
- tmp[:][:] = a[0:w][0:h]; /* { dg-error "base of array section must be pointer or array type" } */
- /* { dg-error "start-index and length fields necessary" "" { target c } .-1 } */
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr63884.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr63884.c
deleted file mode 100644
index c876a8dec00..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr63884.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* PR middle-end/63884 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int
-foo (int x, int y)
-{
- int r;
- return __builtin_sadd_overflow (x, y, &r);
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c
deleted file mode 100644
index 29dee807396..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -w" } */
-
-/* We use -w because in the first error, there will be a warning of setting an
- integer to a pointer. Just ignore it to expose the rank mismatch error. */
-
-int main (void)
-{
- int x = 0;
- int array[10][10], array2[10];
-
- array[:][:] = array[:]; /* { dg-error "rank mismatch between" } */
- /* { dg-error "invalid conversion" "" { target c++ } .-1 } */
-
- x = array2[:]; /* { dg-error "cannot be scalar when" } */
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c
deleted file mode 100644
index 4a4882dbae6..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch2.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int function_call (int x);
-int function_call (int x)
-{
- return x;
-}
-
-int main (void)
-{
- int array[100], array2[100][100];
- int argc = 4;
- array[:] = array[:] + array2[:][:]; /* { dg-error "rank mismatch between" } */
-
- if (array[:] + array2[:][:]) /* { dg-error "rank mismatch between" } */
- return argc == 5;
-
- argc += function_call (array[:] + array2[5:10:2][:]); /* { dg-error "rank mismatch between" } */
-
- argc += function_call (function_call (array[:] + array2[5:10:2][:])); /* { dg-error "rank mismatch between" } */
-
- argc += __sec_reduce_add (array[:], array2[:][:]); /* { dg-error "rank mismatch between" } */
-
- argc += __sec_reduce_add (array2[:][:]) + argc; /* This is OK. */
- return argc;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch3.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch3.c
deleted file mode 100644
index de335922f8a..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch3.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* { dg-options "-fcilkplus" } */
-
-int funct (int x, int y);
-void funct_void (int x, int y, int z);
-int main(void)
-{
- int y, array[100], array2[100], array3[100][100], array4[100];
-
- array[:] = ((array2[:] + array[:]) * array4[:]) + array3[:][:]; /* { dg-error "rank mismatch between" } */
- array[:] = funct (array2[:], array3[:][:]); /* { dg-error "rank mismatch between" } */
- array[:] = array3[:][:]; /* { dg-error "rank mismatch between" } */
- array3[:][:] = array[:]; /* { dg-error "rank mismatch between" } */
- array3[:][:] = array[5]; /* This is OK! */
- funct_void (array2[:], array3[:][:], array[:]); /* { dg-error "rank mismatch between" } */
- funct_void (array2[:], array3[:][:], array[:]); /* { dg-error "rank mismatch between" } */
- funct_void (array3[:][:], array2[:], array[:]); /* { dg-error "rank mismatch between" } */
- funct_void (array2[:], array[:], array3[:][0:10:1]); /* { dg-error "rank mismatch between" } */
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c
deleted file mode 100644
index bacbf350566..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- int array[10][10], array2[10];
-
- array[:][:] = __sec_implicit_index(5) + array[:][:]; /* { dg-error "__sec_implicit_index argument" } */
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c
deleted file mode 100644
index 0aef0c29aca..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit2.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- int argc = 2;
- int array[10][10], array2[10];
- __asm volatile ("" : "+r" (argc));
- array[:][:] = __sec_implicit_index(argc) + array[:][:]; /* { dg-error "__sec_implicit_index parameter" } */
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c
deleted file mode 100644
index 419799a3b2b..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_implicit_ex.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#define NUMBER 20
-
-int main(void)
-{
- int jj, kk, array_3C[NUMBER][NUMBER][NUMBER];
- int ii,array[NUMBER], y = 0, y_int = 0, array2[NUMBER],
- array_3[NUMBER][NUMBER][NUMBER];
- double x, yy, array3[NUMBER], array4[NUMBER];
-
- array[:] = __sec_implicit_index (0);
- array_3[:][:][:] = __sec_implicit_index (1) + __sec_implicit_index(0) +
- __sec_implicit_index (2);
-
- for (ii = 0; ii < NUMBER; ii++)
- for (jj = 0; jj < NUMBER; jj++)
- for (kk = 0; kk < NUMBER; kk++)
- array_3C[ii][jj][kk] = ii+jj+kk;
-
- for (ii = 0; ii < NUMBER; ii++)
- for (jj = 0; jj < NUMBER; jj++)
- for (kk = 0; kk < NUMBER; kk++)
- if (array_3[ii][jj][kk] != array_3C[ii][jj][kk])
- return 1;
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c
deleted file mode 100644
index 34c6f12846d..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_ind_same_value.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-int A[256];
-
-int main () {
- A[:] = 2;
- int max_index = 0, min_index = 0;
-
- max_index = __sec_reduce_max_ind (A[:]);
-
- if (max_index != 255)
- return 1;
-
- min_index = __sec_reduce_min_ind (A[:]);
- if (min_index != 255)
- return 2;
-
- return 0;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c
deleted file mode 100644
index 9652e1594b4..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- int array[10][10], array2[10];
- int x, y;
- x = __sec_reduce_max_ind (array[:][:]); /* { dg-error "cannot have arrays with dimension greater than" } */
-
- y = __sec_reduce_max_ind (array2[:]); /* this should be OK. */
-
- x = __sec_reduce_min_ind (array[:][:]); /* { dg-error "cannot have arrays with dimension greater than" } */
-
- y = __sec_reduce_min_ind (array2[:]); /* this should be OK. */
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c
deleted file mode 100644
index 034017146f3..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/sec_reduce_return.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-int add_all (int *my_array, int size)
-{
- return __sec_reduce_add (my_array[0:size]);
-}
-
-int mult_all (int *my_array, int size)
-{
- return __sec_reduce_mul (my_array[0:size]);
-}
-
-int main (void)
-{
- int argc = 1;
- int array[10000];
-
- __asm volatile ("" : "+r" (argc));
- array[:] = argc; /* All elements should be one. */
-
- if (add_all (array, 10000) != 10000)
- return 1;
-
- if (mult_all (array, 10000) != 1)
- return 2;
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/side-effects-1.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/side-effects-1.c
deleted file mode 100644
index 8b0034e727b..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/side-effects-1.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-/* Test that the array index, limit, and stride are evaluated only
- once. */
-
-int array[1000];
-
-int func1_times = 0;
-int func2_times = 0;
-int func3_times = 0;
-int func1() { func1_times++; return 0; }
-int func2() { func2_times++; return 0; }
-int func3() { func3_times++; return 0; }
-
-int main()
-{
- array[func1() + 11 : func2() + 22 : func3() + 33] = 666;
-
- if (func1_times != 1
- || func2_times != 1
- || func3_times != 1)
- return 1;
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c
deleted file mode 100644
index b9f9f8d6507..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/test_builtin_return.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* { dg-options "-lm -fcilkplus" } */
-/* { dg-do run } */
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-#include <math.h>
-#define NUMBER 5
-
-int func1 (int *a1, int *a2)
-{
- return __sec_reduce_add (a1[0:NUMBER] * a2[0:NUMBER:1]);
-}
-
-int func2 (int *a1, int *a2)
-{
- return (__sec_reduce_add (a1[0:NUMBER] * a2[0:NUMBER]) +
- __sec_reduce_mul (a1[0:NUMBER] + a2[0:NUMBER]));
-}
-
-int func3 (int *a1, int *a2)
-{
- return (int) sqrt ((double)(__sec_reduce_add (a1[0:NUMBER] * a2[0:NUMBER]) +
- a2[0] + a2[1] + a2[3]));
-}
-
-int func4 (int *a1, int *a2)
-{
- return a1[NUMBER-1] * (__sec_reduce_add (a1[0:NUMBER] * a2[0:NUMBER]) + a2[0] + a2[1] + a2[3])/a1[NUMBER-2];
-}
-int main(void)
-{
- int array[NUMBER], array2[NUMBER];
- int return_value = 0;
- int ii = 0;
- int argc = 1;
- __asm volatile ("" : "+r" (argc));
- for (ii = 0; ii < NUMBER; ii++)
- {
- array[ii] = argc; /* This should calculate to 1. */
- array2[ii] = argc * argc + argc; /* This should calculate to 2. */
- }
-
- return_value = func1 (array, array2);
-#if HAVE_IO
- printf("Return_value = %d\n", return_value);
-#endif
- if (return_value != (2+2+2+2+2))
- return 1;
-
- return_value = func2 (array2, array);
-#if HAVE_IO
- printf("Return_value = %d\n", return_value);
-#endif
- if (return_value != (3*3*3*3*3) + (2+2+2+2+2))
- return 2;
-
- return_value = func3 (array, array2);
-#if HAVE_IO
- printf("Return_value = %d\n", return_value);
-#endif
- if (return_value != 4)
- return 3;
-
- return_value = func4 (array, array2);
-#if HAVE_IO
- printf("Return_value = %d\n", return_value);
-#endif
- if (return_value != 16)
- return 4;
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/test_sec_limits.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/test_sec_limits.c
deleted file mode 100644
index f4f3ca5a6bb..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/test_sec_limits.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#include <limits.h>
-int A[16];
-int a = 0;
-
-int main () {
- if (__sec_reduce_max(A[0:0:2]) != INT_MIN)
- a++;
-
- if (__sec_reduce_min(A[0:0:2]) != INT_MAX)
- a++;
-
- return a;
-}
-
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/tst_lngth.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/tst_lngth.c
deleted file mode 100644
index 015a7eb7370..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/tst_lngth.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options " -fcilkplus " } */
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-#define N 256
-int A[N], B[N];
-
-int
-main ()
-{
- A[0:(N / 4)] = A[4]+ B[0:(N / 2):2]; /* { dg-error "length mismatch between" } */
- A[0:(N / 4)] = B[0:(N / 2):2] + N; /* { dg-error "length mismatch between" } */
- A[0:(N / 4)] = B[0:(N / 2):2] + A[4]; /* { dg-error "length mismatch between" } */
- return 0;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c
deleted file mode 100644
index 3b0777e0f3b..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/AN/vla.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* { dg-do compile { target c } } */
-/* { dg-options "-fcilkplus -std=c99 -w" } */
-
-int func (int x)
-{
- return x++;
-}
-int main(void)
-{
- int argc = 1;
- __asm volatile ("" : "+r" (argc));
- int array[argc];
-
- array[:] = 5; /* { dg-error "start-index and length fields necessary for using array notations in variable-length arrays." } */
- array[0:argc] = 5; /* This is OK. */
- array[0:5:2] = 5; /* This is OK. */
- array[0:argc:2] = 5; /* This is OK. */
- array[0:argc:func (argc-2)] = 5; /* This is OK. */
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/Wparentheses-1.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/Wparentheses-1.c
deleted file mode 100644
index f07b49a2775..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/Wparentheses-1.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* PR c/70436 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -Wparentheses" } */
-/* { dg-additional-options "-std=gnu99" { target c } } */
-
-int a, b, c;
-void bar (void);
-void baz (void);
-
-void
-f1 (void)
-{
- if (a) /* { dg-warning "ambiguous" } */
- _Cilk_for (int i = 0; i < 10; i++)
- if (b)
- bar ();
- else
- baz ();
-
- if (a)
- _Cilk_for (int i = 0; i < 10; i++)
- {
- if (b)
- bar ();
- else
- baz ();
- }
-
- if (a)
- _Cilk_for (int i = 0; i < 10; i++)
- {
- if (b)
- bar ();
- }
- else
- baz ();
-}
-
-void
-f2 (void)
-{
- if (a) /* { dg-warning "ambiguous" } */
- #pragma cilk grainsize = 2
- _Cilk_for (int i = 0; i < 10; i++)
- if (b)
- bar ();
- else
- baz ();
-
- if (a)
- #pragma cilk grainsize = 2
- _Cilk_for (int i = 0; i < 10; i++)
- {
- if (b)
- bar ();
- else
- baz ();
- }
-
- if (a)
- #pragma cilk grainsize = 2
- _Cilk_for (int i = 0; i < 10; i++)
- {
- if (b)
- bar ();
- }
- else
- baz ();
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-for-2.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-for-2.c
deleted file mode 100644
index 32e4b9a5769..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-for-2.c
+++ /dev/null
@@ -1,393 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-/* { dg-additional-options "-std=gnu99" { target c } } */
-
-int msk;
-
-#define BODY \
- do { \
- int j = (i >= 30U) ? 30 : i; \
- if (__atomic_fetch_or (&msk, 1 << j, __ATOMIC_RELAXED) & (1 << j)) \
- __builtin_abort (); \
- } while (0)
-#define TEST(x) if (msk != (x)) __builtin_abort (); msk = 0
-
-__attribute__((noinline, noclone)) void
-test (int seven, int three, int two, int minustwo, int ten,
- int zero, int eleven, int six, int one, int threealt,
- unsigned long int sevenUL, unsigned long int threeUL,
- unsigned long int twoUL, unsigned long int minustwoUL,
- unsigned long int tenUL, unsigned long int zeroUL,
- unsigned long int elevenUL, unsigned long int sixUL,
- unsigned long int oneUL, unsigned long int threealtUL)
-{
- _Cilk_for (int i = seven; i < three; ++i)
- __builtin_abort ();
- _Cilk_for (int i = seven; i <= three; ++i)
- __builtin_abort ();
- _Cilk_for (int i = three; i != threealt; ++i)
- __builtin_abort ();
- _Cilk_for (int i = seven; i < three; i += two)
- __builtin_abort ();
- _Cilk_for (int i = seven; i <= three; i += two)
- __builtin_abort ();
- _Cilk_for (int i = three; i != threealt; i += two)
- __builtin_abort ();
- _Cilk_for (int i = seven; i < three; i -= minustwo)
- __builtin_abort ();
- _Cilk_for (int i = seven; i <= three; i -= minustwo)
- __builtin_abort ();
- _Cilk_for (int i = three; i != threealt; i -= minustwo)
- __builtin_abort ();
- _Cilk_for (int i = three; i > seven; --i)
- __builtin_abort ();
- _Cilk_for (int i = three; i >= seven; i--)
- __builtin_abort ();
- _Cilk_for (int i = three; i != threealt; i--)
- __builtin_abort ();
- _Cilk_for (int i = three; i > seven; i -= two)
- __builtin_abort ();
- _Cilk_for (int i = three; i >= seven; i -= two)
- __builtin_abort ();
- _Cilk_for (int i = three; i != threealt; i -= two)
- __builtin_abort ();
- _Cilk_for (int i = three; i > seven; i += minustwo)
- __builtin_abort ();
- _Cilk_for (int i = three; i >= seven; i += minustwo)
- __builtin_abort ();
- _Cilk_for (int i = three; i != threealt; i += minustwo)
- __builtin_abort ();
- _Cilk_for (int i = three; i < seven; ++i)
- BODY;
- TEST (0x78);
- _Cilk_for (int i = three; i <= seven; i++)
- BODY;
- TEST (0xf8);
- _Cilk_for (int i = three; i != seven; i++)
- BODY;
- TEST (0x78);
- _Cilk_for (int i = zero; i < ten; i += two)
- BODY;
- TEST (0x155);
- _Cilk_for (int i = zero; i <= ten; i += two)
- BODY;
- TEST (0x555);
- _Cilk_for (int i = zero; i != ten; i += two)
- BODY;
- TEST (0x155);
- _Cilk_for (int i = zero; i < ten; i -= minustwo)
- BODY;
- TEST (0x155);
- _Cilk_for (int i = zero; i <= ten; i -= minustwo)
- BODY;
- TEST (0x555);
- _Cilk_for (int i = zero; i != ten; i -= minustwo)
- BODY;
- TEST (0x155);
- _Cilk_for (int i = six; i > two; --i)
- BODY;
- TEST (0x78);
- _Cilk_for (int i = seven; i >= three; i--)
- BODY;
- TEST (0xf8);
- _Cilk_for (int i = seven; i != three; i--)
- BODY;
- TEST (0xf0);
- _Cilk_for (int i = eleven; i > one; i += minustwo)
- BODY;
- TEST (0xaa8);
- _Cilk_for (int i = eleven; i >= two; i += minustwo)
- BODY;
- TEST (0xaa8);
- _Cilk_for (int i = eleven; i != one; i += minustwo)
- BODY;
- TEST (0xaa8);
- _Cilk_for (int i = eleven; i > one; i -= two)
- BODY;
- TEST (0xaa8);
- _Cilk_for (int i = eleven; i >= two; i -= two)
- BODY;
- TEST (0xaa8);
- _Cilk_for (int i = eleven; i != one; i -= two)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = sevenUL; i < threeUL; ++i)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = sevenUL; i <= threeUL; ++i)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i != threealtUL; ++i)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = sevenUL; i < threeUL; i += twoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = sevenUL; i <= threeUL; i += twoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i != threealtUL; i += twoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = sevenUL; i < threeUL; i -= minustwoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = sevenUL; i <= threeUL; i -= minustwoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i != threealtUL; i -= minustwoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i > sevenUL; --i)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i >= sevenUL; i--)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i != threealtUL; i--)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i > sevenUL; i -= twoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i >= sevenUL; i -= twoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i != threealtUL; i -= twoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i > sevenUL; i += minustwoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i >= sevenUL; i += minustwoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i != threealtUL; i += minustwoUL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = threeUL; i < sevenUL; ++i)
- BODY;
- TEST (0x78);
- _Cilk_for (unsigned long int i = threeUL; i <= sevenUL; i++)
- BODY;
- TEST (0xf8);
- _Cilk_for (unsigned long int i = threeUL; i != sevenUL; i++)
- BODY;
- TEST (0x78);
- _Cilk_for (unsigned long int i = zeroUL; i < tenUL; i += twoUL)
- BODY;
- TEST (0x155);
- _Cilk_for (unsigned long int i = zeroUL; i <= tenUL; i += twoUL)
- BODY;
- TEST (0x555);
- _Cilk_for (unsigned long int i = zeroUL; i != tenUL; i += twoUL)
- BODY;
- TEST (0x155);
- _Cilk_for (unsigned long int i = zeroUL; i < tenUL; i -= minustwoUL)
- BODY;
- TEST (0x155);
- _Cilk_for (unsigned long int i = zeroUL; i <= tenUL; i -= minustwoUL)
- BODY;
- TEST (0x555);
- _Cilk_for (unsigned long int i = zeroUL; i != tenUL; i -= minustwoUL)
- BODY;
- TEST (0x155);
- _Cilk_for (unsigned long int i = sixUL; i > twoUL; --i)
- BODY;
- TEST (0x78);
- _Cilk_for (unsigned long int i = sevenUL; i >= threeUL; i--)
- BODY;
- TEST (0xf8);
- _Cilk_for (unsigned long int i = sevenUL; i != threeUL; i--)
- BODY;
- TEST (0xf0);
- _Cilk_for (unsigned long int i = elevenUL; i > oneUL; i += minustwoUL)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = elevenUL; i >= twoUL; i += minustwoUL)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = elevenUL; i != oneUL; i += minustwoUL)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = elevenUL; i > oneUL; i -= twoUL)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = elevenUL; i >= twoUL; i -= twoUL)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = elevenUL; i != oneUL; i -= twoUL)
- BODY;
- TEST (0xaa8);
-}
-
-int
-main ()
-{
- _Cilk_for (int i = 7; i < 3; ++i)
- __builtin_abort ();
- _Cilk_for (int i = 7; i <= 3; ++i)
- __builtin_abort ();
- _Cilk_for (int i = 3; i != 3; ++i)
- __builtin_abort ();
- _Cilk_for (int i = 7; i < 3; i += 2)
- __builtin_abort ();
- _Cilk_for (int i = 7; i <= 3; i += 2)
- __builtin_abort ();
- _Cilk_for (int i = 3; i != 3; i += 2)
- __builtin_abort ();
- _Cilk_for (int i = 7; i < 3; i -= -2)
- __builtin_abort ();
- _Cilk_for (int i = 7; i <= 3; i -= -2)
- __builtin_abort ();
- _Cilk_for (int i = 3; i != 3; i -= -2)
- __builtin_abort ();
- _Cilk_for (int i = 3; i > 7; --i)
- __builtin_abort ();
- _Cilk_for (int i = 3; i >= 7; i--)
- __builtin_abort ();
- _Cilk_for (int i = 3; i != 3; i--)
- __builtin_abort ();
- _Cilk_for (int i = 3; i > 7; i -= 2)
- __builtin_abort ();
- _Cilk_for (int i = 3; i >= 7; i -= 2)
- __builtin_abort ();
- _Cilk_for (int i = 3; i != 3; i -= 2)
- __builtin_abort ();
- _Cilk_for (int i = 3; i > 7; i += -2)
- __builtin_abort ();
- _Cilk_for (int i = 3; i >= 7; i += -2)
- __builtin_abort ();
- _Cilk_for (int i = 3; i != 3; i += -2)
- __builtin_abort ();
- _Cilk_for (int i = 3; i < 7; ++i)
- BODY;
- TEST (0x78);
- _Cilk_for (int i = 3; i <= 7; i++)
- BODY;
- TEST (0xf8);
- _Cilk_for (int i = 3; i != 7; i++)
- BODY;
- TEST (0x78);
- _Cilk_for (int i = 0; i < 10; i += 2)
- BODY;
- TEST (0x155);
- _Cilk_for (int i = 0; i <= 10; i += 2)
- BODY;
- TEST (0x555);
- _Cilk_for (int i = 0; i != 10; i += 2)
- BODY;
- TEST (0x155);
- _Cilk_for (int i = 0; i < 10; i -= -2)
- BODY;
- TEST (0x155);
- _Cilk_for (int i = 0; i <= 10; i -= -2)
- BODY;
- TEST (0x555);
- _Cilk_for (int i = 0; i != 10; i -= -2)
- BODY;
- TEST (0x155);
- _Cilk_for (int i = 6; i > 2; --i)
- BODY;
- TEST (0x78);
- _Cilk_for (int i = 7; i >= 3; i--)
- BODY;
- TEST (0xf8);
- _Cilk_for (int i = 7; i != 3; i--)
- BODY;
- TEST (0xf0);
- _Cilk_for (int i = 11; i > 1; i += -2)
- BODY;
- TEST (0xaa8);
- _Cilk_for (int i = 11; i >= 2; i += -2)
- BODY;
- TEST (0xaa8);
- _Cilk_for (int i = 11; i != 1; i += -2)
- BODY;
- TEST (0xaa8);
- _Cilk_for (int i = 11; i > 1; i -= 2)
- BODY;
- TEST (0xaa8);
- _Cilk_for (int i = 11; i >= 2; i -= 2)
- BODY;
- TEST (0xaa8);
- _Cilk_for (int i = 11; i != 1; i -= 2)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = 7UL; i < 3UL; ++i)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 7UL; i <= 3UL; ++i)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i != 3UL; ++i)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 7UL; i < 3UL; i += 2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 7UL; i <= 3UL; i += 2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i != 3UL; i += 2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 7UL; i < 3UL; i -= -2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 7UL; i <= 3UL; i -= -2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i != 3UL; i -= -2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i > 7UL; --i)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i >= 7UL; i--)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i != 3UL; i--)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i > 7UL; i -= 2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i >= 7UL; i -= 2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i != 3UL; i -= 2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i > 7UL; i += -2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i >= 7UL; i += -2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i != 3UL; i += -2UL)
- __builtin_abort ();
- _Cilk_for (unsigned long int i = 3UL; i < 7UL; ++i)
- BODY;
- TEST (0x78);
- _Cilk_for (unsigned long int i = 3UL; i <= 7UL; i++)
- BODY;
- TEST (0xf8);
- _Cilk_for (unsigned long int i = 3UL; i != 7UL; i++)
- BODY;
- TEST (0x78);
- _Cilk_for (unsigned long int i = 0UL; i < 10UL; i += 2UL)
- BODY;
- TEST (0x155);
- _Cilk_for (unsigned long int i = 0UL; i <= 10UL; i += 2UL)
- BODY;
- TEST (0x555);
- _Cilk_for (unsigned long int i = 0UL; i != 10UL; i += 2UL)
- BODY;
- TEST (0x155);
- _Cilk_for (unsigned long int i = 0UL; i < 10UL; i -= -2UL)
- BODY;
- TEST (0x155);
- _Cilk_for (unsigned long int i = 0UL; i <= 10UL; i -= -2UL)
- BODY;
- TEST (0x555);
- _Cilk_for (unsigned long int i = 0UL; i != 10UL; i -= -2UL)
- BODY;
- TEST (0x155);
- _Cilk_for (unsigned long int i = 6UL; i > 2UL; --i)
- BODY;
- TEST (0x78);
- _Cilk_for (unsigned long int i = 7UL; i >= 3UL; i--)
- BODY;
- TEST (0xf8);
- _Cilk_for (unsigned long int i = 7UL; i != 3UL; i--)
- BODY;
- TEST (0xf0);
- _Cilk_for (unsigned long int i = 11UL; i > 1UL; i += -2UL)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = 11UL; i >= 2UL; i += -2UL)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = 11UL; i != 1UL; i += -2UL)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = 11UL; i > 1UL; i -= 2UL)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = 11UL; i >= 2UL; i -= 2UL)
- BODY;
- TEST (0xaa8);
- _Cilk_for (unsigned long int i = 11UL; i != 1UL; i -= 2UL)
- BODY;
- TEST (0xaa8);
- test (7, 3, 2, -2, 10, 0, 11, 6, 1, 3,
- 7UL, 3UL, 2UL, -2UL, 10UL, 0UL, 11UL, 6UL, 1UL, 3UL);
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-for-3.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-for-3.c
deleted file mode 100644
index 04c1635b012..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-for-3.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-/* { dg-additional-options "-std=gnu99" { target c } } */
-
-void bar (int *, int *, int *, int *);
-void baz (char **, char **, char **, int *);
-
-void
-foo ()
-{
- int a, b, c;
- char *d, *e;
- bar (0, &a, &b, &c);
- _Cilk_for (int i = a; i < b; i += c)
- bar (&i, &a, &b, &c);
- baz (0, &d, &e, &c);
- _Cilk_for (char *p = d; p != e; p += c)
- baz (&p, &d, &e, &c);
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-fors.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-fors.c
deleted file mode 100644
index 6b2bbf779ae..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk-fors.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-/* { dg-additional-options "-std=gnu99" { target c } } */
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-static void check (int *Array, int start, int end, int incr, int value)
-{
- int ii = 0;
- for (ii = start; ii < end; ii = ii + incr)
- if (Array[ii] != value)
- __builtin_abort ();
-#if HAVE_IO
- printf ("Passed\n");
-#endif
-}
-
-static void check_reverse (int *Array, int start, int end, int incr, int value)
-{
- int ii = 0;
- for (ii = start; ii >= end; ii = ii - incr)
- if (Array[ii] != value)
- __builtin_abort ();
-#if HAVE_IO
- printf ("Passed\n");
-#endif
-}
-
-
-int main (void)
-{
- int Array[10];
- int x = 9, y = 0, z = 3;
-
-
- _Cilk_for (int ii = 0; ii < 10; ii++)
- Array[ii] = 1133;
- check (Array, 0, 10, 1, 1133);
-
- _Cilk_for (int ii = 0; ii < 10; ++ii)
- Array[ii] = 3311;
- check (Array, 0, 10, 1, 3311);
-
- _Cilk_for (int ii = 9; ii > -1; ii--)
- Array[ii] = 4433;
- check_reverse (Array, 9, 0, 1, 4433);
-
- _Cilk_for (int ii = 9; ii > -1; --ii)
- Array[ii] = 9988;
- check_reverse (Array, 9, 0, 1, 9988);
-
- _Cilk_for (int ii = 0; ii < 10; ++ii)
- Array[ii] = 3311;
- check (Array, 0, 10, 1, 3311);
-
- _Cilk_for (int ii = 0; ii < 10; ii += 2)
- Array[ii] = 1328;
- check (Array, 0, 10, 2, 1328);
-
- _Cilk_for (int ii = 9; ii >= 0; ii -= 2)
- Array[ii] = 1738;
- check_reverse (Array, 9, 0, 2, 1738);
-
-
- _Cilk_for (int ii = 0; ii < 10; ii++)
- {
- if (ii % 2)
- Array[ii] = 1343;
- else
- Array[ii] = 3413;
- }
-
- check (Array, 1, 10, 2, 1343);
- check (Array, 0, 10, 2, 3413);
-
- _Cilk_for (short cc = 0; cc < 10; cc++)
- Array[cc] = 1343;
- check (Array, 0, 10, 1,1343);
-
- _Cilk_for (short cc = 9; cc >= 0; cc--)
- Array[cc] = 1348;
- check_reverse (Array, 9, 0, 1, 1348);
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_errors.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_errors.c
deleted file mode 100644
index ca080c8f27a..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_errors.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-/* { dg-additional-options "-std=c99" { target c } } */
-
-
-int main (void)
-{
- int q = 0, ii = 0, jj = 0;
-
- _Cilk_for (int ii; ii < 10; ii++) /* { dg-error "is not initialized" "" { target c } } */
- /* { dg-error "expected" "" { target c++ } .-1 } */
- q = 5;
-
- _Cilk_for (; ii < 10; ii++) /* { dg-error "expected iteration declaration" } */
- q = 2;
-
- _Cilk_for (int ii = 0; ; ii++) /* { dg-error "missing controlling predicate" } */
- q = 2;
-
- _Cilk_for (int ii = 0; ii < 10, jj < 10; ii++) /* { dg-error "expected ';' before ',' token" "" { target c } } */
- /* { dg-error "invalid controlling predicate" "" { target c++ } .-1 } */
- q = 5;
-
- _Cilk_for (int ii = 0; ii < 10; ) /* { dg-error "missing increment" } */
- q = 5;
-
- _Cilk_for (int ii = 0, jj = 0; ii < 10; ii++) /* { dg-error "expected|invalid" } */
- q = 5;
-
- _Cilk_for (volatile int vii = 0; vii < 10; vii++) /* { dg-error "iteration variable cannot be volatile" } */
- q = 5;
-
- _Cilk_for (static int sii = 0; sii < 10; sii++) /* { dg-error "static|expected|declared|expression" } */
- q = 5;
-
- _Cilk_for (float fii = 3.47; fii < 5.23; fii++) /* { dg-error "invalid type for iteration variable" } */
- q = 5;
-
- _Cilk_for (int ii = 0; 10 > jj; ii++) /* { dg-error "invalid controlling predicate" } */
- q = 5;
-
- _Cilk_for (int ii = 0; ii < 10; ii >> 1) /* { dg-error "invalid increment expression" } */
- q = 5;
-
- _Cilk_for (int ii = 10; ii >= 0; ii--) /* This is OK! */
- q = 5;
-
- _Cilk_for (int ii; ii < 10; ii++) /* { dg-error "is not initialized" "" { target c } } */
- /* { dg-error "expected" "" { target c++ } .-1 } */
- q = 5;
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain.c
deleted file mode 100644
index 5a95a06274f..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-/* { dg-additional-options "-std=gnu99" { target c } } */
-
-
-int grain_value = 2;
-int main (void)
-{
- int Array1[200], Array1_Serial[200];
-
- for (int ii = 0; ii < 200; ii++)
- {
- Array1_Serial[ii] = 2;
- Array1[ii] = 1;
- }
-
-#pragma cilk grainsize = 2
- _Cilk_for (int ii = 0; ii < 200; ii++)
- Array1[ii] = 2;
-
- for (int ii = 0; ii < 200; ii++)
- if (Array1[ii] != Array1_Serial[ii])
- return (ii+1);
-
-#pragma cilk grainsize = grain_value
- _Cilk_for (int ii = 0; ii < 200; ii++)
- Array1[ii] = 2;
-
- for (int ii = 0; ii < 200; ii++)
- if (Array1[ii] != Array1_Serial[ii])
- return (ii+1);
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c
deleted file mode 100644
index bb722811202..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -Wunknown-pragmas" } */
-/* { dg-additional-options "-std=c99" { target c } } */
-
-
-char Array1[26];
-
-#pragma cilk grainsize = 2 /* { dg-error "must be inside a function" } */
-
-int main(int argc, char **argv)
-{
-/* This is OK. */
-#pragma cilk grainsize = 2
- _Cilk_for (int ii = 0; ii < 10; ii++)
- Array1[ii] = 0;
-
-#pragma cilk grainsize 2 /* { dg-error "expected '=' before numeric constant" } */
- _Cilk_for (int ii = 0; ii < 10; ii++)
- Array1[ii] = 0;
-
-#pragma cilk grainsiz = 2 /* { dg-warning "-:ignoring #pragma cilk grainsiz" } */
- _Cilk_for (int ii = 0; ii < 10; ii++)
- Array1[ii] = 0;
-
-
-/* This is OK, it will do a type conversion to long int. */
-#pragma cilk grainsize = 0.5
- _Cilk_for (int ii = 0; ii < 10; ii++)
- Array1[ii] = 0;
-
-#pragma cilk grainsize = 1
- while (Array1[5] != 0) /* { dg-warning "is not followed by" } */
- {
- /* Blah */
- }
-
-#pragma cilk grainsize = 1
- int q = 0; /* { dg-warning "is not followed by" } */
- _Cilk_for (q = 0; q < 10; q++) /* { dg-error "allows expression instead of declaration" "" { target c++ } } */
- Array1[q] = 5;
-
- while (Array1[5] != 0)
- {
- /* Blah */
- }
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c
deleted file mode 100644
index 1f8e84ee3d5..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-/* { dg-additional-options "-std=gnu99" { target c } } */
-
-
-
-/* <feature> loop control variable must have integer, pointer or class type
- </feature>
-*/
-
-#define ARRAY_SIZE 10000
-int a[ARRAY_SIZE];
-
-int main(void)
-{
- int ii = 0;
-
- for (ii =0; ii < ARRAY_SIZE; ii++)
- a[ii] = 5;
- _Cilk_for(int *aa = a; aa < a + ARRAY_SIZE; aa++)
- *aa = 0;
- for (ii = 0; ii < ARRAY_SIZE; ii++)
- if (a[ii] != 0)
- __builtin_abort ();
-
- _Cilk_for (int *aa = a; aa < a + ARRAY_SIZE; aa = aa + 2)
- *aa = 4;
-
- for (ii = 0; ii < ARRAY_SIZE; ii = ii + 2)
- if (a[ii] != 4)
- __builtin_abort ();
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/compound_cilk_spawn.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/compound_cilk_spawn.c
deleted file mode 100644
index 5e687bd0a0c..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/compound_cilk_spawn.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-/* <feature>
- A program is considered ill formed if the _Cilk_spawn form of this
- expression appears other than in one of the following contexts:
- as the entire body of an expression statement,
- as the entire right hand side of an assignment expression that is the entire
- body of an expression statement, or as the entire initializer-clause in a
- simple declaration.
- </feature>
-*/
-
-int spawn_func (int arg)
-{
- return arg + 1;
-}
-
-int check()
-{
- int z;
- z = 23, _Cilk_spawn spawn_func (3), 3424; /* { dg-error "spawned function call cannot be part of a comma expression" } */
- 23, spawn_func (5), _Cilk_spawn spawn_func (3); /* { dg-error "spawned function call cannot be part of a comma expression" } */
- _Cilk_spawn spawn_func (0), _Cilk_spawn spawn_func (3), 3, spawn_func (0); /* { dg-error "spawned function call cannot be part of a comma expression" } */
- return 23;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/concec_cilk_spawn.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/concec_cilk_spawn.c
deleted file mode 100644
index b93c9626d18..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/concec_cilk_spawn.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-/* <feature> Consecutive _Cilk_spawn tokens are not permitted
- </feature>
-*/
-
-int spawn_func (int arg)
-{
- return arg + 1;
-}
-
-void func ()
-{
- int a;
- a = _Cilk_spawn _Cilk_spawn spawn_func (4); /* { dg-error "consecutive" } */
- a = _Cilk_spawn _Cilk_spawn _Cilk_spawn spawn_func (4); /* { dg-error "consecutive" } */
- a = _Cilk_spawn _Cilk_spawn _Cilk_spawn _Cilk_spawn spawn_func (4); /* { dg-error "consecutive" } */
- return;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/errors.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/errors.c
deleted file mode 100644
index d637924e9e1..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/errors.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -Wno-return-type" } */
-
-int func_2(void);
-
-int check_spawn(int v)
-{
- if (_Cilk_spawn func_2()) /* { dg-error "cannot contain" "" { target c } } */
- /* XXX: no error in C++ */
- ;
- if (v + _Cilk_spawn func_2()) /* { dg-error "cannot contain" "" { target c } } */
- /* { dg-error "invalid use" "" { target c++ } .-1 } */
- ;
- if (v, _Cilk_spawn func_2()) /* { dg-error "spawned function call cannot be part" } */
- ;
- v, _Cilk_spawn func_2(); /* { dg-error "spawned function call cannot be part" } */
- while (_Cilk_spawn func_2()) /* { dg-error "a condition for while statement" } */
- ;
- while (v + _Cilk_spawn func_2()) /* { dg-error "a condition for while statement" } */
- ;
- for (; _Cilk_spawn func_2() ;) /* { dg-error "cannot be used" } */
- ;
- for (; v + _Cilk_spawn func_2() ;) /* { dg-error "cannot be used" } */
- ;
- v + _Cilk_spawn func_2(); /* { dg-error } */
- for (_Cilk_spawn func_2() ;;)
- ;
- for (;; _Cilk_spawn func_2())
- ;
- do {} while(_Cilk_spawn func_2()); /* { dg-error "cannot be used" } */
- do {} while(v + _Cilk_spawn func_2()); /* { dg-error "cannot be used" } */
- switch (_Cilk_spawn func_2()) /* { dg-error "cannot be used" } */
- {
- default: break;
- }
- goto *(_Cilk_spawn func_2()); /* { dg-error "cannot be used" } */
-
- return _Cilk_spawn func_2(); /* { dg-error "is not allowed" } */
-}
-
-int check_array_notation(int x[100], int y[100])
-{
- x[0:100] = y[0:100];
- for (; x[0:100] = y[0:100]; ) /* { dg-error "cannot be used" } */
- ;
- while (x[0:100] = y[0:100]) /* { dg-error "cannot be used" } */
- ;
- switch (x[0:100] = y[0:100]) /* { dg-error "cannot be used" } */
- {
- default: break;
- }
- do {} while (x[0:100] = y[0:100]); /* { dg-error "cannot be used" } */
- if (x[0:100] = y[0:100]) /* allowed */
- ;
- return x[0:100] = y[0:100]; /* { dg-error "cannot be used" } */
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/fib.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/fib.c
deleted file mode 100644
index 40e1cb48c25..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/fib.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-int fib (int);
-int fib_serial (int);
-
-#define FIB_ITERATION 30
-
-int main(void)
-{
- int ii = 0;
- int fib_result[FIB_ITERATION+1], fib_serial_result[FIB_ITERATION+1];
-#if HAVE_IO
-
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- printf("fib (%2d) = %10d\n", ii, fib (ii));
-#else
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- {
- fib_result[ii] = fib (ii);
- }
-
- fib_serial_result[0] = 0;
- fib_serial_result[1] = 1;
- for (ii = 2; ii <= FIB_ITERATION; ii++)
- fib_serial_result[ii] = fib_serial_result[ii-1] + fib_serial_result[ii-2];
-
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- {
- if (fib_result[ii] != fib_serial_result[ii])
- __builtin_abort ();
- }
-#endif
- return 0;
-}
-
-int fib(int n)
-{
- int x = 0, y = 0;
- if (n < 2)
- return n;
- else
- {
- x = _Cilk_spawn fib(n-1);
- y = fib(n-2);
- _Cilk_sync;
- return (x+y);
- }
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/fib_init_expr_xy.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/fib_init_expr_xy.c
deleted file mode 100644
index 41fd0dbe1d6..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/fib_init_expr_xy.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-int fib (int);
-int fib_serial (int);
-
-#define FIB_ITERATION 30
-
-int main(void)
-{
- int ii = 0;
- int fib_result[FIB_ITERATION+1], fib_serial_result[FIB_ITERATION+1];
-#if HAVE_IO
-
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- printf("fib (%2d) = %10d\n", ii, fib (ii));
-#else
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- {
- fib_result[ii] = fib (ii);
- }
-
- fib_serial_result[0] = 0;
- fib_serial_result[1] = 1;
-
- for (ii = 2; ii <= FIB_ITERATION; ii++)
- fib_serial_result[ii] = fib_serial_result[ii-1] + fib_serial_result[ii-2];
-
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- {
- if (fib_result[ii] != fib_serial_result[ii])
- __builtin_abort ();
- }
-
-#endif
- return 0;
-}
-
-int fib_serial (int n)
-{
- int x = 0, y = 0;
- if (n < 2)
- return n;
- else
- {
- x = fib_serial (n-1);
- y = fib_serial (n-2);
- return (x+y);
- }
-}
-
-int fib(int n)
-{
- if (n < 2)
- return n;
- else
- {
- int x = _Cilk_spawn fib(n-1);
- int y = fib(n-2);
- _Cilk_sync;
- return (x+y);
- }
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/fib_no_return.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/fib_no_return.c
deleted file mode 100644
index ccdbcfdce66..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/fib_no_return.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-#define FIB_ITERATION 30
-
-void fib (int *, int);
-int fib_serial (int);
-
-int main(void)
-{
- int ii = 0, error = 0;
- int fib_result[FIB_ITERATION+1], fib_serial_result[FIB_ITERATION+1];
-
-#if HAVE_IO
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- {
- int result = 0;
- fib (&result, ii);
- printf("fib (%2d) = %10d\n", ii, result);
- }
-#else
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- {
- fib (&fib_result[ii], ii);
- }
-
- fib_serial_result[0] = 0;
- fib_serial_result[1] = 1;
-
- for (ii = 2; ii <= FIB_ITERATION; ii++)
- fib_serial_result[ii] = fib_serial_result[ii-1] + fib_serial_result[ii-2];
-
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- {
- if (fib_result[ii] != fib_serial_result[ii])
- __builtin_abort ();
- }
-#endif
-
- return 0;
-}
-
-int fib_serial (int n)
-{
- int x = 0, y = 0;
- if (n < 2)
- return n;
- else
- {
- x = fib_serial (n-1);
- y = fib_serial (n-2);
- return (x+y);
- }
-}
-
-void fib(int *result, int n)
-{
- int x = 0, y = 0;
- if (n < 2)
- x = n;
- else
- {
- _Cilk_spawn fib(&x, n-1);
- fib(&y, n-2);
- _Cilk_sync;
- }
- *result = (x+y);
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/fib_no_sync.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/fib_no_sync.c
deleted file mode 100644
index 2c2a94b27a5..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/fib_no_sync.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-#define FIB_ITERATION 30
-
-int fib (int);
-int fib_serial (int);
-
-int main(void)
-{
- int ii = 0;
- int fib_result[FIB_ITERATION+1], fib_serial_result[FIB_ITERATION+1];
-#if HAVE_IO
-
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- printf("fib (%2d) = %10d\n", ii, fib (ii));
-#else
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- {
- fib_result[ii] = fib (ii);
- }
-
- fib_serial_result[0] = 0;
- fib_serial_result[1] = 1;
-
- for (ii = 2; ii <= FIB_ITERATION; ii++)
- fib_serial_result[ii] = fib_serial_result[ii-1] + fib_serial_result[ii-2];
-
- for (ii = 0; ii <= FIB_ITERATION; ii++)
- {
- if (fib_result[ii] != fib_serial_result[ii])
- __builtin_abort ();
- }
-
-#endif
- return 0;
-}
-
-int fib_serial (int n)
-{
- int x = 0, y = 0;
- if (n < 2)
- return n;
- else
- {
- x = fib_serial (n-1);
- y = fib_serial (n-2);
- return (x+y);
- }
-}
-
-int fib(int n)
-{
- if (n < 2)
- return n;
- else
- {
- int x = _Cilk_spawn fib(n-1);
- int y = fib(n-2);
- return (x+y);
- }
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c
deleted file mode 100644
index 5b43be76010..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_spawns.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* { dg-options "-fcilkplus" } */
-
-extern int foo ();
-int bar = _Cilk_spawn foo (); /* { dg-error "may only be used inside a function" } */
-
-
-int main (void)
-{
- int x;
-
- _Cilk_spawn foo; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn x; /* { dg-error "only function calls can be spawned" } */
- return x;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_sync.cc b/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_sync.cc
deleted file mode 100644
index cf1caf12b31..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_sync.cc
+++ /dev/null
@@ -1,9 +0,0 @@
-/* PR c/60189 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- _Cilk_sync return; /* { dg-error " expected ';' before 'return'" } */
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/nested_cilk_for.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/nested_cilk_for.c
deleted file mode 100644
index 8f080a11252..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/nested_cilk_for.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-/* { dg-additional-options "-std=gnu99" { target c } } */
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-int main (void)
-{
- int Array[10][10];
-
-
- for (int ii = 0; ii < 10; ii++)
- for (int jj = 0; jj < 10; jj++)
- {
- Array[ii][jj] = 0;
- }
-
- _Cilk_for (int ii = 0; ii < 10; ii++)
- _Cilk_for (int jj = 0; jj < 5; jj++)
- Array[ii][jj] = 5;
-
- for (int ii = 0; ii < 10; ii++)
- for (int jj = 0; jj < 5; jj++)
- if (Array[ii][jj] != 5)
-#if HAVE_IO
- printf("Array[%d][%d] = %d\n", ii, jj, Array[ii][jj]);
-#else
- __builtin_abort ();
-#endif
-
-
- /* One goes up and one goes down. */
- _Cilk_for (int ii = 0; ii < 10; ii++)
- _Cilk_for (int jj = 9; jj >= 0; jj--)
- Array[ii][jj] = 7;
-
- for (int ii = 0; ii < 10; ii++)
- for (int jj = 9; jj >= 0; jj--)
- if (Array[ii][jj] != 7)
-#if HAVE_IO
- printf("Array[%d][%d] = %d\n", ii, jj, Array[ii][jj]);
-#else
- __builtin_abort ();
-#endif
-
- /* different step sizes. */
- _Cilk_for (int ii = 0; ii < 10; ii++)
- _Cilk_for (int jj = 0; jj < 10; jj += 2)
- Array[ii][jj] = 9;
-
- for (int ii = 0; ii < 10; ii++)
- for (int jj = 0; jj < 10; jj += 2)
- if (Array[ii][jj] != 9)
-#if HAVE_IO
- printf("Array[%d][%d] = %d\n", ii, jj, Array[ii][jj]);
-#else
- __builtin_abort ();
-#endif
-
- /* different step sizes. */
- _Cilk_for (int ii = 0; ii < 10; ii += 2)
- _Cilk_for (int jj = 5; jj < 9; jj++)
- Array[ii][jj] = 11;
-
- for (int ii = 0; ii < 10; ii += 2)
- for (int jj = 5; jj < 9; jj++)
- if (Array[ii][jj] != 11)
-#if HAVE_IO
- printf("Array[%d][%d] = %d\n", ii, jj, Array[ii][jj]);
-#else
- __builtin_abort ();
-#endif
-
- return 0;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/no_args_error.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/no_args_error.c
deleted file mode 100644
index a2f20d22238..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/no_args_error.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int spawn_1 ();
-typedef int(*func) (int);
-
-void check () {
- func var = spawn_1; /* { dg-error "invalid conversion from" "" { target c++ } } */
- _Cilk_spawn var (); /* { dg-error "too few arguments to function" } */
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr59631.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr59631.c
deleted file mode 100644
index 389ee7c5dab..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr59631.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options " " } */
-
-/* Tests the errors when Cilk keywords are used without -fcilkplus. */
-
-void foo()
-{
- _Cilk_spawn foo(); /* { dg-error "must be enabled to use" } */
-}
-
-void foo2 ()
-{
- _Cilk_spawn foo (); /* { dg-error "must be enabled to use" } */
- _Cilk_sync; /* { dg-error "must be enabled to use" } */
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197-2.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197-2.c
deleted file mode 100644
index 1e5ca00a40b..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197-2.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* PR c/60197 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-extern int foo (void);
-
-int
-fn1 (void)
-{
- int i;
- i = (_Cilk_spawn foo ()) + 1; /* { dg-error "invalid use of" } */
- return i;
-}
-
-int
-fn2 (void)
-{
- int i = (_Cilk_spawn foo ()) + 1; /* { dg-error "invalid use of" } */
- return i;
-}
-
-int
-fn3 (int j, int k, int l)
-{
- int i = (((((_Cilk_spawn foo ()) + 1) - l) * k) / j); /* { dg-error "invalid use of" } */
- return i;
-}
-
-int
-fn4 (int j, int k, int l)
-{
- int i;
- i = (((((_Cilk_spawn foo ()) + 1) - l) * k) / j); /* { dg-error "invalid use of" } */
- return i;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c
deleted file mode 100644
index 301a6f2e9d1..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* PR c/60197 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -Wno-return-type" } */
-
-extern int foo (void);
-extern int bar (int);
-
-int
-fn1 (void)
-{
- return (_Cilk_spawn foo ()) * 2; /* { dg-error "in a return statement is not allowed" } */
-}
-
-int
-fn2 (void)
-{
- return (_Cilk_spawn foo ()) > 2; /* { dg-error "in a return statement is not allowed" } */
-}
-
-int
-fn3 (int i, int j, int k)
-{
- return ((((((_Cilk_spawn foo () + i) - j) * k) / j) | i) ^ k) ; /* { dg-error "in a return statement is not allowed" } */
-}
-
-int
-fn4 (int i, int j, int k)
-{
- return (((((i - _Cilk_spawn foo ()) * k) / j) | i) ^ k); /* { dg-error "in a return statement is not allowed" } */
-}
-
-int
-fn5 (void)
-{
- return _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */
-}
-
-int
-fn6 (void)
-{
- return _Cilk_spawn foo () + _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */
-}
-
-int
-fn7 (void)
-{
- return 5 % _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */
-}
-
-int
-fn8 (void)
-{
- return !_Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */
-}
-
-int
-fn9 (void)
-{
- return foo () && _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */
-}
-
-int
-fn10 (void)
-{
- return bar (_Cilk_spawn foo ()); /* { dg-error "in a return statement is not allowed" } */
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60469.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60469.c
deleted file mode 100644
index 670df17faa2..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60469.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* PR middle-end/60469 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -fdump-tree-original" } */
-
-void foo() {}
-
-#define ALEN 1024
-
-int main(int argc, char* argv[])
-{
- int b[ALEN];
- b[:] = 100;
- _Cilk_spawn foo();
- return 0;
-}
-
-/* The C++ FE once emitted a bogus error_mark_node for this test case. */
-/* { dg-final { scan-tree-dump-not "<<< error >>>" "original" } } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60586.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60586.c
deleted file mode 100644
index e2dc7b0c9d5..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr60586.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus -O2" } */
-
-int noop(int x)
-{
- return x;
-}
-
-int post_increment(int *x)
-{
- return (*x)++;
-}
-
-int main(int argc, char *argv[])
-{
- int m = 5;
- int n = m;
- int r = _Cilk_spawn noop(post_increment(&n));
- int n2 = n;
- _Cilk_sync;
-
- if (r != m || n2 != m + 1)
- return 1;
- else
- return 0;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr63307.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr63307.c
deleted file mode 100644
index 6db5386eaf0..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr63307.c
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-options "-fcilkplus -fcompare-debug" } */
-/* { dg-do compile } */
-
-#include "fib_no_return.c"
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr69826-1.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr69826-1.c
deleted file mode 100644
index 97775243ccd..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr69826-1.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-/* { dg-additional-options "-std=gnu99" { target c } } */
-
-#define GRAINSIZE 2
-
-int
-main ()
-{
- int a[64];
- #pragma cilk grainsize=GRAINSIZE
- _Cilk_for (int i = 0; i < 64; i++)
- a[i] = 0;
- #pragma cilk grainsize =GRAINSIZE
- _Cilk_for (int i = 0; i < 64; i++)
- a[i]++;
- #pragma cilk grainsize = GRAINSIZE
- _Cilk_for (int i = 0; i < 64; i++)
- a[i]++;
- for (int i = 0; i < 64; i++)
- if (a[i] != 2)
- __builtin_abort ();
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr69826-2.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr69826-2.c
deleted file mode 100644
index 64d59291975..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr69826-2.c
+++ /dev/null
@@ -1,6 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus -save-temps" } */
-/* { dg-additional-options "-std=gnu99" { target c } } */
-
-#include "pr69826-1.c"
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-4.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-4.c
deleted file mode 100644
index cd4d40686a5..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-4.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* PR c/79428 */
-/* { dg-options "-fcilkplus" } */
-#pragma cilk grainsize /* { dg-error "must be inside a function" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-7.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-7.c
deleted file mode 100644
index bc36f51d914..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/pr79428-7.c
+++ /dev/null
@@ -1,3 +0,0 @@
-/* PR c/79428 */
-/* { dg-options "-fcilkplus" } */
-#pragma simd /* { dg-error "must be inside a function" } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawn_in_return.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/spawn_in_return.c
deleted file mode 100644
index 602971e02c9..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawn_in_return.c
+++ /dev/null
@@ -1,8 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -Wno-return-type" } */
-
-int main (void)
-{
- extern int foo ();
- return _Cilk_spawn foo (); /* { dg-error "return statement is not allowed" } */
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawnee_inline.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/spawnee_inline.c
deleted file mode 100644
index 416d77abb11..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawnee_inline.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus -w" } */
-
-#include <stdio.h>
-#include <stdlib.h>
-#define DEFAULT_VALUE "30"
-
-int fib (char *n_char)
-{
- int n;
- char n_char_minus_one[20], n_char_minus_two[20];
- if (n_char)
- n = atoi (n_char);
- else
- n = atoi(DEFAULT_VALUE);
-
- if (n < 2)
- return n;
- else
- {
- int x, y;
- sprintf (n_char_minus_one,"%d", n-1);
- sprintf (n_char_minus_two,"%d", n-2);
- x = _Cilk_spawn fib (n_char_minus_one);
- y = _Cilk_spawn fib (n_char_minus_two);
- _Cilk_sync;
- return (x+y);
- }
-}
-
-int fib_serial (int n)
-{
- int x, y;
- if (n < 2)
- return n;
- else
- {
- x = fib_serial (n-1);
- y = fib_serial (n-2);
- return (x+y);
- }
- return 0;
-}
-
-int main2_parallel (int argc, char *argv[])
-{
- int n, result_parallel = 0;
-
- if (argc == 2)
- {
- result_parallel = _Cilk_spawn fib (argv[1]);
- _Cilk_sync;
- }
- else
- {
- result_parallel = _Cilk_spawn fib((char *)"30");
- _Cilk_sync;
- }
- return result_parallel;
-}
-
-int main2_serial (int argc, char *argv[])
-{
- int n, result_serial = 0;
- if (argc == 2)
- result_serial = fib_serial (atoi (argv[1]));
- else
- result_serial = fib_serial (atoi (DEFAULT_VALUE));
-
- return result_serial;
-}
-
-int main (void)
-{
- if (main2_serial (1, 0) != main2_parallel (1,0))
- return 1;
- return 0;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawner_inline.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/spawner_inline.c
deleted file mode 100644
index 49592c9e979..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawner_inline.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#include <stdlib.h>
-#define DEFAULT_VALUE 30
-int fib (int n)
-{
- if (n<2)
- return n;
- else
- {
- int x, y;
- x = _Cilk_spawn fib (n-1);
- y = _Cilk_spawn fib (n-2);
- _Cilk_sync;
- return (x+y);
- return 5;
- }
-}
-
-int main_parallel (int argc, char *argv[])
-{
- int n, result;
- if (argc == 2)
- n = atoi(argv[1]);
- else
- n = DEFAULT_VALUE;
- result = _Cilk_spawn fib(n);
- _Cilk_sync;
- return result;
-}
-
-int fib_serial (int n)
-{
- int x, y;
- if (n < 2)
- return n;
- else
- {
- x = fib (n-1);
- y = fib (n-2);
- return (x+y);
- }
-}
-
-int main_serial (int argc, char *argv[])
-{
- int n, result;
-
- if (argc == 2)
- n = atoi (argv[1]);
- else
- n = DEFAULT_VALUE;
- result = fib_serial (n);
-
- return result;
-}
-
-int main (void)
-{
- if (main_serial (1, 0) != main_parallel (1,0))
- return 1;
- else
- return 0;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c
deleted file mode 100644
index f5f062c32b3..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/spawning_arg.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int __cilkrts_set_param (const char *, const char *);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-void f0(volatile int *steal_flag)
-{
- int i = 0;
- /* Wait for steal_flag to be set */
- while (!*steal_flag)
- ;
-}
-
-int f1()
-{
-
- volatile int steal_flag = 0;
- _Cilk_spawn f0(&steal_flag);
- steal_flag = 1; // Indicate stolen
- _Cilk_sync;
- return 0;
-}
-
-void f2(int q)
-{
- q = 5;
-}
-
-void f3()
-{
- _Cilk_spawn f2(f1());
-}
-
-int main()
-{
- /* Ensure more than one worker. */
- if (__cilkrts_set_param("nworkers", "2") != 0)
- __builtin_abort();
-
- f3();
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c
deleted file mode 100644
index 00b3c791833..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/steal_check.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int __cilkrts_set_param (const char *, const char *);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-void foo(volatile int *);
-
-void main2(void);
-
-int main(void)
-{
- /* Ensure more than one worker. */
- if (__cilkrts_set_param("nworkers", "2") != 0)
- __builtin_abort();
-
- main2();
- return 0;
-}
-
-
-void main2(void)
-{
- int some_var = 0;
-
- _Cilk_spawn foo(&some_var);
-
- some_var=1;
- some_var=5;
- some_var=3;
- some_var=4;
-
- _Cilk_sync;
- return;
-}
-
-void foo(volatile int *some_other_var)
-{
- while (*some_other_var == 0)
- {
- ;
- }
-}
-
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/sync_wo_spawn.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/sync_wo_spawn.c
deleted file mode 100644
index 51be796e562..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/sync_wo_spawn.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- _Cilk_sync; /* { dg-error "expected '_Cilk_spawn' before '_Cilk_sync'" } */
- return 0;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/test__cilk.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/test__cilk.c
deleted file mode 100644
index 3157473fff4..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/test__cilk.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* { dg-do compile } */
-/* { dg-do run { target cilkplus_runtime } } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- if (__cilk == 200)
- return 0;
- return 1;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/CK/varargs_test.c b/gcc/testsuite/c-c++-common/cilk-plus/CK/varargs_test.c
deleted file mode 100644
index d97280043de..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/CK/varargs_test.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#include <stdarg.h>
-#include <stdlib.h>
-
-
-double compute_total (int no_elements, ...);
-
-int main(void)
-{
- double array[5] = {5.0, 4.0, 9.0, 3.0, 4.0};
- double array2[5] = {5.0, 6.0, 8.0, 6.0};
- double yy=0, xx=0, xx_serial, yy_serial;
-
- yy = _Cilk_spawn compute_total(5,array[0],array[1],array[2],
- array[3], array[4]);
- xx= compute_total(4,array2[0],array2[1],array2[2], array2[3]);
-
- _Cilk_sync;
-
- yy_serial = compute_total(5,array[0],array[1],array[2], array[3], array[4]);
- xx_serial = compute_total(4,array2[0],array2[1],array2[2], array2[3]);
-
- if ((xx + yy) != (xx_serial + yy_serial))
- return 1;
- return 0;
-
-}
-
-
-double compute_total (int no_elements, ...)
-{
- double total = 0;
- va_list args;
- va_start(args, no_elements);
- int ii = 0;
- for (ii = 0; ii < no_elements; ii++)
- {
- total += va_arg(args,double);
- }
- va_end(args);
-
- return total;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/Wparentheses-1.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/Wparentheses-1.c
deleted file mode 100644
index d391d7b1eed..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/Wparentheses-1.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* PR c/70436 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -Wparentheses" } */
-
-int a, b, c;
-void bar (void);
-void baz (void);
-
-void
-f1 (void)
-{
- int i;
-
- if (a) /* { dg-warning "ambiguous" } */
- #pragma simd
- for (i = 0; i < 10; i++)
- if (b)
- bar ();
- else
- baz ();
-
- if (a)
- #pragma simd
- for (i = 0; i < 10; i++)
- {
- if (b)
- bar ();
- else
- baz ();
- }
-
- if (a)
- #pragma simd
- for (i = 0; i < 10; i++)
- {
- if (b)
- bar ();
- }
- else
- baz ();
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/body.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/body.c
deleted file mode 100644
index ed85a7a65eb..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/body.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -fopenmp" } */
-/* { dg-require-effective-target fopenmp } */
-
-int *a, *b, c;
-void *jmpbuf[10];
-
-void foo()
-{
- int j;
-
-#pragma simd
- for (int i=0; i < 1000; ++i)
- {
- if (c == 6)
- __builtin_setjmp (jmpbuf); /* { dg-error "setjmp" } */
- a[i] = b[i];
- }
-
-#pragma simd
- for (int i=0; i < 1000; ++i)
- {
- if (c==5)
- break; /* { dg-error "break statement " } */
- }
-
-#pragma simd
- for (int i=0; i < 1000; ++i)
- {
-#pragma omp for /* { dg-error "OpenMP constructs other than" } */
- for (j=0; j < 1000; ++j)
- a[i] = b[i];
- }
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses1.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses1.c
deleted file mode 100644
index 332e01cbdde..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses1.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -Werror -Wunknown-pragmas -fcilkplus" } */
-
-volatile int *a, *b;
-
-void foo()
-{
- int i, j, k;
-
-#pragma simd assert /* { dg-error "expected '#pragma simd' clause" } */
- for (i=0; i < 100; ++i)
- a[i] = b[i];
-
-#pragma simd vectorlength /* { dg-error "expected '\\('" } */
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd vectorlength /* { dg-error "expected '\\('" } */
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd vectorlength(sizeof (a) == sizeof (float) ? 4 : 8)
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd vectorlength(4,8) /* { dg-error "expected '\\)'" } */
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd vectorlength(i) /* { dg-error "\(vectorlength must be an integer\|in a constant\)" } */
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd linear(35) /* { dg-error "expected identifier" } */
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd linear(blah) /* { dg-error "'blah' \(undeclared\|has not been\)" } */
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd linear(j, 36, k) /* { dg-error "expected" } */
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd linear(i, j)
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd linear(i)
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd linear(i : 4)
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd linear(i : 2, j : 4, k)
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd linear(j : sizeof (a) == sizeof (float) ? 4 : 8)
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
- // And now everyone in unison!
-#pragma simd linear(j : 4) vectorlength(4)
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd linear(blah2, 36)
- /* { dg-error "'blah2' \(undeclared\|has not been\)" "undeclared" { target *-*-* } .-1 } */
- /* { dg-error "expected" "expected" { target *-*-* } .-2 } */
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-
-#pragma simd linear(j : k)
- for (int i=0; i < 1234; ++i)
- a[i] = b[j];
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses2.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses2.c
deleted file mode 100644
index 0f7b5006254..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses2.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-original -fcilkplus" } */
-
-volatile int *a, *b;
-
-void foo()
-{
- int j, k;
-
-#pragma simd linear(j : 4, k) vectorlength(4)
- for (int i=0; i < 1000; ++i)
- a[i] = b[j];
-}
-
-/* { dg-final { scan-tree-dump-times "linear\\(j:4\\)" 1 "original" } } */
-/* { dg-final { scan-tree-dump-times "linear\\(k:1\\)" 1 "original" } } */
-/* { dg-final { scan-tree-dump-times "safelen\\(4\\)" 1 "original" } } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses3.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses3.c
deleted file mode 100644
index 0b5ace6a1a0..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses3.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -fcilkplus" } */
-
-#define N 1000
-
-int A[N], B[N], C[N];
-int main (void)
-{
-#pragma simd private (B) linear(B:1) /* { dg-error "applied to non-integral" } */
- for (int ii = 0; ii < N; ii++)
- {
- A[ii] = B[ii] + C[ii];
- }
-
-#pragma simd private (B, C) linear(B:1) /* { dg-error "applied to non-integral" } */
- for (int ii = 0; ii < N; ii++)
- {
- A[ii] = B[ii] + C[ii];
- }
-
-#pragma simd private (B) linear(C:2, B:1) /* { dg-error "applied to non-integral" } */
- for (int ii = 0; ii < N; ii++)
- {
- A[ii] = B[ii] + C[ii];
- }
-
-#pragma simd reduction (+:B) linear(B:1) /* { dg-error "applied to non-integral" } */
- for (int ii = 0; ii < N; ii++)
- {
- A[ii] = B[ii] + C[ii];
- }
-
-#pragma simd reduction (+:B) linear(B) /* { dg-error "applied to non-integral" } */
- for (int ii = 0; ii < N; ii++)
- {
- A[ii] = B[ii] + C[ii];
- }
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses4.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses4.c
deleted file mode 100644
index 45dcb9f606a..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/clauses4.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-#define N 1000
-
-int B, C;
-double D;
-
-int main (void)
-{
- #pragma simd linear (D:10)
- for (int ii = 0; ii < N; ii++)
- ;
-
- #pragma simd private (B) linear(B:1) /* { dg-error "more than once" } */
- for (int ii = 0; ii < N; ii++)
- ;
-
- #pragma simd private (B, C) linear(B:1) /* { dg-error "more than once" } */
- for (int ii = 0; ii < N; ii++)
- ;
-
- #pragma simd private (B) linear(C:2, B:1) /* { dg-error "more than once" } */
- for (int ii = 0; ii < N; ii++)
- ;
-
- #pragma simd reduction (+:B) linear(B:1) /* { dg-error "more than once" } */
- for (int ii = 0; ii < N; ii++)
- ;
-
- #pragma simd reduction (+:B) linear(B) /* { dg-error "more than once" } */
- for (int ii = 0; ii < N; ii++)
- ;
-
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/for1.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/for1.c
deleted file mode 100644
index 3b678952c72..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/for1.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -fcilkplus" } */
-
-int *a, *b, *c;
-int something;
-
-void foo()
-{
- int i, j;
-
- // Declaration and initialization is allowed.
-#pragma simd
- for (int i=0; i < 1000; i++)
- a[i] = b[j];
-
- // Empty initialization is not allowed.
-#pragma simd
- for (; i < 5; ++i) // { dg-error "expected iteration" }
- a[i] = i;
-
- // Empty condition is not allowed.
-#pragma simd
- for (int i=0; ; ++i) /* { dg-error "missing controlling" } */
- a[i] = i;
-
- // Empty increment is not allowed.
-#pragma simd
- for (int i=0; i < 1234; ) /* { dg-error "missing increment" } */
- a[i] = i*2;
-
-#pragma simd
- i = 5; /* { dg-error "for statement expected" } */
-
- // Initialization variables must be either integral or pointer types.
- struct S {
- int i;
- };
-#pragma simd
- for (struct S ss = { 0 }; ss.i <= 1000; ++ss.i) /* { dg-error "invalid controlling\|invalid type for iteration\|invalid increment" } */
- a[ss.i] = b[ss.i];
-
- #pragma simd
- for (float f=0.0; f < 15.0; ++f) /* { dg-error "invalid type" } */
- a[(int)f] = (int) f;
-
- // Pointers are OK.
- #pragma simd
- for (int *i=c; i < &c[100]; ++i)
- *a = '5';
-
- // Condition of '==' is not allowed.
-#pragma simd
- for (int i=j; i == 5; ++i) /* { dg-error "invalid controlling predicate" } */
- a[i] = b[i];
-
- // The LHS or RHS of the condition must be the initialization variable.
-#pragma simd
- for (int i=0; i+j < 1234; ++i) /* { dg-error "invalid controlling predicate" } */
- a[i] = b[i];
-
- // Likewise.
-#pragma simd
- for (int i=0; 1234 < i + j; ++i) /* { dg-error "invalid controlling predicate" } */
- a[i] = b[i];
-
- // Likewise, this is ok.
-#pragma simd
- for (int i=0; 1234 + j < i; ++i)
- a[i] = b[i];
-
- // According to the CilkPlus forum, casts are not allowed, even if
- // they are no-ops.
-#pragma simd
- for (int i=0; (char)i < 1234; ++i) /* { dg-error "invalid controlling predicate" } */
- a[i] = b[i];
-
-#pragma simd
- for (int i=255; i != something; --i)
- a[i] = b[i];
-
-#pragma simd
- for (int i=100; i != 5; i += something)
- a[i] = b[i];
-
- // Increment must be on the induction variable.
-#pragma simd
- for (int i=0; i < 100; j++) /* { dg-error "invalid increment expression" } */
- a[i] = b[i];
-
- // Likewise.
-#pragma simd
- for (int i=0; i < 100; j = i + 1) /* { dg-error "invalid increment expression" } */
- a[i] = b[i];
-
- // Likewise.
-#pragma simd
- for (int i=0; i < 100; i = j + 1) /* { dg-error "invalid increment expression" } */
- a[i] = b[i];
-
-#pragma simd
- for (int i=0; i < 100; i = i + 5)
- a[i] = b[i];
-
- // Only PLUS and MINUS increments are allowed.
-#pragma simd
- for (int i=0; i < 100; i *= 5) /* { dg-error "invalid increment expression" } */
- a[i] = b[i];
-
-#pragma simd
- for (int i=0; i < 100; i -= j)
- a[i] = b[i];
-
-#pragma simd
- for (int i=0; i < 100; i = i + j)
- a[i] = b[i];
-
-#pragma simd
- for (int i=0; i < 100; i = j + i)
- a[i] = b[i];
-
-#pragma simd
- for (int i=0; i < 100; ++i, ++j) /* { dg-error "invalid increment expression" } */
- a[i] = b[i];
-
-#pragma simd
- for (int *point=0; point < b; ++point)
- *point = 555;
-
-#pragma simd
- for (int *point=0; point > b; --point)
- *point = 555;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/for2.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/for2.c
deleted file mode 100644
index 86606275ac4..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/for2.c
+++ /dev/null
@@ -1,8 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -fcilkplus" } */
-
-#pragma simd /* { dg-error "must be inside a function" } */
-
-void foo()
-{
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/for3.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/for3.c
deleted file mode 100644
index 2da8235f319..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/for3.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -fcilkplus" } */
-
-int *a, *c;
-
-void foo()
-{
- int i, j;
-
- // Pointers are OK.
- #pragma simd
- for (int *i=c; i < c; ++i)
- *a = '5';
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/pr69363.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/pr69363.c
deleted file mode 100644
index 1d1bb048e49..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/pr69363.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-double t1 (double *x, int N)
-{
- double result = 0.0;
-
- #pragma simd reduction (max: result)
- for (int i = 0; i < N; ++i)
- result = x[i] > result ? x[i] : result;
-
- return result;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-1.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-1.c
deleted file mode 100644
index d8cec84f149..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-1.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-O3 -fcilkplus" } */
-
-/* FIXME: This test has been xfailed until reductions are fixed. */
-
-int argc = 1;
-
-/* This is a simple vectorization test. It tests if reduction works
- and if it can vectorize the loop in func correctly. */
-#define N 1000
-
-int func (int *p, int *q) {
- int x = 0;
-#pragma simd reduction (+:x)
- for (int ii = 0; ii < N; ii++) {
- x += (q[ii] + p[ii]);
- }
- return x;
-
-}
-
-int main ()
-{
- int ii = 0, x;
- int Array[N], Array2[N];
-
- for (ii = 0; ii < N; ii++)
- {
- Array[ii] = 5 + argc;
- Array2[ii] = argc;
- }
- x = func (Array, Array2);
-
- if (x != N * 7)
- return 1;
- return 0;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-2.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-2.c
deleted file mode 100644
index f5554f6b1ae..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-2.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-O3 -fcilkplus" } */
-
-/* FIXME: This test has been xfailed until reductions are fixed. */
-
-#include <stdio.h>
-
-#define ARRAY_SIZE (256)
-int a[ARRAY_SIZE];
-
-__attribute__((noinline))
-int addit (int *arr, int N)
-{
- int s=0;
-#pragma simd reduction (+:s)
- for (int i = 0; i < N; i++)
- s += arr[i];
- return s;
-}
-
-int main () {
- int i, s = 0, r = 0;
- for (i = 0; i < ARRAY_SIZE; i++)
- {
- a[i] = i;
- }
-
- s = addit (a, ARRAY_SIZE);
-
- for (i = 0; i < ARRAY_SIZE; i++)
- r += i;
-
- if (s == r)
- return 0;
- return 1;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-3.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-3.c
deleted file mode 100644
index 35cb904a540..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/reduction-3.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-O3 -fcilkplus" } */
-
-#define N 256
-#if HAVE_IO
-#include <stdio.h>
-#endif
-#include <stdlib.h>
-
-int
-reduction_simd (int *a)
-{
- int s = 0;
-
-#pragma simd reduction (+:s)
- for (int i = 0; i < N; i++)
- {
- s += a[i];
- }
-
- return s;
-}
-
-int
-main ()
-{
- int *a = (int *) malloc (N * sizeof (int));
- int i, s = (N - 1) * N / 2;
-
- for (i = 0; i < N; i++)
- {
- a[i] = i;
- }
-#if HAVE_IO
- printf ("%d, %d\n", s, reduction_simd (a));
-#endif
- if (s == reduction_simd (a))
- return 0;
- else
- return 1;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/run-1.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/run-1.c
deleted file mode 100644
index c8fe1c762bc..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/run-1.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus -O3" } */
-
-#include <stdlib.h>
-
-#define N 4
-
-float f1[] = { 2.0, 3.0, 4.0, 5.0 };
-float f2[] = { 1.0, 6.0, -1.0, -2.0 };
-float res[] = { 3.0, 9.0, 3.0, 3.0 };
-
-__attribute__((noinline))
-void verify (float *sum)
-{
- for (int i=0; i < N; ++i)
- if (sum[i] != res[i])
- abort ();
-}
-
-int main()
-{
- float sum[N];
-#pragma simd
- for (int i=0; i < N; ++i)
- sum[i] = f1[i] + f2[i];
- verify (sum);
- return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/safelen.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/safelen.c
deleted file mode 100644
index 5af2909d2ec..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/safelen.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-gimple -fcilkplus" } */
-
-int *a, *b;
-
-void foo()
-{
-#pragma simd vectorlength(8)
- for (int i=0; i < 1000; ++i)
- a[i] = b[i];
-}
-
-/* { dg-final { scan-tree-dump-times "safelen\\(8\\)" 1 "gimple" } } */
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-2.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-2.c
deleted file mode 100644
index d90397717ac..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-2.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -fcilkplus" } */
-
-#define vl(n) vectorlength(2*n)
-void
-foo (int *a, int *b, int *c)
-{
- int i;
-#pragma simd vl(4)
- for (i = 0; i < 64; i++)
- a[i] = b[i] * c[i];
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-3.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-3.c
deleted file mode 100644
index d219a85acd5..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength-3.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -fcilkplus -save-temps" } */
-
-#define vl(n) vectorlength(2*n)
-void
-foo (int *a, int *b, int *c)
-{
- int i;
-#pragma simd vl(4)
- for (i = 0; i < 64; i++)
- a[i] = b[i] * c[i];
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength.c b/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength.c
deleted file mode 100644
index 9aa4a68290d..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/PS/vectorlength.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -fcilkplus" } */
-
-volatile int *a, *b, N;
-typedef int tint;
-struct someclass {
- int a;
- char b;
- int *p;
-};
-
-void foo()
-{
-#pragma simd vectorlength(4) vectorlength(8) /* { dg-error "too many 'vectorlength' clauses" } */
- for (int i=0; i < N; ++i)
- a[i] = b[i];
-
-#pragma simd vectorlength(3) /* { dg-error "must be a power of 2" } */
- for (int i=0; i < N; ++i)
- a[i] = b[i];
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error.c b/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error.c
deleted file mode 100644
index 5312992ff66..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -fopenmp-simd" } */
-
-#pragma omp declare simd linear(y:1) simdlen(4)
-__attribute__((vector (linear (y:1), vectorlength(4))))
-int func (int x, int y) { /* { dg-error "cannot be used in the same function marked as a Cilk Plus SIMD-enabled" } */
- return (x+y);
-}
-__attribute__((vector (linear (y:1), private (x)))) /* { dg-error "is not valid for" } */
-int func2 (int x, int y) {
- return (x+y);
-}
-
-__attribute__((vector (linear (y:1), simdlen (4)))) /* { dg-error "is not valid for" } */
-int func2_1 (int x, int y) {
- return (x+y);
-}
-
-__attribute__((vector (linear (y:1), inbranch))) /* { dg-error "is not valid for" } */
-int func2_3 (int x, int y) {
- return (x+y);
-}
-
-__attribute__((vector (notinbranch, vectorlength (4)))) /* { dg-error "is not valid for" } */
-int func2_2 (int x, int y) {
- return (x+y);
-}
-
-int main (void)
-{
- return (func (5,6));
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error2.c b/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error2.c
deleted file mode 100644
index 28c3c987418..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error2.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* The warning is x86-only. */
-/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-options "-fcilkplus -Wall" } */
-
-__attribute__((vector (vectorlength(128))))
-//#pragma omp simd simdlen (128)
-int func2 (int x, int y) /* { dg-warning "unsupported simdlen" } */
-{
- return (x+y);
-}
-
-int main (void)
-{
- return (func2 (5,6));
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error3.c b/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error3.c
deleted file mode 100644
index 789e2bc013d..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error3.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -Wall" } */
-
-__attribute__((vector (linear (x:y)))) /* { dg-message "parameter" "" { target c++ } } */
-int func2 (int x, int y)
-{ /* { dg-message "using parameters for" "" { target c } } */
- return (x+y);
-}
-
-int main (void)
-{
- return (func2 (5,6));
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_test.c b/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_test.c
deleted file mode 100644
index e606acac16f..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_test.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -Wunknown-pragmas" } */
-
-/* Tests the clauses in several combinations put in different locations. */
-/* This is mostly a parser test. */
-#define Q 4
-
-int z = Q;
-
- __attribute__ ((vector (uniform(x), linear (y:1), vectorlength (4) )))
-int func (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
- __attribute__ ((__vector__ (uniform(x), vectorlength (2), linear (y:1) )))
-int func2 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector (uniform(y), linear (x), vectorlength (4) )))
-int func3 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector (uniform(x), linear (y:1), mask)))
-int func4 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector (uniform(x), linear (y:1), nomask)))
-int func5 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector (uniform(x), mask, linear (y:1))))
-int func6 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector (uniform (x), mask, linear (y:1)), vector))
-int func7 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector (uniform (x), mask, linear (y:1)), vector (uniform (y), mask)))
-int func8 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector, vector (uniform (y), mask)))
-int func9 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-int main (int argc, char *argv[])
-{
- int ii = 0, q = 5;
- for (ii = 0; ii < 10; ii++)
- q += func (argc, ii);
- return q;
-}
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_test2.c b/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_test2.c
deleted file mode 100644
index 7ec0578b412..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/SE/ef_test2.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-void func (int x, int y) __attribute__((vector(linear(x:1), uniform (y)),
- vector));
-
-int q;
-int main (void)
-{
- int ii = 0;
- q = 5;
- for (ii = 0; ii < 100; ii++)
- func (ii, q);
-
- return 0;
-}
-
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/SE/vlength_errors.c b/gcc/testsuite/c-c++-common/cilk-plus/SE/vlength_errors.c
deleted file mode 100644
index 88e4678552b..00000000000
--- a/gcc/testsuite/c-c++-common/cilk-plus/SE/vlength_errors.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -Wunknown-pragmas" } */
-
-#define Q 4
-
-int z = Q;
-
-__attribute__ ((vector (uniform(x), vectorlength (), linear (y:1) ))) /* { dg-error "expected expression" "" { target c } } */
- /* { dg-error "expected primary-expression" "" { target c++ } .-1 } */
-int func2 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector (uniform(x), linear (y:1), vectorlength (4.5) ))) /* { dg-error "vectorlength must be an integer" } */
-int func3 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector (uniform(x), linear (y:1), vectorlength (z) ))) /* { dg-error "vectorlength must be an integer" "" { target c } } */
- /* { dg-error "constant" "" { target c++ } .-1 } */
-int func4 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector (uniform(x), linear (y:1), vectorlength (Q) ))) /* This is OK! */
-int func5 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector (uniform(x), vectorlength (z), linear (y:1)))) /* { dg-error "vectorlength must be an integer" "" { target c } } */
- /* { dg-error "constant" "" { target c++ } .-1 } */
-int func6 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-__attribute__ ((vector (uniform(x), linear (y:1), vectorlength (sizeof (int)) ))) /* This is OK too! */
-int func7 (int x, int y)
-{
- int zq = 5;
- return x + (y*zq);
-}
-
-int main (void)
-{
- int ii = 0, q = 5;
- for (ii = 0; ii < 10; ii++)
- q += func2 (z, ii);
- return q;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/AN/array_function.cc b/gcc/testsuite/g++.dg/cilk-plus/AN/array_function.cc
deleted file mode 100644
index b111e217cfc..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/AN/array_function.cc
+++ /dev/null
@@ -1,8 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-void f() { }
-int main()
-{
- f[0:1:1]; // { dg-error "function type" }
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/AN/array_test1_tplt.cc b/gcc/testsuite/g++.dg/cilk-plus/AN/array_test1_tplt.cc
deleted file mode 100644
index e9ee7ec6385..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/AN/array_test1_tplt.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#include <cstdlib>
-#include <string.h>
-#if HAVE_IO
-#include <cstdio>
-#endif
-template <class T> int main2 (char **argv);
-
-int main (void)
-{
- int x = 1, y = 1, z = 1;
- char *array[2];
- array[0] = strdup ("a.out");
- array[1] = strdup ("5");
- x = main2<unsigned char> (array);
- x += main2<char> (array);
- y = main2<short> (array);
- y += main2<unsigned short> (array);
- y += main2<int> (array);
- y += main2<unsigned int> (array);
- z = main2<long> (array);
- z += main2<long long> (array);
- y += main2<float> (array);
- z += main2<double> (array);
-
- return x+y+z;
-}
-template <class T>
-int main2 (char **argv)
-{
- T array[10];
- int ii = 0, x = 2, z= 0 , y = 0;
-
- for (ii = 0; ii < 10; ii++)
- array[ii] = 10;
-
- array[0:10:1] = (T)15;
-
- for (ii = 0; ii < 10; ii++)
- if (array[ii] != (T)15)
- return 1;
-
-
- array[0:5:2] = (T)20;
-
- for (ii = 0; ii < 10; ii += 2)
- if (array[ii] != (T)20)
- return 2;
-
-
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
-
- array[x:5:z] = (T)50;
-
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != (T)50)
- return 3;
-
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]); /* (10 - 5) / 5 = 1 */
- y = 10-atoi(argv[1]);
-
- array[x:y:z] = (T)52;
-#if HAVE_IO
- for (ii = atoi ("5"); ii < (atoi ("5") + atoi ("5")); ii += atoi ("1"))
- std::printf("%d\t", (int)array[ii]);
- std::printf("\n");
-#endif
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != (T)52)
- return 4;
-
-
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
- y = 10-atoi(argv[1]);
-
- array[x:y:((10-atoi(argv[1]))/atoi(argv[1]))] = (T)25;
-
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != (T)25)
- return 5;
-
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
- y = 10-atoi(argv[1]);
-
- array[atoi(argv[1]):(10-atoi(argv[1])):((10-atoi(argv[1]))/atoi(argv[1]))] =
- (T)14;
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != (T)14)
- return 6;
-
-
- array[atoi("5"):5:1] = (T)65;
-
- for (ii = atoi ("5"); ii < 10; ii++)
- if (array[ii] != (T)65)
- return 7;
-
-
- array[atoi("5"):atoi("5"):atoi("1")] = 99;
-
-#if HAVE_IO
- for (ii = atoi ("5"); ii < (atoi ("5") + atoi ("5")); ii += atoi ("1"))
- std::printf("%d\t", (int)array[ii]);
- std::printf("\n");
-#endif
-
- for (ii = atoi ("5"); ii < (atoi ("5") + atoi ("5")); ii += atoi ("1"))
- if (array[ii] != (T)99)
- return 8;
-
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/AN/array_test2_tplt.cc b/gcc/testsuite/g++.dg/cilk-plus/AN/array_test2_tplt.cc
deleted file mode 100644
index 041c0528976..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/AN/array_test2_tplt.cc
+++ /dev/null
@@ -1,141 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus -Wno-overflow" } */
-
-#include <cstdlib>
-#include <string.h>
-template <class T> int main2(char **argv);
-int main(void)
-{
- int x = 1, y = 1, z = 1, w = 1;
- char *array[2];
- array[0] = strdup ("a.out");
- array[1] = strdup ("5");
- w = main2<short>(array);
- w += main2<unsigned short> (array);
- x = main2<char> (array);
- x += main2<unsigned char> (array);
- y = main2<int> (array);
- y += main2<unsigned int> (array);
- z = main2<long> (array);
- z += main2<unsigned long> (array);
- z += main2<long long> (array);
-
- return (w+x+y+z);
-}
-
-template<class T>
-int main2(char **argv)
-{
- T array[10], array2[10];
- int ii = 0, x = 2, z= 0 , y = 0 ;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 10;
- array2[ii] = 5000000;
- }
-
- array2[0:10:1] = array[0:10:1];
-
- for (ii = 0; ii < 10; ii++)
- if (array2[ii] != array[ii])
- return 1;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 10;
- array2[ii] = 5000000;
- }
-
- array2[0:5:2] = array[0:5:2];
-
- for (ii = 0; ii < 10; ii += 2)
- if (array[ii] != array2[ii])
- return 2;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 10;
- array2[ii] = 5000000;
- }
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
-
- array2[x:5:z] = array[x:5:z];
-
- for (ii = x; ii < 5; ii += z)
- if (array2[ii] != array[ii])
- return 3;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 500;
- array2[ii] = 1000000;
- }
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
- y = 10-atoi(argv[1]);
-
- array2[x:y:z] = array[x:y:z];
- for (ii = x; ii < 10; ii = ii + z)
- if (array2[ii] != array[ii])
- return 4;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 500;
- array2[ii] = 1000000;
- }
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
- y = 10-atoi(argv[1]);
-
- array[x:y:((10-atoi(argv[1]))/atoi(argv[1]))] =
- array2[x:y:((10-atoi(argv[1]))/atoi(argv[1]))];
-
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != array2[ii])
- return 6;
-
-
- x = atoi(argv[1]);
- z = (10-atoi(argv[1]))/atoi(argv[1]);
- y = 10-atoi(argv[1]);
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 500;
- array2[ii] = 1000000;
- }
-
- array[atoi(argv[1]):(10-atoi(argv[1])):((10-atoi(argv[1]))/atoi(argv[1]))] =
- array2[atoi(argv[1]):(10-atoi(argv[1])):((10-atoi(argv[1]))/atoi(argv[1]))];
- for (ii = x; ii < 10; ii += z)
- if (array[ii] != array2[ii])
- return 6;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 4;
- array2[ii] = 2;
- }
-
- array[atoi("5"):5:1] = array2[atoi("5"):5:1];
-
- for (ii = atoi ("5"); ii < 10; ii++)
- if (array[ii] != array2[ii])
- return 7;
-
- for (ii = 0; ii < 10; ii++)
- {
- array[ii] = 5;
- array2[ii] = 1;
- }
- array[atoi("5"):atoi("5"):atoi("1")] = array2[atoi("5"):atoi("5"):atoi("1")];
-
- for (ii = 5; ii < 10; ii++)
- if (array2[ii] != array[ii])
- return 8;
-
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/AN/array_test_ND_tplt.cc b/gcc/testsuite/g++.dg/cilk-plus/AN/array_test_ND_tplt.cc
deleted file mode 100644
index 479ba134899..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/AN/array_test_ND_tplt.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#include <cstdlib>
-#include<string.h>
-template <class T> int main2(char **argv);
-
-int main(void)
-{
- int x = 1, y=1, z=1, w = 1;
- char *array[3];
- array[0] = strdup ("a.out");
- array[1] = strdup ("10");
- array[2] = strdup ("15");
- w = main2<char> (array);
- w += main2<unsigned char> (array);
- x = main2<int> (array);
- x += main2<unsigned int> (array);
- y = main2<long> (array);
- y += main2<unsigned long> (array);
- z = main2<short> (array);
- z += main2<unsigned short> (array);
- return x+y+z;
-}
-
-template <class T>
-int main2(char **argv)
-{
- T array[10][15];
- T array_2[10][15];
- int ii = 0, jj = 0,x = 0, z= 1 , y = 10 ,argc = 3;
-
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj< 15; jj++) {
- array[ii][jj] = ii+jj;
- array_2[ii][jj] = 0;
- }
- }
- array_2[0:5:2][0:5:3] = array[0:5:2][0:5:3] + 1 + 5 + array[0][5] + x;
-
- for (ii = 0; ii < 10; ii += 2)
- {
- for (jj = 0; jj < 15; jj += 3)
- {
- if (array_2[ii][jj] != array[ii][jj] + 1 + 5 + array[0][5] + x)
- return 1;
- }
- }
-
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj< 15; jj++) {
- array[ii][jj] = ii+jj;
- array_2[ii][jj] = 0;
- }
- }
- x = atoi(argv[1]);
- y = atoi(argv[2]);
- array_2[0:x:1][0:y:1] = array[0:x:1][0:y:1] + x + y + array[0:x:1][0:y:1];
-
- for (ii = 0; ii < x; ii++)
- {
- for (jj = 0; jj < y; jj++)
- {
- if (array_2[ii][jj] != array[ii][jj] + x + y + array[ii][jj])
- return 2;
- }
- }
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj< 15; jj++) {
- array[ii][jj] = ii+jj;
- array_2[ii][jj] = 0;
- }
- }
- x = atoi(argv[1]);
- y = atoi(argv[2]);
- z = (20- atoi (argv[1]))/atoi(argv[1]);
- /* (20-10)/10 evaluates to 1 all the time :-). */
- array_2[0:x:z][0:y:z] = array[0:x:z][0:y:z] + array[0:x:z][0:y:z] + y + z;
-
- for (ii = 0; ii < x; ii += z)
- {
- for (jj = 0; jj < y; jj += z)
- {
- if (array_2[ii][jj] != array[ii][jj] + array[ii][jj] + y + z)
- return 3;
- }
- }
-
-
-
- for (ii = 0; ii < 10; ii++) {
- for (jj = 0; jj< 15; jj++) {
- array[ii][jj] = ii+jj;
- array_2[ii][jj] = 0;
- }
- }
- x = argc-3;
- y = 20-atoi(argv[1]);
- z = (20- atoi (argv[1]))/atoi(argv[1]);
- /* (20-10)/10 evaluates to 1 all the time :-). */
- array_2[(argc-3):(20-atoi(argv[1])):(20-atoi(argv[1]))/atoi(argv[1])][(argc-3):(30-atoi(argv[2])): ((30-atoi(argv[2]))/atoi(argv[2]))] = array[(argc-3):20-atoi(argv[1]):(20-atoi(argv[1]))/atoi(argv[1])][(argc-3):(30-atoi(argv[2])): (30-atoi(argv[2]))/atoi(argv[2])] + array[(argc-3):20-atoi(argv[1]):(20-atoi(argv[1]))/atoi(argv[1])][(argc-3):(30-atoi(argv[2])): (30-atoi(argv[2]))/atoi(argv[2])] * array[(argc-3):20-atoi(argv[1]):(20-atoi(argv[1]))/atoi(argv[1])][(argc-3):(30-atoi(argv[2])): (30-atoi(argv[2]))/atoi(argv[2])];
-
- for (ii = 0; ii < 10; ii++)
- {
- for (jj = 0; jj < 15; jj++)
- {
- if (array_2[ii][jj] != array[ii][jj] + array[ii][jj] * array[ii][jj])
- return 4;
- }
- }
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/AN/braced_list.cc b/gcc/testsuite/g++.dg/cilk-plus/AN/braced_list.cc
deleted file mode 100644
index 3521f87258a..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/AN/braced_list.cc
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile { target c++11 } } */
-/* { dg-options "-fcilkplus" } */
-
-int main (void)
-{
- int Array[100], Array2[100];
-
- Array[{1,2}:2] = 5; /* { dg-error "braced list index is not allowed" } */
- Array[1:{1,2}:2] = 5; /* { dg-error "expected primary-expression before" } */
- Array[1:10:{1,2}] = 5; /* { dg-error "expected primary-expression before" } */
-
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/AN/builtin_fn_custom_tplt.cc b/gcc/testsuite/g++.dg/cilk-plus/AN/builtin_fn_custom_tplt.cc
deleted file mode 100644
index 3d9e87bceb5..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/AN/builtin_fn_custom_tplt.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus " } */
-
-#if HAVE_IO
-#include <cstdio>
-#endif
-
-#include <cstdlib>
-
-template <class T>
-T my_func (T x, T y)
-{
- if (x > y)
- return x;
- else
- return y;
-}
-
-template <class T>
-T main_func (T *array, T *array2, T identity_val, int size)
-{
- T result;
-
- result = __sec_reduce (identity_val, array[0:size:1] * array2[0:size:1],
- my_func); // my_func (identity_val, array[5] * array2[5]);
- return result;
-}
-int main (void)
-{
- int i_index = 0, f_index = 0, d_index = 0, l_index = 0;
- int iarray[10], iarray2[10], i_result, i_max;
- long larray[10], larray2[10], l_result, l_max;
- float farray[10], farray2[10], f_result, f_max;
- double darray[10], darray2[10], d_result, d_max;
- for (int ii = 0; ii < 10; ii++)
- {
- if (ii%2 && ii)
- {
- darray[ii] = (double)(1.0000/(double)ii);
- farray[ii] = (float)(1.00/(float)ii);
- }
- else
- {
- darray[ii] = (double) ii + 0.10;
- farray[ii] = (float) (1.00/((float)(ii+1.000)));
- }
- darray2[ii] = (double) (1.00000/ (double)(ii+1));
- farray2[ii] = (float) (1.00/ (float)(ii+1));
- }
-
- for (int ii = 0; ii < 10; ii++)
- {
- iarray[ii] = ii;
- larray[ii] = (long)ii;
- }
-
- for (int ii = 0; ii < 10; ii++)
- {
- iarray2[ii] = (ii-5);
- larray2[ii] = long (ii-5);
- }
-#if HAVE_IO
- printf("Int: ");
- for (int ii=0; ii < 10; ii++)
- {
- printf("%2d ", iarray[ii] * iarray2[ii]);
- }
- printf("\nfloat: ");
- for (int ii=0; ii < 10; ii++)
- {
- printf("%4.3f ", farray[ii] * farray2[ii]);
- }
-
- printf("\nlong: ");
- for (int ii=0; ii < 10; ii++)
- {
- printf("%2d ", larray[ii] * larray2[ii]);
- }
-
- printf("\ndouble: ");
- for (int ii=0; ii < 10; ii++)
- {
- printf("%4.3f ", (float) (darray[ii] * darray2[ii]));
- }
- printf("\n");
-#endif
-
- i_result = main_func<int> (iarray, iarray2, iarray[0] * iarray2[0], 10);
- f_result = main_func<float>(farray, farray2, 0.00, 10);
- d_result = main_func<double>(darray, darray2, 0.0000, 10);
- l_result = main_func<long>(larray, larray2, 0, 10);
-
-#if HAVE_IO
- printf("int result = %2d\n", i_result);
- printf ("long result = %2d\n", l_result);
- printf("float result = %4.3f\n", f_result);
- printf("double result = %4.3lf\n", d_result);
-#endif
-
- i_max = iarray[0] * iarray2[0];
- f_max = farray[0] * farray2[0];
- d_max = darray[0] * darray2[0];
- l_max = larray[0] * larray2[0];
- for (int ii = 0; ii < 10; ii++)
- {
- if (i_max < iarray[ii] * iarray2[ii])
- i_max = iarray[ii] * iarray2[ii];
- if (f_max < farray[ii] * farray2[ii])
- f_max = farray[ii] * farray2[ii];
- if (d_max < darray[ii] * darray2[ii])
- d_max = darray[ii] * darray2[ii];
- if (l_max < larray[ii] * larray2[ii])
- l_max = larray[ii] * larray2[ii];
- }
-
- if (i_max != i_result)
- return 1;
- if (f_max != f_result)
- return 2;
- if (d_max != d_result)
- return 3;
- if (l_max != l_result)
- return 4;
- return 0;
-}
-
diff --git a/gcc/testsuite/g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.cc b/gcc/testsuite/g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.cc
deleted file mode 100644
index 111a2a29686..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/AN/builtin_fn_mutating_tplt.cc
+++ /dev/null
@@ -1,136 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#if HAVE_IO
-#include <cstdio>
-#include<iostream>
-#endif
-
-#include <cstdlib>
-
-template <class T>
-T my_func (T *x, T y)
-{
- if (*x < y)
- *x = y;
- else
- *x = *x;
-
- return T();
-}
-
-template <class T> T my_func (T *x, T y);
-template <class T>
-T main_func (T *array, T *array2, T identity_val, int size)
-{
- T result = identity_val;
-
- __sec_reduce_mutating (&result, array[0:size] * array2[0:size:1], my_func);
-
-#if HAVE_IO
- std::cout << "Result = " << result << std::endl;
-#endif
- return result;
-}
-
-int main (void)
-{
- int iarray[10], iarray2[10], i_result = 0, i_max;
- long larray[10], larray2[10], l_result = 0, l_max;
- float farray[10], farray2[10], f_result = 0, f_max;
- double darray[10], darray2[10], d_result = 0, d_max;
- for (int ii = 0; ii < 10; ii++)
- {
- if (ii%2 && ii)
- {
- darray[ii] = (double)(1.0000/(double)(ii));
- farray[ii] = (float)(1.00/(float)(ii));
- }
- else
- {
- darray[ii] = (double) ii + 0.10;
- farray[ii] = (float) (1.00/((float)(ii) + 0.10));
- }
- darray2[ii] = (double) (1.00000/ (double)(ii+1));
- farray2[ii] = (float) (1.00/ (float)(ii+1));
- }
-
- for (int ii = 0; ii < 10; ii++)
- {
- iarray[ii] = ii;
- larray[ii] = (long)ii;
- }
-
- for (int ii = 0; ii < 10; ii++)
- {
- iarray2[ii] = (ii-5);
- larray2[ii] = (long)ii-5;
- }
-#if HAVE_IO
- printf("\nInt: ");
- for (int ii=0; ii < 10; ii++)
- {
- printf("%2d ", iarray[ii] * iarray2[ii]);
- }
- printf("\nfloat: ");
- for (int ii=0; ii < 10; ii++)
- {
- printf("%3.2f ", farray[ii] * farray2[ii]);
- }
-
- printf("\nlong: ");
- for (int ii=0; ii < 10; ii++)
- {
- printf("%2d ", larray[ii] * larray2[ii]);
- }
-
- printf("\ndouble: ");
- for (int ii=0; ii < 10; ii++)
- {
- printf("%4.3lf ", (float) (darray[ii] * darray2[ii]));
- }
- printf("\n");
-#endif
-
- i_result = main_func<int> (iarray, iarray2, 0, 10);
- l_result = main_func<long>(larray, larray2, 0, 10);
- f_result = main_func<float>(farray, farray2, 0.00, 10);
- d_result = main_func<double>(darray, darray2, 0.0000, 10);
-
- i_max = iarray[0] * iarray2[0];
- d_max = darray[0] * darray2[0];
- f_max = farray[0] * farray2[0];
- l_max = larray[0] * larray2[0];
- for (int ii = 0; ii < 10; ii++)
- {
- if (iarray[ii] * iarray2[ii] > i_max)
- i_max = iarray[ii] * iarray2[ii];
- if (darray[ii] * darray2[ii] > d_max)
- d_max = darray[ii] * darray2[ii];
- if (farray[ii] * farray2[ii] > f_max)
- f_max = farray[ii] * farray2[ii];
- if (larray[ii] * larray2[ii] > l_max)
- l_max = larray[ii] * larray2[ii];
- }
-#if HAVE_IO
- printf("int result = %2d\n", i_max);
- printf("long result = %2d\n", l_max);
- printf("float result = %4.3f\n", f_max);
- printf("double result = %4.3lf\n", (float)d_max);
-#endif
-
- if (i_max != i_result)
- return 1;
-
- if (f_max != f_result)
- return 2;
-
- if (l_max != l_result)
- return 3;
-
- if (d_max != d_result)
- return 4;
-
- return 0;
-}
-
diff --git a/gcc/testsuite/g++.dg/cilk-plus/AN/fp_triplet_values_tplt.c b/gcc/testsuite/g++.dg/cilk-plus/AN/fp_triplet_values_tplt.c
deleted file mode 100644
index 1387558a834..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/AN/fp_triplet_values_tplt.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-float q;
-
-void func (int *x)
-{
- *x = 5;
-}
-template <class T> int main2 (T x, T y, T z);
-
-int main (void)
-{
- main2 <float> (1.5, 2.3, 3.443);
- main2 <double> (1.34393, 2.38383, 4.38383);
- return 0;
-}
-template <class T>
-int main2 (T x, T y, T z)
-{
- int array[10], array2[10];
- array2[:] = array[x:2]; /* { dg-error "start-index of array notation triplet is not an integer" } */
- array2[:] = array[1:y]; /* { dg-error "length of array notation triplet is not an integer" } */
- array2[1:2:z] = array[:]; /* { dg-error "stride of array notation triplet is not an integer" } */
- func (&array2[1:x:3]); /* { dg-error "length of array notation triplet is not an integer" } */
- array2[y:9]++; /* { dg-error "start-index of array notation triplet is not an integer" } */
- array2[1:x]++; /* { dg-error "length of array notation triplet is not an integer" } */
- array2[1:9:x]++; /* { dg-error "stride of array notation triplet is not an integer" } */
-
- ++array2[1:q:3]; /* { dg-error "length of array notation triplet is not an integer" } */
- array2[:] = array[q:1:3]; /* { dg-error "start-index of array notation triplet is not an integer" } */
- array2[:] = array[1:q:3]; /* { dg-error "length of array notation triplet is not an integer" } */
- array2[:] = array[1:3:q]; /* { dg-error "stride of array notation triplet is not an integer" } */
- func (&array2[1:q:3]); /* { dg-error "length of array notation triplet is not an integer" } */
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/AN/postincr_test.cc b/gcc/testsuite/g++.dg/cilk-plus/AN/postincr_test.cc
deleted file mode 100644
index b0952c71bca..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/AN/postincr_test.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-#define HAVE_IO 0
-
-#if HAVE_IO
-#include <cstdio>
-#endif
-
-#include <cstdlib>
-template <class T> int main2(int argc);
-
-int main (void)
-{
- return (main2<int>(1) + main2<long> (1) + main2<long long> (1));
-}
-
-#if HAVE_IO
-template <class T> int print_array (T *array, int size);
-template <class T> int print_array (T *array, int size)
-{
- for (int ii = 0; ii < size; ii++)
- printf("%d ", array[ii]);
- printf("\n");
- return 0;
-}
-#endif
-
-template <class T>
-int main2(int argc)
-{
- T array[10], array_serial[10];
-
- for (int ii = 0; ii < 10; ii++) {
- array[ii] = 0;
- array_serial[ii] = 0;
- }
-
- array[:] = 19383;
- for (int ii = 0; ii < 10; ii++)
- array_serial[ii] = 19383;
-
- array[:]++;
-
- for (int ii = 0; ii < 10; ii++)
- array_serial[ii]++;
-
-#if HAVE_IO
- print_array<T>(array, 10);
- print_array<T>(array_serial, 10);
-#endif
-
- for (int ii = 0; ii < 10; ii++)
- if (array_serial[ii] != array[ii])
- return 1;
-
- for (int ii = 0; ii < 10; ii++)
- array[:]++;
-
- for (int ii = 0; ii < 10; ii++)
- for (int jj = 0; jj < 10; jj++)
- array_serial[jj]++;
-
-#if HAVE_IO
- print_array<T>(array, 10);
- print_array<T>(array_serial, 10);
-#endif
-
- for (int ii = 0; ii < 10; ii++)
- if (array_serial[ii] != array[ii])
- return 2;
-
- if (argc == 2)
- array[0:10:1]++;
-
- if (argc == 2)
- {
- for (int ii = 0; ii < 10; ii++)
- array_serial[ii]++;
- }
-
-#if HAVE_IO
- print_array<T>(array, 10);
- print_array<T>(array_serial, 10);
-#endif
-
- for (int ii = 0; ii < 10; ii++)
- if (array_serial[ii] != array[ii])
- return 3;
-
- array[0:10/argc:argc]++;
-
- for (int ii = 0; ii < 10; ii += argc)
- array_serial[ii]++;
-
-
- for (int ii = 0; ii < 10; ii++)
- if (array_serial[ii] != array[ii])
- return 4;
-
-#if HAVE_IO
- print_array<T>(array, 10);
- print_array<T>(array_serial, 10);
-#endif
-
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/AN/preincr_test.cc b/gcc/testsuite/g++.dg/cilk-plus/AN/preincr_test.cc
deleted file mode 100644
index f5552c7ed0e..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/AN/preincr_test.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-
-#define HAVE_IO 0
-
-#if HAVE_IO
-#include <cstdio>
-#endif
-
-#include <cstdlib>
-template <class T> int main2(int argc);
-
-int main (void)
-{
- return (main2<int>(1) + main2<long> (1) + main2<long long> (1));
-}
-
-#if HAVE_IO
-template <class T> int print_array (T *array, int size);
-template <class T> int print_array (T *array, int size)
-{
- for (int ii = 0; ii < size; ii++)
- printf("%d ", array[ii]);
- printf("\n");
- return 0;
-}
-#endif
-
-template <class T>
-int main2(int argc)
-{
- int array[10], array_serial[10];
-
- for (int ii = 0; ii < 10; ii++) {
- array[ii] = 0;
- array_serial[ii] = 0;
- }
-
- array[:] = 19383;
- for (int ii = 0; ii < 10; ii++)
- array_serial[ii] = 19383;
-
- ++array[:];
-
- for (int ii = 0; ii < 10; ii++)
- ++array_serial[ii];
-
-#if HAVE_IO
- print_array<T>(array, 10);
- print_array<T>(array_serial, 10);
-#endif
- for (int ii = 0; ii < 10; ii++)
- if (array_serial[ii] != array[ii])
- return 1;
-
- for (int ii = 0; ii < 10; ii++)
- ++array[:];
-
- for (int ii = 0; ii < 10; ii++)
- for (int jj = 0; jj < 10; jj++)
- ++array_serial[jj];
-
-#if HAVE_IO
- print_array<T>(array, 10);
- print_array<T>(array_serial, 10);
-#endif
- for (int ii = 0; ii < 10; ii++)
- if (array_serial[ii] != array[ii])
- return 2;
-
- if (argc == 2)
- ++array[0:10:1];
-
- if (argc == 2)
- {
- for (int ii = 0; ii < 10; ii++)
- ++array_serial[ii];
- }
-
-#if HAVE_IO
- print_array<T>(array, 10);
- print_array<T>(array_serial, 10);
-#endif
- for (int ii = 0; ii < 10; ii++)
- if (array_serial[ii] != array[ii])
- return 3;
-
- ++array[0:10/argc:argc];
-
- for (int ii = 0; ii < 10; ii += argc)
- {
- ++array_serial[ii];
- }
-
-#if HAVE_IO
- print_array<T>(array, 10);
- print_array<T>(array_serial, 10);
-#endif
-
- for (int ii = 0; ii < 10; ii++)
- if (array_serial[ii] != array[ii])
- return 4;
-
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc
deleted file mode 100644
index 82b74886ded..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/catch_exc.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-/* { dg-options "-fcilkplus" } */
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-
-#include <assert.h>
-#include <unistd.h>
-#if HAVE_IO
-#include <cstdio>
-#include <cilk/cilk_api.h>
-#endif
-#include <cstdlib>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int __cilkrts_set_param (const char *, const char *);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-void func(int volatile* steal_me)
-{
- while (! (*steal_me))
- {
- usleep(2000);
- }
-#if HAVE_IO
- printf("Foo executing on %d\n", __cilkrts_get_worker_number());
-#endif
- throw 5;
-}
-
-void my_test()
-{
- volatile int steal_me = 0;
-
- try
- {
- _Cilk_spawn func(&steal_me);
-#if HAVE_IO
- printf("Continuation executing on %d\n",
- __cilkrts_get_worker_number());
-#endif
- steal_me = 1;
- _Cilk_sync;
- goto bad;
- }
-
- catch (int x)
- {
-#if HAVE_IO
- printf("We caught x = %d\n", x);
-#endif
- assert(x == 5);
- }
- if (0)
- {
- bad:
-#if HAVE_IO
- printf("We should not be here!\n");
-#endif
- __builtin_abort ();
- }
-}
-
-
-int main()
-{
- /* Ensure more than one worker. */
- if (__cilkrts_set_param("nworkers", "2") != 0)
- __builtin_abort();
-
- my_test();
-#if HAVE_IO
- printf("PASSED\n");
-#endif
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/cf3.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/cf3.cc
deleted file mode 100644
index 8d88c5f346c..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/cf3.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-/* { dg-options "-fcilkplus" } */
-
-typedef __PTRDIFF_TYPE__ ptrdiff_t;
-
-template <typename T>
-class I
-{
-public:
- typedef ptrdiff_t difference_type;
- I ();
- ~I ();
- I (T *);
- I (const I &);
- T &operator * ();
- T *operator -> ();
- T &operator [] (const difference_type &) const;
- I &operator = (const I &);
- I &operator ++ ();
- I operator ++ (int);
- I &operator -- ();
- I operator -- (int);
- I &operator += (const difference_type &);
- I &operator -= (const difference_type &);
- I operator + (const difference_type &) const;
- I operator - (const difference_type &) const;
- template <typename S> friend bool operator == (I<S> &, I<S> &);
- template <typename S> friend bool operator == (const I<S> &, const I<S> &);
- template <typename S> friend bool operator < (I<S> &, I<S> &);
- template <typename S> friend bool operator < (const I<S> &, const I<S> &);
- template <typename S> friend bool operator <= (I<S> &, I<S> &);
- template <typename S> friend bool operator <= (const I<S> &, const I<S> &);
- template <typename S> friend bool operator > (I<S> &, I<S> &);
- template <typename S> friend bool operator > (const I<S> &, const I<S> &);
- template <typename S> friend bool operator >= (I<S> &, I<S> &);
- template <typename S> friend bool operator >= (const I<S> &, const I<S> &);
- template <typename S> friend typename I<S>::difference_type operator - (I<S> &, I<S> &);
- template <typename S> friend typename I<S>::difference_type operator - (const I<S> &, const I<S> &);
- template <typename S> friend I<S> operator + (typename I<S>::difference_type , const I<S> &);
-private:
- T *p;
-};
-template <typename T> I<T>::I () : p (0) {}
-template <typename T> I<T>::~I () {}
-template <typename T> I<T>::I (T *x) : p (x) {}
-template <typename T> I<T>::I (const I &x) : p (x.p) {}
-template <typename T> T &I<T>::operator * () { return *p; }
-template <typename T> T *I<T>::operator -> () { return p; }
-template <typename T> T &I<T>::operator [] (const difference_type &x) const { return p[x]; }
-template <typename T> I<T> &I<T>::operator = (const I &x) { p = x.p; return *this; }
-template <typename T> I<T> &I<T>::operator ++ () { ++p; return *this; }
-template <typename T> I<T> I<T>::operator ++ (int) { return I (p++); }
-template <typename T> I<T> &I<T>::operator -- () { --p; return *this; }
-template <typename T> I<T> I<T>::operator -- (int) { return I (p--); }
-template <typename T> I<T> &I<T>::operator += (const difference_type &x) { p += x; return *this; }
-template <typename T> I<T> &I<T>::operator -= (const difference_type &x) { p -= x; return *this; }
-template <typename T> I<T> I<T>::operator + (const difference_type &x) const { return I (p + x); }
-template <typename T> I<T> I<T>::operator - (const difference_type &x) const { return I (p - x); }
-template <typename T> bool operator == (I<T> &x, I<T> &y) { return x.p == y.p; }
-template <typename T> bool operator == (const I<T> &x, const I<T> &y) { return x.p == y.p; }
-template <typename T> bool operator != (I<T> &x, I<T> &y) { return !(x == y); }
-template <typename T> bool operator != (const I<T> &x, const I<T> &y) { return !(x == y); }
-template <typename T> bool operator < (I<T> &x, I<T> &y) { return x.p < y.p; }
-template <typename T> bool operator < (const I<T> &x, const I<T> &y) { return x.p < y.p; }
-template <typename T> bool operator <= (I<T> &x, I<T> &y) { return x.p <= y.p; }
-template <typename T> bool operator <= (const I<T> &x, const I<T> &y) { return x.p <= y.p; }
-template <typename T> bool operator > (I<T> &x, I<T> &y) { return x.p > y.p; }
-template <typename T> bool operator > (const I<T> &x, const I<T> &y) { return x.p > y.p; }
-template <typename T> bool operator >= (I<T> &x, I<T> &y) { return x.p >= y.p; }
-template <typename T> bool operator >= (const I<T> &x, const I<T> &y) { return x.p >= y.p; }
-template <typename T> typename I<T>::difference_type operator - (I<T> &x, I<T> &y) { return x.p - y.p; }
-template <typename T> typename I<T>::difference_type operator - (const I<T> &x, const I<T> &y) { return x.p - y.p; }
-template <typename T> I<T> operator + (typename I<T>::difference_type x, const I<T> &y) { return I<T> (x + y.p); }
-
-template <typename T>
-class J
-{
-public:
- J(const I<T> &x, const I<T> &y) : b (x), e (y) {}
- const I<T> &begin ();
- const I<T> &end ();
-private:
- I<T> b, e;
-};
-
-template <typename T> const I<T> &J<T>::begin () { return b; }
-template <typename T> const I<T> &J<T>::end () { return e; }
-
-template <typename T>
-void baz (I<T> &i);
-
-void
-foo (J<int> j)
-{
- _Cilk_for (I<int> i = j.begin (); i < j.end (); i += 2)
- baz (i);
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/cilk-for-tplt.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/cilk-for-tplt.cc
deleted file mode 100644
index 9481dbef74e..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/cilk-for-tplt.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#define SIZE 100
-#define CHECK_VALUE 5
-
-template <class T>
-int func (T start, T end)
-{
- int Array[SIZE];
- _Cilk_for (T ii = 0; ii < end; ii++)
- Array[ii] = CHECK_VALUE;
-
- for (T ii = 0; ii < end; ii++)
- if (Array[ii] != CHECK_VALUE)
- __builtin_abort ();
-
- return 0;
-}
-
-int main (void)
-{
- return func <int> (0, 100) + func <long> (0, 100);
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/const_spawn.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/const_spawn.cc
deleted file mode 100644
index c654826b3d9..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/const_spawn.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-class Rectangle
-{
- int area_val, h, w;
- public:
- Rectangle (int, int);
- Rectangle (int, int, int);
- ~Rectangle ();
- int area ();
-};
-Rectangle::~Rectangle ()
-{
- h = 0;
- w = 0;
- area_val = 0;
-}
-Rectangle::Rectangle (int height, int width)
-{
- h = height;
- w = width;
- area_val = 0;
-}
-
-Rectangle::Rectangle (int height, int width, int area_orig)
-{
- h = height;
- w = width;
- area_val = area_orig;
-}
-
-int Rectangle::area()
-{
- return (area_val += (h*w));
-}
-
-/* Spawning constructor. */
-int main1 (void)
-{
- Rectangle r = _Cilk_spawn Rectangle (4, 3);
- return r.area();
-}
-
-/* Spawning constructor 2. */
-int main2 (void)
-{
- Rectangle r (_Cilk_spawn Rectangle (4, 3));
- return r.area();
-}
-
-/* Spawning copy constructor. */
-int main3 (void)
-{
- Rectangle r = _Cilk_spawn Rectangle (4, 3, 2);
- return r.area ();
-}
-
-/* Spawning copy constructor 2. */
-int main4 (void)
-{
- Rectangle r ( _Cilk_spawn Rectangle (4, 3, 2));
- return r.area();
-}
-
-int main (void)
-{
- if (main1 () != 12)
- __builtin_abort ();
- if (main2 () != 12)
- __builtin_abort ();
- if (main3 () != 14)
- __builtin_abort ();
- if (main4() != 14)
- __builtin_abort ();
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/fib-opr-overload.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/fib-opr-overload.cc
deleted file mode 100644
index 88ecff8d0ea..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/fib-opr-overload.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#if HAVE_IO
-#include <iostream>
-#endif
-
-class Some_Struct
-{
- int calculated_value;
- short some_unused_value;
-public:
- Some_Struct () {
- this->calculated_value = 0;
- }
- Some_Struct (int value) {
- this->calculated_value = value;
- }
- Some_Struct operator=(Some_Struct f) {
- this->calculated_value = f.calculated_value;
- return *this;
- }
- bool operator!=(Some_Struct f) {
- return (this->calculated_value != f.calculated_value);
- }
- Some_Struct operator+(Some_Struct &f) {
- Some_Struct z;
- z.calculated_value = this->calculated_value + f.calculated_value;
- return z;
- }
- Some_Struct operator-(int x) {
- Some_Struct z;
- z.calculated_value = this->calculated_value - x;
- return z;
- }
- bool operator<(int x) {
- return (this->calculated_value < x);
- }
- int get_calculated_value () {
- return this->calculated_value;
- }
-};
-
-
-template <class T>
-T fibonacci_serial (T f)
-{
- if (f < 2)
- return f;
- T a = fibonacci_serial (f-1);
- T b = fibonacci_serial (f-2);
- return (a+b);
-}
-
-template <class T>
-T fibonacci (T f)
-{
- if (f < 2)
- return f;
- T a = _Cilk_spawn fibonacci (f-1);
- T b = fibonacci (f-2);
- _Cilk_sync;
- return (a+b);
-}
-
-int main (void)
-{
- Some_Struct f (32), f_serial(32);
- f = fibonacci (f);
- f_serial = fibonacci_serial (f_serial);
-
- if (f != f_serial)
- __builtin_abort ();
-
- int t = 32, t_serial = 32;
- t = fibonacci (t);
- t_serial = fibonacci_serial (t_serial);
- if (t != t_serial)
- __builtin_abort ();
-
- short s = 20, s_serial = 20;
- s = fibonacci (s);
- s_serial = fibonacci_serial (s_serial);
- if (s != s_serial)
- __builtin_abort ();
-
-#if HAVE_IO
- std::cout << "Fib_Parallel (32) = " << f.get_calculated_value() << std::endl;
- std::cout << "Fib_Serial (32) = " << f_serial.get_calculated_value()
- << std::endl;
-#endif
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/fib-tplt.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/fib-tplt.cc
deleted file mode 100644
index 66b1dfa9eb1..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/fib-tplt.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-struct fib_struct
-{
- int x;
- int *y;
- int z[3];
- struct fib_struct *ptr_next;
- struct fib_struct operator+(struct fib_struct &other) {
- struct fib_struct z ;
- z.x = (*this).x + (other.x);
- return z;
- }
- struct fib_struct operator-(int other) {
- struct fib_struct z ;
- z.x = this->x - other;
- return z;
- }
- bool operator<(int number) {
- return (this->x < number);
- }
-
-};
-
-template <typename T>
-T fib (T z) {
- if (z < 2) return z;
- T a = _Cilk_spawn fib<T>(z - 1);
- T b = fib<T>(z - 2);
- T c = a + b;
- return (a+b);
-}
-
-
-int sfib(int x)
-{
- if (x < 2) return x;
- int a = sfib(x-1);
- int b = sfib(x-2);
- return (a+b);
-}
-
-int main () {
- int z = 30;
- int parallel_fib = fib<int>(z);
- int serial_fib = sfib(z);
- if (serial_fib != parallel_fib)
- __builtin_abort ();
-
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/for1.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/for1.cc
deleted file mode 100644
index b2f76c7019f..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/for1.cc
+++ /dev/null
@@ -1,376 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#if HAVE_IO
-#include <cstdio>
-#endif
-
-typedef __PTRDIFF_TYPE__ ptrdiff_t;
-extern "C" void abort ();
-
-template <typename T>
-class I
-{
-public:
- typedef ptrdiff_t difference_type;
- I ();
- ~I ();
- I (T *);
- I (const I &);
- T &operator * ();
- T *operator -> ();
- T &operator [] (const difference_type &) const;
- I &operator = (const I &);
- I &operator ++ ();
- I operator ++ (int);
- I &operator -- ();
- I operator -- (int);
- I &operator += (const difference_type &);
- I &operator -= (const difference_type &);
- I operator + (const difference_type &) const;
- I operator - (const difference_type &) const;
- template <typename S> friend bool operator == (I<S> &, I<S> &);
- template <typename S> friend bool operator == (const I<S> &, const I<S> &);
- template <typename S> friend bool operator < (I<S> &, I<S> &);
- template <typename S> friend bool operator < (const I<S> &, const I<S> &);
- template <typename S> friend bool operator <= (I<S> &, I<S> &);
- template <typename S> friend bool operator <= (const I<S> &, const I<S> &);
- template <typename S> friend bool operator > (I<S> &, I<S> &);
- template <typename S> friend bool operator > (const I<S> &, const I<S> &);
- template <typename S> friend bool operator >= (I<S> &, I<S> &);
- template <typename S> friend bool operator >= (const I<S> &, const I<S> &);
- template <typename S> friend typename I<S>::difference_type operator - (I<S> &, I<S> &);
- template <typename S> friend typename I<S>::difference_type operator - (const I<S> &, const I<S> &);
- template <typename S> friend I<S> operator + (typename I<S>::difference_type , const I<S> &);
-private:
- T *p;
-};
-template <typename T> I<T>::I () : p (0) {}
-template <typename T> I<T>::~I () {}
-template <typename T> I<T>::I (T *x) : p (x) {}
-template <typename T> I<T>::I (const I &x) : p (x.p) {}
-template <typename T> T &I<T>::operator * () { return *p; }
-template <typename T> T *I<T>::operator -> () { return p; }
-template <typename T> T &I<T>::operator [] (const difference_type &x) const { return p[x]; }
-template <typename T> I<T> &I<T>::operator = (const I &x) { p = x.p; return *this; }
-template <typename T> I<T> &I<T>::operator ++ () { ++p; return *this; }
-template <typename T> I<T> I<T>::operator ++ (int) { return I (p++); }
-template <typename T> I<T> &I<T>::operator -- () { --p; return *this; }
-template <typename T> I<T> I<T>::operator -- (int) { return I (p--); }
-template <typename T> I<T> &I<T>::operator += (const difference_type &x) { p += x; return *this; }
-template <typename T> I<T> &I<T>::operator -= (const difference_type &x) { p -= x; return *this; }
-template <typename T> I<T> I<T>::operator + (const difference_type &x) const { return I (p + x); }
-template <typename T> I<T> I<T>::operator - (const difference_type &x) const { return I (p - x); }
-template <typename T> bool operator == (I<T> &x, I<T> &y) { return x.p == y.p; }
-template <typename T> bool operator == (const I<T> &x, const I<T> &y) { return x.p == y.p; }
-template <typename T> bool operator != (I<T> &x, I<T> &y) { return !(x == y); }
-template <typename T> bool operator != (const I<T> &x, const I<T> &y) { return !(x == y); }
-template <typename T> bool operator < (I<T> &x, I<T> &y) { return x.p < y.p; }
-template <typename T> bool operator < (const I<T> &x, const I<T> &y) { return x.p < y.p; }
-template <typename T> bool operator <= (I<T> &x, I<T> &y) { return x.p <= y.p; }
-template <typename T> bool operator <= (const I<T> &x, const I<T> &y) { return x.p <= y.p; }
-template <typename T> bool operator > (I<T> &x, I<T> &y) { return x.p > y.p; }
-template <typename T> bool operator > (const I<T> &x, const I<T> &y) { return x.p > y.p; }
-template <typename T> bool operator >= (I<T> &x, I<T> &y) { return x.p >= y.p; }
-template <typename T> bool operator >= (const I<T> &x, const I<T> &y) { return x.p >= y.p; }
-template <typename T> typename I<T>::difference_type operator - (I<T> &x, I<T> &y) { return x.p - y.p; }
-template <typename T> typename I<T>::difference_type operator - (const I<T> &x, const I<T> &y) { return x.p - y.p; }
-template <typename T> I<T> operator + (typename I<T>::difference_type x, const I<T> &y) { return I<T> (x + y.p); }
-
-template <typename T>
-class J
-{
-public:
- J(const I<T> &x, const I<T> &y) : b (x), e (y) {}
- const I<T> &begin ();
- const I<T> &end ();
-private:
- I<T> b, e;
-};
-
-template <typename T> const I<T> &J<T>::begin () { return b; }
-template <typename T> const I<T> &J<T>::end () { return e; }
-
-int results[2000];
-
-template <typename T>
-void
-baz (I<T> &i)
-{
- if (*i < 0 || *i >= 2000)
- {
-#if HAVE_IO
- printf ("*i(%d) is < 0 or >= 2000\n", *i);
- fflush (stdout);
-#endif
- __builtin_abort ();
- }
- else
- results[*i]++;
-}
-
-void
-f1 (const I<int> &x, const I<int> &y)
-{
- _Cilk_for (I<int> i = x; i <= y; i += 6)
- {
- baz (i);
- }
-
-#if HAVE_IO
- printf("===== Starting F1 =========\n");
- for (I<int> i = x; i <= y; i+= 6) {
- printf("Result[%4d] = %2d\n", *i, results[*i]);
- fflush (stdout);
- }
-#endif
-}
-
-void
-f2 (const I<int> &x, const I<int> &y)
-{
- _Cilk_for (I<int> i = x; i < y - 1; i += 2)
- baz (i);
-
-#if HAVE_IO
- printf("===== Starting F2 =========\n");
- for (int ii = 0; ii < 1998; ii += 2) {
- printf("Result[%4d] = %2d\n", ii, results[ii]);
- fflush (stdout);
- }
-#endif
-}
-
-template <typename T>
-void
-f3 (const I<int> &x, const I<int> &y)
-{
- _Cilk_for (I<int> i = x; i <= y; i += 1)
- baz (i);
-#if HAVE_IO
- printf("===== Starting F3 =========\n");
- for (int ii = 20; ii < 1987; ii += 1) {
- printf("Result[%4d] = %2d\n", ii, results[ii]);
- fflush (stdout);
- }
-
-#endif
-}
-
-template <typename T>
-void
-f4 (const I<int> &x, const I<int> &y)
-{
- _Cilk_for (I<int> i = x + (2000 - 64); i > y + 10; --i)
- baz (i);
-#if HAVE_IO
- printf("===== Starting F3 =========\n");
- for (I<int> i = x + (2000 - 64); i > y + 10; --i) {
- printf("Result[%4d] = %2d\n", *i, results[*i]);
- fflush (stdout);
- }
-#endif
-}
-void
-f5 (const I<int> &x, const I<int> &y)
-{
- _Cilk_for (I<int> i = x + 2000 - 64; i > y + 10; i -= 10)
- baz (i);
-#if HAVE_IO
- for (I<int> i = x + 2000 - 64; i > y + 10; i -= 10) {
- printf("Result[%4d] = %2d\n", *i, results[*i]);
- fflush (stdout);
- }
-#endif
-}
-
-template <int N>
-void
-f6 (const I<int> &x, const I<int> &y)
-{
- _Cilk_for (I<int> i = x + 2000 - 64; i > y + 10; i -= 10)
- {
- I<int> j = i + N;
- baz (j);
- }
-#if HAVE_IO
- for (I<int> i = x + 2000 - 64; i > y + 10; i = i - 12 + 2)
- {
- I<int> j = i + N;
- printf("Result[%4d] = %2d\n", *j, results[*j]);
- fflush (stdout);
- }
-#endif
-}
-template <int N>
-void
-f7 (I<int> ii, const I<int> &x, const I<int> &y)
-{
- _Cilk_for (I <int> i = x - 10; i <= y + 10; i += N)
- baz (i);
-#if HAVE_IO
- for (I<int> i = x - 10; i <= y + 10; i += N)
- {
- printf("Result[%4d] = %2d\n", *i, results[*i]);
- fflush (stdout);
- }
-#endif
-}
-
-template <int N>
-void
-f8 (J<int> j)
-{
- _Cilk_for (I<int> i = j.begin (); i <= j.end () + N; i += 2)
- baz (i);
-#if HAVE_IO
- for (I<int> i = j.begin (); i <= j.end () + N; i += 2) {
- printf("Result[%4d] = %2d\n", *i, results[*i]);
- fflush (stdout);
- }
-#endif
-
-}
-
-template <typename T, int N>
-void
-f9 (const I<T> &x, const I<T> &y)
-{
- _Cilk_for (I<T> i = x; i <= y; i += N)
- baz (i);
-#if HAVE_IO
- for (I<T> i = x; i <= y; i = i + N)
- {
- printf("Result[%4d] = %2d\n", *i, results[*i]);
- fflush (stdout);
- }
-#endif
-}
-
-template <typename T, int N>
-void
-f10 (const I<T> &x, const I<T> &y)
-{
- _Cilk_for (I<T> i = x; i > y; i += N)
- baz (i);
-#if HAVE_IO
- for (I<T> i = x; i > y; i = i + N) {
- printf("Result[%4d] = %2d\n", *i, results[*i]);
- fflush (stdout);
- }
-#endif
-}
-
-template <typename T>
-void
-f11 (const T &x, const T &y)
-{
- _Cilk_for (T i = x; i <= y; i += 3)
- baz (i);
-
-#if HAVE_IO
- for (T i = x; i <= y; i += 3) {
- printf("Result[%4d] = %2d\n", *i, results[*i]);
- fflush (stdout);
- }
-#endif
- T j = y + 3;
- baz (j);
-
-}
-
-template <typename T>
-void
-f12 (const T &x, const T &y)
-{
- _Cilk_for (T i = x; i > y; --i)
- baz (i);
-#if HAVE_IO
- for (T i = x; i > y; --i) {
- printf("Result[%4d] = %2d\n", *i, results[*i]);
- fflush (stdout);
- }
-#endif
-}
-template <int N>
-struct K
-{
- template <typename T>
- static void
- f13 (const T &x, const T &y)
- {
- _Cilk_for (T i = x; i <= y + N; i += N)
- baz (i);
-#if HAVE_IO
- for (T i = x; i < y+N; i += N) {
- printf("Result[%4d] = %2d\n", *i, results[*i]);
- fflush (stdout);
- }
-#endif
- }
-};
-
-#define check(expr) \
- for (int i = 0; i < 2000; i++) \
- if (expr) \
- { \
- if (results[i] != 1) { \
- __builtin_abort (); \
- } \
- results[i] = 0; \
- } \
- else if (results[i]) \
- abort ()
-
-int
-main ()
-{
- int a[2000];
- long b[2000];
- for (int i = 0; i < 2000; i++)
- {
- a[i] = i;
- b[i] = i;
- }
- f1 (&a[10], &a[1990]);
- check (i >= 10 && i <= 1990 && (i - 10) % 6 == 0);
- f2 (&a[0], &a[1999]);
- check (i < 1998 && (i & 1) == 0);
- f3<int> (&a[20], &a[1837]);
- check (i >= 20 && i <= 1837);
- f4<int> (&a[0], &a[30]);
- check (i > 40 && i <= 2000 - 64);
-
- f5 (&a[0], &a[100]);
- check (i >= 116 && i <= 2000 - 64 && (i - 116) % 10 == 0);
- f6<-10> (&a[10], &a[110]);
- check (i >= 116 && i <= 2000 - 64 && (i - 116) % 10 == 0);
-
- f7<6> (I<int> (), &a[12], &a[1800]);
- check (i >= 2 && i <= 1808 && (i - 2) % 6 == 0);
-
- f8<121> (J<int> (&a[14], &a[1803]));
- check (i >= 14 && i <= 1924 && (i & 1) == 0);
- f9<int, 7> (&a[33], &a[1967]);
- check (i >= 33 && i <= 1967 && (i - 33) % 7 == 0);
- f10<int, -7> (&a[1939], &a[17]);
- check (i >= 21 && i <= 1939 && (i - 21) % 7 == 0);
- f11<I<int> > (&a[16], &a[1981]);
- check (i >= 16 && i <= 1984 && (i - 16) % 3 == 0);
- f12<I<int> > (&a[1761], &a[37]);
- check (i > 37 && i <= 1761);
- K<5>::f13<I<int> > (&a[1], &a[1935]);
- check (i >= 1 && i <= 1936 && (i - 1) % 5 == 0);
- f9<long, 7> (&b[33], &b[1967]);
- check (i >= 33 && i <= 1967 && (i - 33) % 7 == 0);
- f10<long, -7> (&b[1939], &b[17]);
- check (i >= 21 && i <= 1939 && (i - 21) % 7 == 0);
- f11<I<long> > (&b[16], &b[1981]);
- check (i >= 16 && i <= 1984 && (i - 16) % 3 == 0);
- f12<I<long> > (&b[1761], &b[37]);
- check (i > 37 && i <= 1761);
- K<5>::f13<I<long> > (&b[1], &b[1935]);
- check (i >= 1 && i <= 1936 && (i - 1) % 5 == 0);
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/lambda_spawns.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/lambda_spawns.cc
deleted file mode 100644
index 96d2ea19c11..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/lambda_spawns.cc
+++ /dev/null
@@ -1,238 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-require-effective-target c++11 } */
-/* { dg-options "-fcilkplus" } */
-
-#define FIRST_NUMBER 5
-#define SECOND_NUMBER 3
-#define HAVE_IO 0
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-#include <stdlib.h>
-
-int global_var;
-
-void foo1(int *array, int size)
-{
-#if HAVE_IO
- for (int ii = 0; ii < size; ii++)
- printf("%2d\t", array[ii]);
- printf("\n");
- fflush (stdout);
-#else
- if (size != 2)
- __builtin_abort ();
- if (array[0] != FIRST_NUMBER)
- __builtin_abort ();
- if (array[1] != SECOND_NUMBER)
- __builtin_abort ();
-#endif
- global_var++;
-}
-void foo1_c(const int *array, int size)
-{
-#if HAVE_IO
- for (int ii = 0; ii < size; ii++)
- printf("%2d\t", array[ii]);
- printf("\n");
- fflush (stdout);
-#else
- if (size != 2)
- __builtin_abort ();
- if (array[0] != FIRST_NUMBER)
- __builtin_abort ();
- if (array[1] != SECOND_NUMBER)
- __builtin_abort ();
-#endif
- global_var++;
-}
-
-
-int main2 (int argc) {
- int A[2] = {FIRST_NUMBER, SECOND_NUMBER};
- int B[2] = {FIRST_NUMBER, SECOND_NUMBER};
- int main_size = argc+1; /* We know argc is 1, and so 1+1 = 2. */
- int q = 0;
-
- global_var = 0;
- auto func0 = [=](){ foo1_c(A, 2); };
- _Cilk_spawn func0();
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- auto func1 = [=](int *Aa){ foo1(Aa, 2); };
- _Cilk_spawn func1 (A);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- auto func2 = [=](int *Aa, int size){ foo1(Aa, size); };
- _Cilk_spawn func2 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- auto func3 = [=](int *Aa, int size){ int new_size = (size % 2 + 2);
- foo1(Aa, size); };
- _Cilk_spawn func3 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- auto func4 = [](int *Aa){ foo1(Aa, 2); };
- _Cilk_spawn func4 (A);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- auto func5 = [](int *Aa, int size){ foo1(Aa, size); };
- _Cilk_spawn func5 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- auto func6 = [&](int *Aa){ foo1(Aa, 2); };
- _Cilk_spawn func6 (A);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- auto func7 = [&](int *Aa, int size){ foo1(Aa, size); };
- _Cilk_spawn func7 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- auto func8 = [&](){ foo1(A, 2); };
- _Cilk_spawn func8 ();
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- /* We ignore the first param here and pass in A from the outer fn. */
- auto func9 = [&](int *Aa, int size){ foo1(A, size); };
- _Cilk_spawn func9 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- auto func10 = [=](){ foo1_c(A, main_size); };
- _Cilk_spawn func10 ();
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- auto func11 = [&](){ foo1(A, main_size); };
- _Cilk_spawn func11 ();
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- /* We ignore the first & second param here and pass in A from the
- outer fn. */
- auto func12 = [&](int *Aa, int size){ foo1(A, main_size); };
- _Cilk_spawn func12 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- _Cilk_spawn [&](int *Aa){ foo1(Aa, 2); }(A);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- _Cilk_spawn [&](int *Aa, int size){ foo1(Aa, size); }(A, 2);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- _Cilk_spawn [=](int *Aa){ foo1(Aa, 2); }(A);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- _Cilk_spawn [=](int *Aa, int size){ foo1(Aa, size); }(A, 2);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- /* We ignore the first param here. */
- _Cilk_spawn [=](int *Aa, int size){ foo1_c(A, size); }(A, 2);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- /* We ignore the first and second param here. */
- _Cilk_spawn [=](int *Aa, int size){ foo1_c(A, size); }(B, 2);
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- _Cilk_spawn [&](){ foo1(A, 2); }();
- [&](){ foo1(A, 2); }();
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- _Cilk_spawn [=](){ foo1_c (A, main_size); }();
- foo1 (A, 2);
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- global_var = 0;
- _Cilk_spawn [&](){ foo1(A, main_size); }();
- [&](){ foo1(A, 2); }();
- _Cilk_sync;
- if (global_var != 2)
- return (++q);
-
- return q;
-}
-
-int main (void)
-{
- return main2 (1);
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/lambda_spawns_tplt.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/lambda_spawns_tplt.cc
deleted file mode 100644
index 1a36262dc6d..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/lambda_spawns_tplt.cc
+++ /dev/null
@@ -1,174 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-require-effective-target c++11 } */
-/* { dg-options "-fcilkplus" } */
-
-#define FIRST_NUMBER 5
-#define SECOND_NUMBER 3
-#define HAVE_IO 0
-#if HAVE_IO
-#include <stdio.h>
-#endif
-
-#include <stdlib.h>
-
-template <class T>
-void foo1(T *array, int size)
-{
-#if HAVE_IO
- for (int ii = 0; ii < size; ii++)
- printf("%2d\t", (int)array[ii]);
- printf("\n");
- fflush (stdout);
-#else
- if (size != 2)
- __builtin_abort ();
- if (array[0] != FIRST_NUMBER)
- __builtin_abort ();
- if (array[1] != SECOND_NUMBER)
- __builtin_abort ();
-#endif
-}
-template <class T>
-void foo1_c(const T *array, int size)
-{
-#if HAVE_IO
- for (int ii = 0; ii < size; ii++)
- printf("%2d\t", (int)array[ii]);
- printf("\n");
- fflush (stdout);
-#else
- if (size != 2)
- __builtin_abort ();
- if (array[0] != FIRST_NUMBER)
- __builtin_abort ();
- if (array[1] != SECOND_NUMBER)
- __builtin_abort ();
-#endif
-}
-template <class T>
-int main2 (int argc, char **argv) {
- T A[2] = {FIRST_NUMBER, SECOND_NUMBER};
- int main_size = argc+1; /* We know argc is 1, and so 1+1 = 2. */
- auto func0 = [=](){ foo1_c(A, 2); };
- _Cilk_spawn func0();
- foo1 (A, 2);
- _Cilk_sync;
-
- auto func1 = [=](T *Aa){ foo1(Aa, 2); };
- _Cilk_spawn func1 (A);
- foo1 (A, 2);
- _Cilk_sync;
-
- auto func2 = [=](T *Aa, int size){ foo1(Aa, size); };
- _Cilk_spawn func2 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
-
- auto func3 = [=](T *Aa, int size){ int new_size = (size % 2 + 2);
- foo1(Aa, size); };
- _Cilk_spawn func3 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
-
- auto func4 = [](T *Aa){ foo1(Aa, 2); };
- _Cilk_spawn func4 (A);
- foo1 (A, 2);
- _Cilk_sync;
-
- auto func5 = [](T *Aa, int size){ foo1(Aa, size); };
- _Cilk_spawn func5 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
-
- auto func6 = [&](T *Aa){ foo1(Aa, 2); };
- _Cilk_spawn func6 (A);
- foo1 (A, 2);
- _Cilk_sync;
-
- auto func7 = [&](T *Aa, int size){ foo1(Aa, size); };
- _Cilk_spawn func7 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
-
- auto func8 = [&](){ foo1(A, 2); };
- _Cilk_spawn func8 ();
- foo1 (A, 2);
- _Cilk_sync;
-
- /* We ignore the first param here and pass in A from the outer fn. */
- auto func9 = [&](T *Aa, int size){ foo1(A, size); };
- _Cilk_spawn func9 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
-
- auto func10 = [=](){ foo1_c(A, main_size); };
- _Cilk_spawn func10 ();
- foo1 (A, 2);
- _Cilk_sync;
-
- auto func11 = [&](){ foo1(A, main_size); };
- _Cilk_spawn func11 ();
- foo1 (A, 2);
- _Cilk_sync;
-
- /* We ignore the first & second param here and pass in A from the
- outer fn. */
- auto func12 = [&](T *Aa, int size){ foo1(A, main_size); };
- _Cilk_spawn func12 (A, 2);
- foo1 (A, 2);
- _Cilk_sync;
-
- _Cilk_spawn [&](T *Aa){ foo1(Aa, 2); }(A);
- foo1 (A, 2);
- _Cilk_sync;
-
- _Cilk_spawn [&](T *Aa, int size){ foo1(Aa, size); }(A, 2);
- foo1 (A, 2);
- _Cilk_sync;
-
- _Cilk_spawn [=](T *Aa){ foo1(Aa, 2); }(A);
- foo1 (A, 2);
- _Cilk_sync;
-
- _Cilk_spawn [=](T *Aa, int size){ foo1(Aa, size); }(A, 2);
- foo1 (A, 2);
- _Cilk_sync;
-
- /* We ignore the first param here. */
- _Cilk_spawn [=](T *Aa, int size){ foo1_c(A, size); }(A, 2);
- foo1 (A, 2);
- _Cilk_sync;
-
- /* We ignore the first and second param here. */
- _Cilk_spawn [=](T *Aa, int size){ foo1_c(A, main_size); }(A, 2);
- foo1 (A, 2);
- _Cilk_sync;
-
- _Cilk_spawn [&](){ foo1(A, 2); }();
- [&](){ foo1(A, 2); }();
- _Cilk_sync;
-
- _Cilk_spawn [=](){ foo1_c(A, main_size); }();
- foo1 (A, 2);
- _Cilk_sync;
-
- _Cilk_spawn [&](){ foo1(A, main_size); }();
- [&](){ foo1(A, 2); }();
- _Cilk_sync;
-
- return 0;
-}
-
-int main (void)
-{
- int argc = 1;
- char **argv = NULL;
- int x = 1, y = 1, z = 1, q = 1, p = 1;
- x = main2<char>(argc,argv);
- y = main2<short>(argc,argv);
- z = main2<int>(argc,argv);
- p = main2<long>(argc,argv);
- q = main2<long long>(argc,argv);
- return (x+y+z+p+q);
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/pr60586.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/pr60586.cc
deleted file mode 100644
index 47c78281300..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/pr60586.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-class Rectangle
-{
- int area_val, h, w;
- public:
- Rectangle (int, int);
- Rectangle (int, int, int);
- ~Rectangle ();
- int area ();
-};
-Rectangle::~Rectangle ()
-{
- h = 0;
- w = 0;
- area_val = 0;
-}
-Rectangle::Rectangle (int height, int width)
-{
- h = height;
- w = width;
- area_val = 0;
-}
-
-int some_func(int &x)
-{
- x++;
- return x;
-}
-
-Rectangle::Rectangle (int height, int width, int area_orig)
-{
- h = height;
- w = width;
- area_val = area_orig;
-}
-
-int Rectangle::area()
-{
- return (area_val += (h*w));
-}
-
-
-int some_func (int &);
-
-/* Spawning constructor. */
-int main1 (void)
-{
- int x = 3;
- Rectangle r = _Cilk_spawn Rectangle (some_func(x), 3);
- return r.area();
-}
-
-/* Spawning constructor 2. */
-int main2 (void)
-{
- Rectangle r (_Cilk_spawn Rectangle (4, 3));
- return r.area();
-}
-
-/* Spawning copy constructor. */
-int main3 (void)
-{
- int x = 3;
- Rectangle r = _Cilk_spawn Rectangle (some_func(x), 3, 2);
- return r.area ();
-}
-
-/* Spawning copy constructor 2. */
-int main4 (void)
-{
- Rectangle r ( _Cilk_spawn Rectangle (4, 3, 2));
- return r.area();
-}
-
-int main (void)
-{
- if (main1 () != 12)
- __builtin_abort ();
- if (main2 () != 12)
- __builtin_abort ();
- if (main3 () != 14)
- __builtin_abort ();
- if (main4() != 14)
- __builtin_abort ();
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/pr66326.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/pr66326.cc
deleted file mode 100644
index 102b9734275..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/pr66326.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#include <vector>
-#include <random>
-
-template <class T>
-void do_not_optimize_away(T&& x) {
- asm volatile("" : "+r"(x));
-}
-
-const int N = 1'000'000;
-
-auto compute() {
- std::vector<double> v(N);
- auto rng = std::mt19937{std::random_device{}()};
- std::uniform_real_distribution<double> dist(0, 1);
- for (int i = 0; i < N; ++i) v[i] = std::log(std::sqrt(dist(rng)));
- return v;
-}
-
-int main() {
- std::vector<double> v1, v2, v3;
- _Cilk_spawn [&] { v1 = compute(); }();
- _Cilk_spawn [&] { v2 = compute(); }();
- v3 = compute();
- do_not_optimize_away(v1.data());
- do_not_optimize_away(v2.data());
- do_not_optimize_away(v3.data());
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/pr68001.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/pr68001.cc
deleted file mode 100644
index bf2fefa03b4..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/pr68001.cc
+++ /dev/null
@@ -1,18 +0,0 @@
-/* PR middle-end/68001 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-#include <vector>
-
-std::vector<double> f() {
- std::vector<double> v;
- return v;
-}
-
-int main()
-{
- std::vector<double> x = _Cilk_spawn f ();
- std::vector<double> y = f();
- _Cilk_sync;
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/pr68997.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/pr68997.cc
deleted file mode 100644
index a9a8a51ce7e..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/pr68997.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-std=c++11 -fcilkplus" } */
-
-struct A1 {
- A1 () {}
- A1 (const A1&) {}
-};
-
-A1 fa1 () {
- return A1 ();
-}
-
-struct A2 {
- A2 () {}
- A2 (A2&&) {}
-};
-
-A2 fa2 () {
- return A2 ();
-}
-
-struct B1 {
-};
-
-B1 fb1 () {
- return B1 ();
-}
-
-struct A3 {
- A3 (const B1&) {}
-};
-
-struct A4 {
- A4 (B1) {}
-};
-
-struct B2 {
- B2 () {}
- B2 (const B2&) {}
-};
-
-B2 fb2 () {
- return B2 ();
-}
-
-struct A5 {
- A5 (B2) {}
-};
-
-void t1 () {
- A1 a1 = _Cilk_spawn fa1 ();
-}
-
-void t2 () {
- A2 a2 = _Cilk_spawn fa2 ();
-}
-
-void t3 () {
- A3 a3 = _Cilk_spawn fb1 ();
-}
-
-void t4 () {
- A4 a4 = _Cilk_spawn fb1 ();
-}
-
-void t5 () {
- A5 a5 = _Cilk_spawn fb2 ();
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/pr69024.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/pr69024.cc
deleted file mode 100644
index b87dc1ace87..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/pr69024.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-struct A1 {
-};
-
-struct A2 {
- A2 () {}
- A2 (const A2&) {}
-};
-
-struct B1 {
- operator A1 () {
- return A1 ();
- }
-};
-
-B1 fb1 () {
- return B1 ();
-}
-
-struct B2 {
- operator A2 () {
- return A2 ();
- }
-};
-
-B2 fb2 () {
- return B2 ();
-}
-
-void t1 () {
- A1 a1 = _Cilk_spawn fb1 ();
-}
-
-void t2 () {
- A2 a2 = _Cilk_spawn fb2 ();
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/pr69048.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/pr69048.cc
deleted file mode 100644
index b6c57fca9a4..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/pr69048.cc
+++ /dev/null
@@ -1,14 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-struct A {
- ~A () {}
-};
-
-A f () {
- return A ();
-}
-
-void t1 () {
- _Cilk_spawn f ();
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/pr69267.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/pr69267.cc
deleted file mode 100644
index 7d00e49bf38..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/pr69267.cc
+++ /dev/null
@@ -1,10 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-struct A {};
-
-void f (A) {}
-
-void g () {
- _Cilk_spawn f (A ());
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/pr80038.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/pr80038.cc
deleted file mode 100644
index 85990e5a007..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/pr80038.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-/* { dg-options "-fcilkplus" } */
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-
-#include <unistd.h>
-extern "C" {
- extern int __cilkrts_set_param (const char *, const char *);
-}
-
-int objcnt = 0;
-
-struct foo
-{
- int live;
- foo ()
- { objcnt++; }
- foo (const foo &)
- { objcnt++; }
- ~foo ()
- { objcnt--; }
-};
-
-void
-spawnee (foo f)
-{
- usleep(2000);
- /* Now both my_test::f and spawnee::f should be alive. */
- if (objcnt != 2)
- __builtin_abort ();
-}
-
-void
-my_test ()
-{
- foo f;
- _Cilk_spawn spawnee (f);
- _Cilk_sync ;
-}
-
-int
-main ()
-{
- if (__cilkrts_set_param ("nworkers", "2") != 0)
- __builtin_abort ();
-
- my_test ();
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/stl_iter.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/stl_iter.cc
deleted file mode 100644
index ed489d8b00a..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/stl_iter.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-#include <vector>
-#include <cstdio>
-#include <iostream>
-#include <algorithm>
-
-using namespace std;
-
-
-int main(void)
-{
-vector <int> array;
-vector <int> array_serial;
-
-for (int ii = -1; ii < 10; ii++)
-{
- array.push_back(ii);
- array_serial.push_back (ii);
-}
-_Cilk_for (vector<int>::iterator iter = array.begin(); iter != array.end();
- iter++)
-{
- if (*iter == 6)
- *iter = 13;
-}
-for (vector<int>::iterator iter = array_serial.begin();
- iter != array_serial.end(); iter++)
-{
- if (*iter == 6)
- *iter = 13;
-}
-sort (array.begin(), array.end());
-sort (array_serial.begin(), array_serial.end());
-
-vector <int>::iterator iter = array.begin ();
-vector <int>::iterator iter_serial = array_serial.begin ();
-
-while (iter != array.end () && iter_serial != array_serial.end ())
-{
- if (*iter != *iter_serial)
- __builtin_abort ();
- iter++;
- iter_serial++;
-}
-
-return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/stl_rev_iter.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/stl_rev_iter.cc
deleted file mode 100644
index ddc96d1223d..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/stl_rev_iter.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-
-#include <vector>
-#include <cstdio>
-#include <iostream>
-#include <algorithm>
-
-using namespace std;
-
-
-int main(void)
-{
-vector <int> array,array_serial;
-
-for (int ii = -1; ii < 10; ii++)
-{
- array.push_back(ii);
- array_serial.push_back(ii);
-}
-_Cilk_for (vector<int>::reverse_iterator iter4 = array.rbegin();
- iter4 != array.rend(); iter4++)
-{
- if (*iter4 == 0x8) {
- *iter4 = 9;
- }
-}
-
-_Cilk_for (vector<int>::reverse_iterator iter4 = array_serial.rbegin();
- iter4 != array_serial.rend(); iter4++)
-{
- if (*iter4 == 0x8) {
- *iter4 = 9;
- }
-}
-_Cilk_for (vector<int>::reverse_iterator iter2 = array.rbegin();
- iter2 != array.rend();
- iter2 += 1)
-{
- if ((*iter2 == 0x4) || (*iter2 == 0x7)) {
- *iter2 = 0x3;
- }
-}
-for (vector<int>::reverse_iterator iter2 = array_serial.rbegin();
- iter2 != array_serial.rend();
- iter2 += 1)
-{
- if ((*iter2 == 0x4) || (*iter2 == 0x7)) {
- *iter2 = 0x3;
- }
-}
-sort (array.begin(), array.end());
-sort (array_serial.begin(), array_serial.end());
-
-vector <int>::iterator iter = array.begin ();
-vector <int>::iterator iter_serial = array_serial.begin ();
-while (iter != array.end () && iter_serial != array_serial.end ())
-{
- if (*iter != *iter_serial)
- __builtin_abort ();
- iter++;
- iter_serial++;
-}
-
-return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/CK/stl_test.cc b/gcc/testsuite/g++.dg/cilk-plus/CK/stl_test.cc
deleted file mode 100644
index 02b57c33a66..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/CK/stl_test.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target cilkplus_runtime } */
-/* { dg-options "-fcilkplus" } */
-
-
-#include <iostream>
-#include <cstdio>
-#include <cstdlib>
-#include <vector>
-#include <algorithm>
-#include <list>
-
-using namespace std;
-
-
-int main(int argc, char **argv)
-{
- vector <int> number_list, number_list_serial;
- int new_number = 0;
- int no_elements = 0;
-
- if (argc != 2)
- {
- no_elements = 10;
- }
-
-
- number_list.clear();
- number_list_serial.clear();
- for (int ii = 0; ii < no_elements; ii++)
- {
- number_list.push_back(new_number);
- number_list_serial.push_back(new_number);
- }
-
- _Cilk_for (int jj = 0; jj < no_elements; jj++)
- {
- number_list[jj] = jj + no_elements;
- }
- for (int jj = 0; jj < no_elements; jj++)
- {
- number_list_serial[jj] = jj + no_elements;
- }
-
- for (int jj = 0; jj < no_elements; jj++)
- if (number_list_serial[jj] != number_list[jj])
- __builtin_abort ();
-
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/cilk-plus.exp b/gcc/testsuite/g++.dg/cilk-plus/cilk-plus.exp
deleted file mode 100644
index bc6c18ee967..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/cilk-plus.exp
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright (C) 2013-2017 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-# Written by Balaji V. Iyer <balaji.v.iyer@intel.com>
-
-load_lib g++-dg.exp
-load_lib cilk-plus-dg.exp
-
-if { ![check_effective_target_cilkplus] } {
- return;
-}
-
-dg-init
-if [cilkplus_init] {
- # Run the tests that are shared with C.
- g++-dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/PS/*.c]] "" ""
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/SE/*.c]] "-O3" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/SE/*.c]] " " " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/SE/*.c]] "-g -O2" " "
- # Run the C++ only tests.
- g++-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C]] "" ""
-
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -O1 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -O2 -ftree-vectorize -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -O3 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -g -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -g -O1 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -g -O2 -ftree-vectorize -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -g -O3 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -O3 -ftree-vectorize -fcilkplus -g" " "
-
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/AN/*.cc]] " -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/AN/*.cc]] " -O0 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/AN/*.cc]] " -O1 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/AN/*.cc]] " -O2 -ftree-vectorize -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/AN/*.cc]] " -O3 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/AN/*.cc]] " -g -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/AN/*.cc]] " -g -O0 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/AN/*.cc]] " -g -O1 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/AN/*.cc]] " -g -O2 -ftree-vectorize -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/AN/*.cc]] " -g -O3 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/AN/*.cc]] " -O3 -ftree-vectorize -fcilkplus -g" " "
-
- if { [check_effective_target_cilkplus_runtime] } {
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/CK/*.cc]] " -O1 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/CK/*.cc]] " -O3 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/CK/*.cc]] " -g -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/g++.dg/cilk-plus/CK/*.cc]] " -g -O2 -fcilkplus" " "
-
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O1" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O3" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -g" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -g -O2" " "
- }
-}
-cilkplus_finish
-dg-finish
diff --git a/gcc/testsuite/g++.dg/cilk-plus/ef_test.C b/gcc/testsuite/g++.dg/cilk-plus/ef_test.C
deleted file mode 100644
index 3e75cbd9253..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/ef_test.C
+++ /dev/null
@@ -1,37 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-fcilkplus" } */
-
-
-__attribute__((vector (nomask), vector(mask), vector(mask,linear(x:1))))
-int func (int x)
-{
- return x+5;
-}
-
-
-__attribute__((vector(mask,uniform (y), linear(x:1))))
-__attribute__((vector (nomask, uniform (x), linear(y:1))))
-int func2 (int x, int y)
-{
- return x+y;
-}
-
-int func4 (int x, int y) __attribute__((vector, vector (nomask), vector (uniform(y), linear(x:1))));
-
-
-template <class T, class R>
-__attribute__((vector, vector(mask,uniform (y), linear(x:1))))
-T func3 (T x, R y)
-{
- return x+(T)y;
-}
-
-
-
-int main (void)
-{
- if ((func3 (5, 4) + func2 (5, 4) + func (5) + (int) func3<long, int> (5, 4)) !=
- (5 + 4) + (5 + 4) + (5 + 5) + (int) ((long)5 +(int)4))
- __builtin_abort ();
- return 0;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/for.C b/gcc/testsuite/g++.dg/cilk-plus/for.C
deleted file mode 100644
index 6e16cfcd1d1..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/for.C
+++ /dev/null
@@ -1,26 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -fcilkplus" } */
-
-// Test storage classes in the initialization of a <#pragma simd> for
-// loop.
-
-int *a, *b;
-
-void foo()
-{
-#pragma simd
- for (static int tt=5; tt < 10; ++tt) /* { dg-error "before 'static'\|not declared\|expected" } */
- a[tt] = b[tt];
-
-#pragma simd
- for (extern int var=0; var < 1000; ++var) /* { dg-error "before 'extern'\|not declared\|expected" } */
- a[var] = var;
-
-#pragma simd
- for (register int regj = 0; regj < 1000; ++regj) /* { dg-error "before 'register'\|not declared\|expected" } */
- b[regj] = a[regj] * 2;
-
-#pragma simd
- for (volatile int vj=0; vj<1000; ++vj) /* { dg-error "iteration variable cannot be volatile" } */
- a[vj] = b[vj];
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/for2.C b/gcc/testsuite/g++.dg/cilk-plus/for2.C
deleted file mode 100644
index 345e54236f8..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/for2.C
+++ /dev/null
@@ -1,43 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int *p;
-extern int stuff();
-
-template <int value>
-void foobar(int a)
-{
-#pragma simd
- for (int i=0; i < a; ++i)
- p[i] = value;
-}
-
-template <int value>
-void foobar2(int a)
-{
- int j = 123;
-#pragma simd linear(j : value)
- for (int i=0; i < a; ++i)
- {
- p[i] = value;
- j += stuff();
- }
-}
-
-void funky()
-{
- foobar <69> (1000);
- foobar2 <123> (2000);
-}
-
-void foobar3(int a)
-{
- int j = 123;
-#pragma simd linear(j : a + a) /* { dg-error "step size must be an integer" } */
- for (int i=0; i < a; ++i)
- {
- p[i] = 1234;
- extern int bar();
- j += bar();
- }
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/for3.C b/gcc/testsuite/g++.dg/cilk-plus/for3.C
deleted file mode 100644
index 28dbdee4339..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/for3.C
+++ /dev/null
@@ -1,18 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -fcilkplus" } */
-
-// Test storage classes in the initialization of a <#pragma simd> for
-// loop.
-
-int *a, *b;
-
-void foo()
-{
-#pragma simd
- for (int tt=5; tt < 10; ++tt)
- {
- a[tt] = b[tt];
- if (tt == 8)
- throw 1; /* { dg-error "throw expressions are not allowed" } */
- }
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/for4.C b/gcc/testsuite/g++.dg/cilk-plus/for4.C
deleted file mode 100644
index 5b86b9f7db5..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/for4.C
+++ /dev/null
@@ -1,22 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int *p;
-extern int stuff();
-
-template <int value>
-void foobar(int a)
-{
- int j = 123;
-#pragma simd linear(j : value + 1)
- for (int i=0; i < a; ++i)
- {
- p[i] = value;
- j += stuff();
- }
-}
-
-void funky()
-{
- foobar <69> (1000);
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/pr60967.C b/gcc/testsuite/g++.dg/cilk-plus/pr60967.C
deleted file mode 100644
index 1724424ff0a..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/pr60967.C
+++ /dev/null
@@ -1,9 +0,0 @@
-// PR c++/60967
-// { dg-require-effective-target c++11 }
-// { dg-options "-fcilkplus" }
-
-int container[] = {};
-template <class foo>
-void bar() {
- for (int &v : container) { }
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/pr69028.C b/gcc/testsuite/g++.dg/cilk-plus/pr69028.C
deleted file mode 100644
index 31542f34e9a..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/pr69028.C
+++ /dev/null
@@ -1,13 +0,0 @@
-// PR c++/69028
-// { dg-require-effective-target c++11 }
-// { dg-options "-fcilkplus -fprofile-arcs" }
-
-void parallel()
-{
-}
-
-int main()
-{
- _Cilk_spawn parallel();
- _Cilk_sync;
-}
diff --git a/gcc/testsuite/g++.dg/cilk-plus/pr70565.C b/gcc/testsuite/g++.dg/cilk-plus/pr70565.C
deleted file mode 100644
index 781ce2c1649..00000000000
--- a/gcc/testsuite/g++.dg/cilk-plus/pr70565.C
+++ /dev/null
@@ -1,9 +0,0 @@
-// { dg-do compile } */
-// { dg-options "-fcilkplus" }
-
-int array[999];
-void foo()
-{
- _Cilk_for (int i=0; i < 999; ++i)
- array[:] = 0;
-}
diff --git a/gcc/testsuite/g++.dg/pr57662.C b/gcc/testsuite/g++.dg/pr57662.C
index 1592433d0d7..2180914ce46 100644
--- a/gcc/testsuite/g++.dg/pr57662.C
+++ b/gcc/testsuite/g++.dg/pr57662.C
@@ -32,7 +32,6 @@ enum tree_code {
ERROR_MARK,
IDENTIFIER_NODE,
OMP_SIMD,
- CILK_SIMD,
MAX_TREE_CODES
};
struct tree_identifier {
@@ -192,7 +191,7 @@ cp_parser_omp_for_loop(cp_parser * parser, enum tree_code code, tree clauses,
for (i = 0; i < collapse; i++) {
bool add_private_clause = false;
add_private_clause |=
- cp_parser_omp_for_loop_init(parser, code != CILK_SIMD,
+ cp_parser_omp_for_loop_init(parser, true,
this_pre_body, for_block, init,
decl, real_decl);
}
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp b/gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp
deleted file mode 100644
index 447ed04f028..00000000000
--- a/gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (C) 2013-2017 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-# Written by Balaji V. Iyer <balaji.v.iyer@intel.com>
-
-
-load_lib gcc-dg.exp
-load_lib lto.exp
-load_lib cilk-plus-dg.exp
-
-if { ![check_effective_target_cilkplus] } {
- return;
-}
-
-dg-init
-if [cilkplus_init] {
- # Run the tests that are shared with C++.
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/PS/*.c]] " -ftree-vectorize -fcilkplus -std=c99" " "
- # Run the C-only tests.
- dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] \
- "-ftree-vectorize -fcilkplus -std=c99" " "
-
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -O1 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -O2 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -O3 -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -g -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -g -O2 -ftree-vectorize -fcilkplus" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus -std=c99" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus -O2 -std=c99" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus -O3 -std=c99" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus -g -O0 -std=c99" " "
-
- if { [check_effective_target_cilkplus_runtime] } {
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -g " " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O1 " " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O2 -std=c99 " " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O2 -ftree-vectorize " " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O3 -g " " "
- if { [check_effective_target_lto] } {
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O3 -flto -g " " "
- }
- }
-
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/SE/*.c]] " -g" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/SE/*.c]] " -O3 -std=c99" " "
- dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/SE/*.c]] " -O3 -g" " "
-}
-cilkplus_finish
-dg-finish
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/for1.c b/gcc/testsuite/gcc.dg/cilk-plus/for1.c
deleted file mode 100644
index 4fb534286d9..00000000000
--- a/gcc/testsuite/gcc.dg/cilk-plus/for1.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/* { dg-do compile } */
-
-int *a, *b, *c;
-
-void foo()
-{
- int i, j;
- // The initialization shall declare or initialize a *SINGLE* variable.
-#pragma simd
- for (i=0, j=5; i < 1000; i++) // { dg-error "expected ';' before ','" }
- a[i] = b[j];
-}
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/for2.c b/gcc/testsuite/gcc.dg/cilk-plus/for2.c
deleted file mode 100644
index 285f35a5079..00000000000
--- a/gcc/testsuite/gcc.dg/cilk-plus/for2.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O3 -fcilkplus" } */
-
-int *a, *b;
-
-void foo()
-{
-#pragma simd
- for (const int ci=0; ci<1000; ++ci) /* { dg-error "increment of read-only var\|invalid controlling\|invalid increment\|assignment of read" } */
- a[ci] = b[ci];
-}
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c b/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c
deleted file mode 100644
index 6adabf4ae06..00000000000
--- a/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -fopenmp" } */
-/* { dg-require-effective-target fopenmp } */
-
-int *a, *b, c;
-
-void foo()
-{
-#pragma simd
- for (int i=0; i < 1000; ++i)
- {
- a[i] = b[i];
- if (c == 5)
- return; /* { dg-error "invalid branch to/from Cilk Plus structured block" } */
- }
-}
-
-void bar()
-{
-#pragma simd
- for (int i=0; i < 1000; ++i)
- {
- lab:
- a[i] = b[i];
- }
- if (c == 6)
- goto lab; /* { dg-error "invalid entry to Cilk Plus structured block" } */
-}
-
-void baz()
-{
- bad1:
- #pragma omp parallel
- goto bad1; /* { dg-error "invalid branch to/from OpenMP structured block" } */
-
- goto bad2; /* { dg-error "invalid entry to OpenMP structured block" } */
- #pragma omp parallel
- {
- bad2: ;
- }
-
- #pragma omp parallel
- {
- int i;
- goto ok1;
- for (i = 0; i < 10; ++i)
- { ok1: break; }
- }
-}
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/jump.c b/gcc/testsuite/gcc.dg/cilk-plus/jump.c
deleted file mode 100644
index 1ca886a645f..00000000000
--- a/gcc/testsuite/gcc.dg/cilk-plus/jump.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int *a, *b, c;
-
-void foo()
-{
-#pragma simd
- for (int i=0; i < 1000; ++i)
- {
- a[i] = b[i];
- if (c == 5)
- return; /* { dg-error "invalid branch to/from Cilk Plus structured block" } */
- }
-}
-
-void bar()
-{
-#pragma simd
- for (int i=0; i < 1000; ++i)
- {
- lab:
- a[i] = b[i];
- }
- if (c == 6)
- goto lab; /* { dg-error "invalid entry to Cilk Plus structured block" } */
-}
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/pr69798-1.c b/gcc/testsuite/gcc.dg/cilk-plus/pr69798-1.c
deleted file mode 100644
index c5a37a86a21..00000000000
--- a/gcc/testsuite/gcc.dg/cilk-plus/pr69798-1.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* PR c/69798 */
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-extern int foo (void);
-
-void
-fn1 (int i, int *p)
-{
-l:
- _Cilk_spawn (void); /* { dg-error "expected expression" } */
- _Cilk_spawn (char []); /* { dg-error "expected expression" } */
- _Cilk_spawn (int *); /* { dg-error "expected expression" } */
- _Cilk_spawn (int) 1; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn ({}); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn ++i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn i++; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn --i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn i--; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn &i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn +i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn -i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn ~i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn !i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn *p; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn &&l; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn sizeof (i); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn sizeof (short); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __alignof__ (i); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __alignof__ (short); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __extension__ i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __func__; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn p[0]; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __real__ i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __imag__ i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn !foo (); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn ~foo (); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn (unsigned) foo (); /* { dg-error "only function calls can be spawned" } */
-}
-
-void
-fn2 (int i, int *p)
-{
-l:
- _Cilk_spawn _Cilk_spawn (void); /* { dg-error "consecutive|expected expression" } */
- _Cilk_spawn _Cilk_spawn (char []); /* { dg-error "consecutive|expected expression" } */
- _Cilk_spawn _Cilk_spawn (int *); /* { dg-error "consecutive|expected expression" } */
- _Cilk_spawn _Cilk_spawn (int) 1; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn ({}); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn ++i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn i++; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn --i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn i--; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn &i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn +i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn -i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn ~i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn !i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn *p; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn &&l; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn sizeof (i); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn sizeof (short); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __alignof__ (i); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __alignof__ (short); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __extension__ i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __func__; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn p[0]; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __real__ i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __imag__ i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn !foo (); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn ~foo (); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn (unsigned) foo (); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
-}
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/pr69798-2.c b/gcc/testsuite/gcc.dg/cilk-plus/pr69798-2.c
deleted file mode 100644
index 6719225dd7a..00000000000
--- a/gcc/testsuite/gcc.dg/cilk-plus/pr69798-2.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* PR c/69798 */
-/* { dg-do compile } */
-
-extern int foo (void);
-
-void
-fn1 (int i, int *p)
-{
-l:
- _Cilk_spawn (void); /* { dg-error "expected expression" } */
- _Cilk_spawn (char []); /* { dg-error "expected expression" } */
- _Cilk_spawn (int *); /* { dg-error "expected expression" } */
- _Cilk_spawn (int) 1; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn ({}); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn ++i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn i++; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn --i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn i--; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn &i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn +i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn -i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn ~i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn !i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn *p; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn &&l; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn sizeof (i); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn sizeof (short); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __alignof__ (i); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __alignof__ (short); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __extension__ i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __func__; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn p[0]; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __real__ i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn __imag__ i; /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn !foo (); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn ~foo (); /* { dg-error "only function calls can be spawned" } */
- _Cilk_spawn (unsigned) foo (); /* { dg-error "only function calls can be spawned" } */
-}
-
-void
-fn2 (int i, int *p)
-{
-l:
- _Cilk_spawn _Cilk_spawn (void); /* { dg-error "consecutive|expected expression" } */
- _Cilk_spawn _Cilk_spawn (char []); /* { dg-error "consecutive|expected expression" } */
- _Cilk_spawn _Cilk_spawn (int *); /* { dg-error "consecutive|expected expression" } */
- _Cilk_spawn _Cilk_spawn (int) 1; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn ({}); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn ++i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn i++; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn --i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn i--; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn &i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn +i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn -i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn ~i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn !i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn *p; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn &&l; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn sizeof (i); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn sizeof (short); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __alignof__ (i); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __alignof__ (short); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __extension__ i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __func__; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn p[0]; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __real__ i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn __imag__ i; /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn !foo (); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn ~foo (); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
- _Cilk_spawn _Cilk_spawn (unsigned) foo (); /* { dg-error "consecutive ._Cilk_spawn. keywords are not permitted" } */
-}
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/pr78306.c b/gcc/testsuite/gcc.dg/cilk-plus/pr78306.c
deleted file mode 100644
index 4604271441c..00000000000
--- a/gcc/testsuite/gcc.dg/cilk-plus/pr78306.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-O2 -fcilkplus" } */
-
-#define _FORTIFY_SOURCE 2
-#include <string.h>
-
-int sum(int low, int high)
-{
- if(low == high) {
- return low;
- }
-
- int mid = low + (high-low)/2;
- int a = _Cilk_spawn sum(low, mid);
- int b = sum(mid+1, high);
-
- // Some very expensive computation here
- int foo[64];
- memset(foo, 0, 64*sizeof(int)); // <--- Fails
-
- _Cilk_sync;
-
- return a+b;
-}
-
-int main(void) {
- if (sum(0, 100) != 5050)
- __builtin_abort ();
- return 0;
-}
diff --git a/gcc/testsuite/gcc.dg/cilk-plus/pr79116.c b/gcc/testsuite/gcc.dg/cilk-plus/pr79116.c
deleted file mode 100644
index 9206aaf3a1f..00000000000
--- a/gcc/testsuite/gcc.dg/cilk-plus/pr79116.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus" } */
-
-int array[1024];
-void foo()
-{
- _Cilk_for (int i = 0; i < 512; ++i)
- array[:] = __sec_implicit_index(0);
-}
diff --git a/gcc/testsuite/gcc.dg/graphite/id-28.c b/gcc/testsuite/gcc.dg/graphite/id-28.c
deleted file mode 100644
index dd5fb9f70e2..00000000000
--- a/gcc/testsuite/gcc.dg/graphite/id-28.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* { dg-do compile { target cilkplus } } */
-/* { dg-options "-fcilkplus -floop-nest-optimize -O3" } */
-
-#if HAVE_IO
-#include <stdio.h>
-#endif
-#include <math.h>
-#define NUMBER 5
-
-int func1 (int *a1, int *a2)
-{
- return __sec_reduce_add (a1[0:NUMBER] * a2[0:NUMBER:1]);
-}
-
-int func2 (int *a1, int *a2)
-{
- return (__sec_reduce_add (a1[0:NUMBER] * a2[0:NUMBER]) +
- __sec_reduce_mul (a1[0:NUMBER] + a2[0:NUMBER]));
-}
-
-int func3 (int *a1, int *a2)
-{
- return (int) sqrt ((double)(__sec_reduce_add (a1[0:NUMBER] * a2[0:NUMBER]) +
- a2[0] + a2[1] + a2[3]));
-}
-
-int func4 (int *a1, int *a2)
-{
- return a1[NUMBER-1] * (__sec_reduce_add (a1[0:NUMBER] * a2[0:NUMBER]) + a2[0] + a2[1] + a2[3])/a1[NUMBER-2];
-}
-int main(void)
-{
- int array[NUMBER], array2[NUMBER];
- int return_value = 0;
- int ii = 0;
- int argc = 1;
- __asm volatile ("" : "+r" (argc));
- for (ii = 0; ii < NUMBER; ii++)
- {
- array[ii] = argc; /* This should calculate to 1. */
- array2[ii] = argc * argc + argc; /* This should calculate to 2. */
- }
-
- return_value = func1 (array, array2);
-#if HAVE_IO
- printf("Return_value = %d\n", return_value);
-#endif
- if (return_value != (2+2+2+2+2))
- return 1;
-
- return_value = func2 (array2, array);
-#if HAVE_IO
- printf("Return_value = %d\n", return_value);
-#endif
- if (return_value != (3*3*3*3*3) + (2+2+2+2+2))
- return 2;
-
- return_value = func3 (array, array2);
-#if HAVE_IO
- printf("Return_value = %d\n", return_value);
-#endif
- if (return_value != 4)
- return 3;
-
- return_value = func4 (array, array2);
-#if HAVE_IO
- printf("Return_value = %d\n", return_value);
-#endif
- if (return_value != 16)
- return 4;
-
- return 0;
-}
diff --git a/gcc/testsuite/lib/cilk-plus-dg.exp b/gcc/testsuite/lib/cilk-plus-dg.exp
deleted file mode 100644
index 04b4f218431..00000000000
--- a/gcc/testsuite/lib/cilk-plus-dg.exp
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright (C) 2014-2017 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-#
-# cilkplus_link_flags -- compute library path and flags to find libcilkrts.
-# (originally from g++.exp)
-#
-
-proc cilkplus_link_flags { paths } {
- global srcdir
- global ld_library_path
- global shlib_ext
-
- set gccpath ${paths}
- set flags ""
-
- set shlib_ext [get_shlib_extension]
-
- if { $gccpath != "" } {
- if { [file exists "${gccpath}/libcilkrts/.libs/libcilkrts.a"]
- || [file exists "${gccpath}/libcilkrts/.libs/libcilkrts.${shlib_ext}"] } {
- append flags " -B${gccpath}/libcilkrts/ "
- append flags " -L${gccpath}/libcilkrts/.libs"
- append ld_library_path ":${gccpath}/libcilkrts/.libs"
- }
- } else {
- global tool_root_dir
-
- set libcilkrts [lookfor_file ${tool_root_dir} libcilkrts]
- if { $libcilkrts != "" } {
- append flags "-L${libcilkrts} "
- append ld_library_path ":${libcilkrts}"
- }
- }
-
- set_ld_library_path_env_vars
-
- return "$flags"
-}
-
-#
-# cilkplus_init -- called at the start of each subdir of tests
-#
-
-proc cilkplus_init { args } {
- global TEST_ALWAYS_FLAGS
- global ALWAYS_CXXFLAGS
- global TOOL_OPTIONS
- global cilkplus_saved_TEST_ALWAYS_FLAGS
-
- set link_flags ""
- if ![is_remote host] {
- if [info exists TOOL_OPTIONS] {
- set link_flags "[cilkplus_link_flags [get_multilibs ${TOOL_OPTIONS}]]"
- } else {
- set link_flags "[cilkplus_link_flags [get_multilibs]]"
- }
- }
-
- if [info exists TEST_ALWAYS_FLAGS] {
- set cilkplus_saved_TEST_ALWAYS_FLAGS $TEST_ALWAYS_FLAGS
- }
- if [info exists ALWAYS_CXXFLAGS] {
- set ALWAYS_CXXFLAGS [concat "{ldflags=$link_flags}" $ALWAYS_CXXFLAGS]
- } else {
- if [info exists TEST_ALWAYS_FLAGS] {
- set TEST_ALWAYS_FLAGS "$link_flags $TEST_ALWAYS_FLAGS"
- } else {
- set TEST_ALWAYS_FLAGS "$link_flags"
- }
- }
- if { $link_flags != "" } {
- return 1
- }
- return 0
-}
-
-#
-# cilkplus_finish -- called at the end of each subdir of tests
-#
-
-proc cilkplus_finish { args } {
- global TEST_ALWAYS_FLAGS
- global cilkplus_saved_TEST_ALWAYS_FLAGS
-
- if [info exists cilkplus_saved_TEST_ALWAYS_FLAGS] {
- set TEST_ALWAYS_FLAGS $cilkplus_saved_TEST_ALWAYS_FLAGS
- } else {
- unset TEST_ALWAYS_FLAGS
- }
- clear_effective_target_cache
-}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index d30fd368922..6242ce95469 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1391,20 +1391,6 @@ proc check_iconv_available { test_what } {
}] $libiconv]
}
-# Return true if Cilk Library is supported on the target.
-proc check_effective_target_cilkplus_runtime { } {
- return [ check_no_compiler_messages_nocache cilkplus_runtime executable {
- #ifdef __cplusplus
- extern "C"
- #endif
- int __cilkrts_set_param (const char *, const char *);
- int main (void) {
- int x = __cilkrts_set_param ("nworkers", "0");
- return x;
- }
- } "-fcilkplus -lcilkrts" ]
-}
-
# Return true if the atomic library is supported on the target.
proc check_effective_target_libatomic_available { } {
return [check_no_compiler_messages libatomic_available executable {
@@ -1561,29 +1547,6 @@ proc check_effective_target_rdynamic { } {
} "-rdynamic"]
}
-# Return 1 if cilk-plus is supported by the target, 0 otherwise.
-
-proc check_effective_target_cilkplus { } {
- # Skip cilk-plus tests on int16 and size16 targets for now.
- # The cilk-plus tests are not generic enough to cover these
- # cases and would throw hundreds of FAILs.
- if { [check_effective_target_int16]
- || ![check_effective_target_size32plus] } {
- return 0;
- }
-
- # Skip AVR, its RAM is too small and too many tests would fail.
- if { [istarget avr-*-*] } {
- return 0;
- }
-
- if { ! [check_effective_target_pthread] } {
- return 0;
- }
-
- return 1
-}
-
proc check_linker_plugin_available { } {
return [check_no_compiler_messages_nocache linker_plugin executable {
int main() { return 0; }
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index a2633af478e..5f900b8fe59 100644
--- a/gcc/tree-core.h
+++ b/gcc/tree-core.h
@@ -445,10 +445,6 @@ enum omp_clause_code {
loop or not. */
OMP_CLAUSE__SIMT_,
- /* Internally used only clause, holding _Cilk_for # of iterations
- on OMP_PARALLEL. */
- OMP_CLAUSE__CILK_FOR_COUNT_,
-
/* OpenACC clause: independent. */
OMP_CLAUSE_INDEPENDENT,
@@ -489,7 +485,6 @@ enum omp_clause_schedule_kind {
OMP_CLAUSE_SCHEDULE_GUIDED,
OMP_CLAUSE_SCHEDULE_AUTO,
OMP_CLAUSE_SCHEDULE_RUNTIME,
- OMP_CLAUSE_SCHEDULE_CILKFOR,
OMP_CLAUSE_SCHEDULE_MASK = (1 << 3) - 1,
OMP_CLAUSE_SCHEDULE_MONOTONIC = (1 << 3),
OMP_CLAUSE_SCHEDULE_NONMONOTONIC = (1 << 4),
@@ -1210,10 +1205,6 @@ struct GTY(()) tree_base {
SSA_NAME_OCCURS_IN_ABNORMAL_PHI in
SSA_NAME
- EXPR_CILK_SPAWN in
- CALL_EXPR
- AGGR_INIT_EXPR
-
used_flag:
TREE_USED in
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 7f26e61acc7..6cbae7b97cc 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -1196,7 +1196,6 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
case OMP_CLAUSE_GRAINSIZE:
case OMP_CLAUSE_NUM_TASKS:
case OMP_CLAUSE_HINT:
- case OMP_CLAUSE__CILK_FOR_COUNT_:
case OMP_CLAUSE_NUM_GANGS:
case OMP_CLAUSE_NUM_WORKERS:
case OMP_CLAUSE_VECTOR_LENGTH:
@@ -1898,7 +1897,6 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
case OMP_CLAUSE_GRAINSIZE:
case OMP_CLAUSE_NUM_TASKS:
case OMP_CLAUSE_HINT:
- case OMP_CLAUSE__CILK_FOR_COUNT_:
case OMP_CLAUSE_NUM_GANGS:
case OMP_CLAUSE_NUM_WORKERS:
case OMP_CLAUSE_VECTOR_LENGTH:
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 1cdec69314d..ab4b2f705c8 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -466,13 +466,6 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
pp_right_paren (pp);
break;
- case OMP_CLAUSE__CILK_FOR_COUNT_:
- pp_string (pp, "_Cilk_for_count_(");
- dump_generic_node (pp, OMP_CLAUSE_OPERAND (clause, 0),
- spc, flags, false);
- pp_right_paren (pp);
- break;
-
case OMP_CLAUSE_NOWAIT:
pp_string (pp, "nowait");
break;
@@ -550,9 +543,6 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
case OMP_CLAUSE_SCHEDULE_AUTO:
pp_string (pp, "auto");
break;
- case OMP_CLAUSE_SCHEDULE_CILKFOR:
- pp_string (pp, "cilk-for grain");
- break;
default:
gcc_unreachable ();
}
@@ -2969,16 +2959,6 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
pp_string (pp, "#pragma omp simd");
goto dump_omp_loop;
- case CILK_SIMD:
- pp_string (pp, "#pragma simd");
- goto dump_omp_loop;
-
- case CILK_FOR:
- /* This label points one line after dumping the clauses.
- For _Cilk_for the clauses are dumped after the _Cilk_for (...)
- parameters are printed out. */
- goto dump_omp_loop_cilk_for;
-
case OMP_DISTRIBUTE:
pp_string (pp, "#pragma omp distribute");
goto dump_omp_loop;
@@ -3026,18 +3006,13 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
dump_omp_loop:
dump_omp_clauses (pp, OMP_FOR_CLAUSES (node), spc, flags);
-
- dump_omp_loop_cilk_for:
if (!(flags & TDF_SLIM))
{
int i;
if (OMP_FOR_PRE_BODY (node))
{
- if (TREE_CODE (node) == CILK_FOR)
- pp_string (pp, " ");
- else
- newline_and_indent (pp, spc + 2);
+ newline_and_indent (pp, spc + 2);
pp_left_brace (pp);
spc += 4;
newline_and_indent (pp, spc);
@@ -3050,12 +3025,8 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (node)); i++)
{
spc += 2;
- if (TREE_CODE (node) != CILK_FOR || OMP_FOR_PRE_BODY (node))
- newline_and_indent (pp, spc);
- if (TREE_CODE (node) == CILK_FOR)
- pp_string (pp, "_Cilk_for (");
- else
- pp_string (pp, "for (");
+ newline_and_indent (pp, spc);
+ pp_string (pp, "for (");
dump_generic_node (pp,
TREE_VEC_ELT (OMP_FOR_INIT (node), i),
spc, flags, false);
@@ -3069,8 +3040,6 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
spc, flags, false);
pp_right_paren (pp);
}
- if (TREE_CODE (node) == CILK_FOR)
- dump_omp_clauses (pp, OMP_FOR_CLAUSES (node), spc, flags);
}
if (OMP_FOR_BODY (node))
{
@@ -3261,15 +3230,6 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
dump_block_node (pp, node, spc, flags);
break;
- case CILK_SPAWN_STMT:
- pp_string (pp, "_Cilk_spawn ");
- dump_generic_node (pp, TREE_OPERAND (node, 0), spc, flags, false);
- break;
-
- case CILK_SYNC_STMT:
- pp_string (pp, "_Cilk_sync");
- break;
-
default:
NIY;
}
diff --git a/gcc/tree.c b/gcc/tree.c
index da2db7ae9bf..28970dfcc85 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -323,7 +323,6 @@ unsigned const char omp_clause_num_ops[] =
0, /* OMP_CLAUSE_DEFALTMAP */
1, /* OMP_CLAUSE__SIMDUID_ */
0, /* OMP_CLAUSE__SIMT_ */
- 1, /* OMP_CLAUSE__CILK_FOR_COUNT_ */
0, /* OMP_CLAUSE_INDEPENDENT */
1, /* OMP_CLAUSE_WORKER */
1, /* OMP_CLAUSE_VECTOR */
@@ -395,7 +394,6 @@ const char * const omp_clause_code_name[] =
"defaultmap",
"_simduid_",
"_simt_",
- "_Cilk_for_count_",
"independent",
"worker",
"vector",
@@ -11298,7 +11296,6 @@ walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
case OMP_CLAUSE_IS_DEVICE_PTR:
case OMP_CLAUSE__LOOPTEMP_:
case OMP_CLAUSE__SIMDUID_:
- case OMP_CLAUSE__CILK_FOR_COUNT_:
WALK_SUBTREE (OMP_CLAUSE_OPERAND (*tp, 0));
/* FALLTHRU */
diff --git a/gcc/tree.def b/gcc/tree.def
index 9b6e06fba8c..3029dab3e2e 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -1131,14 +1131,6 @@ DEFTREECODE (OMP_FOR, "omp_for", tcc_statement, 7)
Operands like for OMP_FOR. */
DEFTREECODE (OMP_SIMD, "omp_simd", tcc_statement, 7)
-/* Cilk Plus - #pragma simd [clause1 ... clauseN]
- Operands like for OMP_FOR. */
-DEFTREECODE (CILK_SIMD, "cilk_simd", tcc_statement, 7)
-
-/* Cilk Plus - _Cilk_for (..)
- Operands like for OMP_FOR. */
-DEFTREECODE (CILK_FOR, "cilk_for", tcc_statement, 7)
-
/* OpenMP - #pragma omp distribute [clause1 ... clauseN]
Operands like for OMP_FOR. */
DEFTREECODE (OMP_DISTRIBUTE, "omp_distribute", tcc_statement, 7)
@@ -1408,13 +1400,6 @@ DEFTREECODE (TARGET_OPTION_NODE, "target_option_node", tcc_exceptional, 0)
Operand 2 is additional data. */
DEFTREECODE (ANNOTATE_EXPR, "annotate_expr", tcc_expression, 3)
-/* Cilk spawn statement
- Operand 0 is the CALL_EXPR. */
-DEFTREECODE (CILK_SPAWN_STMT, "cilk_spawn_stmt", tcc_statement, 1)
-
-/* Cilk Sync statement: Does not have any operands. */
-DEFTREECODE (CILK_SYNC_STMT, "cilk_sync_stmt", tcc_statement, 0)
-
/*
Local variables:
mode:c
diff --git a/gcc/tree.h b/gcc/tree.h
index 68c5b2c4bd2..d8912821ad5 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -875,15 +875,6 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
#define CALL_EXPR_RETURN_SLOT_OPT(NODE) \
(CALL_EXPR_CHECK (NODE)->base.private_flag)
-/* Cilk keywords accessors. */
-#define CILK_SPAWN_FN(NODE) TREE_OPERAND (CILK_SPAWN_STMT_CHECK (NODE), 0)
-
-/* If this is true, we should insert a __cilk_detach call just before
- this function call. */
-#define EXPR_CILK_SPAWN(NODE) \
- (TREE_CHECK2 (NODE, CALL_EXPR, \
- AGGR_INIT_EXPR)->base.u.bits.unsigned_flag)
-
/* In a RESULT_DECL, PARM_DECL and VAR_DECL, means that it is
passed by invisible reference (and the TREE_TYPE is a pointer to the true
type). */