aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.c
diff options
context:
space:
mode:
authorBalaji V. Iyer <balaji.v.iyer@intel.com>2014-01-23 15:21:42 +0000
committerBalaji V. Iyer <bviyer@gcc.gnu.org>2014-01-23 07:21:42 -0800
commit74558dd9af65ab24f2cd45a1d0959562e6b14d41 (patch)
tree090a19da06b7855d39561e04b7b038b353fb2a9e /gcc/c/c-parser.c
parentd5ecead9406647c58e178bccc1f9d85259b087e5 (diff)
downloadgcc-74558dd9af65ab24f2cd45a1d0959562e6b14d41.zip
gcc-74558dd9af65ab24f2cd45a1d0959562e6b14d41.tar.gz
gcc-74558dd9af65ab24f2cd45a1d0959562e6b14d41.tar.bz2
Added support for Cilk Plus SIMD-enabled functions for C++.
gcc/c/c-parser.c 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com> * c-parser.c (c_finish_omp_declare_simd): Made "cilk simd function" attribute an attribute without value. gcc/cp/ChangeLog 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com> * parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled see if there is an attribute after function decl. If so, then parse them now. (cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD enabled function late parsing. (cp_parser_gnu_attribute_list): Parse all the tokens for the vector attribute for a SIMD-enabled function. (cp_parser_omp_all_clauses): Skip parsing to the end of pragma when the function is used by SIMD-enabled function (indicated by NULL pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK, PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH (cp_parser_cilk_simd_vectorlength): Modified this function to handle vectorlength clause in SIMD-enabled function and #pragma SIMD's vectorlength clause. Added a new bool parameter to differentiate between the two. (cp_parser_cilk_simd_fn_vector_attrs): New function. (is_cilkplus_vector_p): Likewise. (cp_parser_late_parsing_elem_fn_info): Likewise. (cp_parser_omp_clause_name): Added a check for "mask", "nomask" and "vectorlength" clauses when Cilk Plus is enabled. (cp_parser_omp_clause_linear): Added a new parameter of type bool and emit a sorry message when step size is a parameter. * parser.h (cp_parser::cilk_simd_fn_info): New field. * decl.c (grokfndecl): Added flag_enable_cilkplus along with flag_openmp. * pt.c (apply_late_template_attributes): Likewise. testsuite/ChangeLog 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com> * g++.dg/cilk-plus/cilk-plus.exp: Called the C/C++ common tests for SIMD enabled function. * g++.dg/cilk-plus/ef_test.C: New test. * c-c++-common/cilk-plus/ef_error3.c: Made certain messages C specific and added C++ ones. * c-c++-common/cilk-plus/vlength_errors.c: Added new dg-error tags to differenciate C error messages from C++ ones. From-SVN: r206975
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r--gcc/c/c-parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 4490210..bbf5287 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -12924,7 +12924,8 @@ c_finish_omp_declare_simd (c_parser *parser, tree fndecl, tree parms,
c = tree_cons (NULL_TREE, c, NULL_TREE);
if (is_cilkplus_cilk_simd_fn)
{
- tree k = build_tree_list (get_identifier ("cilk simd function"), c);
+ tree k = build_tree_list (get_identifier ("cilk simd function"),
+ NULL_TREE);
TREE_CHAIN (k) = DECL_ATTRIBUTES (fndecl);
DECL_ATTRIBUTES (fndecl) = k;
}