summaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authortschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-27 08:39:15 +0000
committertschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-27 08:39:15 +0000
commit2c4c872529d6e1051fb9cdd641ad5cc9fbc0e2cb (patch)
tree6ab5ea8ba1b8126fa0e7ad76b11ad320ba2c7edb /gcc/cp/semantics.c
parent78936097a403398942fc3d24e3f67bb92ffb47cb (diff)
downloadgcc-2c4c872529d6e1051fb9cdd641ad5cc9fbc0e2cb.tar.gz
[PR c/64765, c/64880] Support OpenACC Combined Directives in C, C++
gcc/c-family/ PR c/64765 PR c/64880 * c-common.h (c_oacc_split_loop_clauses): Declare function. * c-omp.c (c_oacc_split_loop_clauses): New function. gcc/c/ PR c/64765 PR c/64880 * c-parser.c (c_parser_oacc_loop): Add mask, cclauses formal parameters, and handle these. Adjust all users. (c_parser_oacc_kernels, c_parser_oacc_parallel): Merge functions into... (c_parser_oacc_kernels_parallel): ... this new function. Adjust all users. * c-tree.h (c_finish_oacc_parallel, c_finish_oacc_kernels): Don't declare functions. (c_finish_omp_construct): Declare function. * c-typeck.c (c_finish_oacc_parallel, c_finish_oacc_kernels): Merge functions into... (c_finish_omp_construct): ... this new function. gcc/cp/ PR c/64765 PR c/64880 * cp-tree.h (finish_oacc_kernels, finish_oacc_parallel): Don't declare functions. (finish_omp_construct): Declare function. * parser.c (cp_parser_oacc_loop): Add p_name, mask, cclauses formal parameters, and handle these. Adjust all users. (cp_parser_oacc_kernels, cp_parser_oacc_parallel): Merge functions into... (cp_parser_oacc_kernels_parallel): ... this new function. Adjust all users. * semantics.c (finish_oacc_kernels, finish_oacc_parallel): Merge functions into... (finish_omp_construct): ... this new function. gcc/ * tree.h (OACC_PARALLEL_BODY, OACC_PARALLEL_CLAUSES) (OACC_KERNELS_BODY, OACC_KERNELS_CLAUSES, OACC_KERNELS_COMBINED) (OACC_PARALLEL_COMBINED): Don't define macros. Adjust all users. gcc/testsuite/ PR c/64765 PR c/64880 * c-c++-common/goacc/loop-1.c: Don't skip for C++. Don't prune sorry message. (PR64765): New function. * gfortran.dg/goacc/coarray_2.f90: XFAIL. * gfortran.dg/goacc/combined_loop.f90: Extend. Don't prune sorry message. * gfortran.dg/goacc/cray.f95: Refine prune directive. * gfortran.dg/goacc/parameter.f95: Likewise. libgomp/ * testsuite/libgomp.oacc-c-c++-common/combdir-1.c: New file. * testsuite/libgomp.oacc-fortran/combdir-1.f90: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229404 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c54
1 files changed, 17 insertions, 37 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 11315d90668..f9e86d09b43 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -7106,69 +7106,49 @@ finish_omp_structured_block (tree block)
return do_poplevel (block);
}
-/* Generate OACC_DATA, with CLAUSES and BLOCK as its compound
- statement. LOC is the location of the OACC_DATA. */
+/* Similarly, except force the retention of the BLOCK. */
tree
-finish_oacc_data (tree clauses, tree block)
+begin_omp_parallel (void)
{
- tree stmt;
-
- block = finish_omp_structured_block (block);
-
- stmt = make_node (OACC_DATA);
- TREE_TYPE (stmt) = void_type_node;
- OACC_DATA_CLAUSES (stmt) = clauses;
- OACC_DATA_BODY (stmt) = block;
-
- return add_stmt (stmt);
+ keep_next_level (true);
+ return begin_omp_structured_block ();
}
-/* Generate OACC_KERNELS, with CLAUSES and BLOCK as its compound
- statement. LOC is the location of the OACC_KERNELS. */
+/* Generate OACC_DATA, with CLAUSES and BLOCK as its compound
+ statement. */
tree
-finish_oacc_kernels (tree clauses, tree block)
+finish_oacc_data (tree clauses, tree block)
{
tree stmt;
block = finish_omp_structured_block (block);
- stmt = make_node (OACC_KERNELS);
+ stmt = make_node (OACC_DATA);
TREE_TYPE (stmt) = void_type_node;
- OACC_KERNELS_CLAUSES (stmt) = clauses;
- OACC_KERNELS_BODY (stmt) = block;
+ OACC_DATA_CLAUSES (stmt) = clauses;
+ OACC_DATA_BODY (stmt) = block;
return add_stmt (stmt);
}
-/* Generate OACC_PARALLEL, with CLAUSES and BLOCK as its compound
- statement. LOC is the location of the OACC_PARALLEL. */
+/* Generate OMP construct CODE, with BODY and CLAUSES as its compound
+ statement. */
tree
-finish_oacc_parallel (tree clauses, tree block)
+finish_omp_construct (enum tree_code code, tree body, tree clauses)
{
- tree stmt;
-
- block = finish_omp_structured_block (block);
+ body = finish_omp_structured_block (body);
- stmt = make_node (OACC_PARALLEL);
+ tree stmt = make_node (code);
TREE_TYPE (stmt) = void_type_node;
- OACC_PARALLEL_CLAUSES (stmt) = clauses;
- OACC_PARALLEL_BODY (stmt) = block;
+ OMP_BODY (stmt) = body;
+ OMP_CLAUSES (stmt) = clauses;
return add_stmt (stmt);
}
-/* Similarly, except force the retention of the BLOCK. */
-
-tree
-begin_omp_parallel (void)
-{
- keep_next_level (true);
- return begin_omp_structured_block ();
-}
-
tree
finish_omp_parallel (tree clauses, tree body)
{