Skip to content

Commit

Permalink
OpenACC 2.7: Implement self clause for compute constructs
Browse files Browse the repository at this point in the history
This patch implements the 'self' clause for compute constructs: parallel,
kernels, and serial. This clause conditionally uses the local device
(the host mult-core CPU) as the executing device of the compute region.

The actual implementation of the "local device" device type inside libgomp
(presumably using pthreads) is still not yet completed, so the libgomp
side is still implemented the exact same as host-fallback mode. (so as of now,
it essentially behaves like the 'if' clause with the condition inverted)

gcc/c/ChangeLog:

	* c-parser.cc (c_parser_oacc_compute_clause_self): New function.
	(c_parser_oacc_all_clauses): Add new 'bool compute_p = false'
	parameter, add parsing of self clause when compute_p is true.
	(OACC_KERNELS_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_SELF.
	(OACC_PARALLEL_CLAUSE_MASK): Likewise,
	(OACC_SERIAL_CLAUSE_MASK): Likewise.
	(c_parser_oacc_compute): Adjust call to c_parser_oacc_all_clauses to
	set compute_p argument to true.
	* c-typeck.cc (c_finish_omp_clauses): Add OMP_CLAUSE_SELF case.

gcc/cp/ChangeLog:

	* parser.cc (cp_parser_oacc_compute_clause_self): New function.
	(cp_parser_oacc_all_clauses): Add new 'bool compute_p = false'
	parameter, add parsing of self clause when compute_p is true.
	(OACC_KERNELS_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_SELF.
	(OACC_PARALLEL_CLAUSE_MASK): Likewise,
	(OACC_SERIAL_CLAUSE_MASK): Likewise.
	(cp_parser_oacc_compute): Adjust call to c_parser_oacc_all_clauses to
	set compute_p argument to true.
	* pt.cc (tsubst_omp_clauses): Add OMP_CLAUSE_SELF case.
	* c-typeck.cc (c_finish_omp_clauses): Add OMP_CLAUSE_SELF case, merged
	with OMP_CLAUSE_IF case.

gcc/fortran/ChangeLog:

	* gfortran.h (typedef struct gfc_omp_clauses): Add self_expr field.
	* openmp.cc (enum omp_mask2): Add OMP_CLAUSE_SELF.
	(gfc_match_omp_clauses): Add handling for OMP_CLAUSE_SELF.
	(OACC_PARALLEL_CLAUSES): Add OMP_CLAUSE_SELF.
	(OACC_KERNELS_CLAUSES): Likewise.
	(OACC_SERIAL_CLAUSES): Likewise.
	(resolve_omp_clauses): Add handling for omp_clauses->self_expr.
	* trans-openmp.cc (gfc_trans_omp_clauses): Add handling of
	clauses->self_expr and building of OMP_CLAUSE_SELF tree clause.
	(gfc_split_omp_clauses): Add handling of self_expr field copy.

gcc/ChangeLog:

	* gimplify.cc (gimplify_scan_omp_clauses): Add OMP_CLAUSE_SELF case.
	(gimplify_adjust_omp_clauses): Likewise.
	* omp-expand.cc (expand_omp_target): Add OMP_CLAUSE_SELF expansion code,
	* omp-low.cc (scan_sharing_clauses): Add OMP_CLAUSE_SELF case.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_SELF enum.
	* tree-nested.cc (convert_nonlocal_omp_clauses): Add OMP_CLAUSE_SELF
	case.
	(convert_local_omp_clauses): Likewise.
	* tree-pretty-print.cc (dump_omp_clause): Add OMP_CLAUSE_SELF case.
	* tree.cc (omp_clause_num_ops): Add OMP_CLAUSE_SELF entry.
	(omp_clause_code_name): Likewise.
	* tree.h (OMP_CLAUSE_SELF_EXPR): New macro.

gcc/testsuite/ChangeLog:

	* c-c++-common/goacc/self-clause-1.c: New test.
	* c-c++-common/goacc/self-clause-2.c: New test.
	* gfortran.dg/goacc/self.f95: New test.

include/ChangeLog:

	* gomp-constants.h (GOACC_FLAG_LOCAL_DEVICE): New flag bit value.

libgomp/ChangeLog:

	* oacc-parallel.c (GOACC_parallel_keyed): Add code to handle
	GOACC_FLAG_LOCAL_DEVICE case.
	* testsuite/libgomp.oacc-c-c++-common/self-1.c: New test.
  • Loading branch information
Chung-Lin Tang authored and ouuleilei-bot committed Jun 13, 2023
1 parent c2d62cd commit 8f1146b
Show file tree
Hide file tree
Showing 22 changed files with 1,305 additions and 12 deletions.
60 changes: 57 additions & 3 deletions gcc/c/c-parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15426,6 +15426,41 @@ c_parser_oacc_clause_wait (c_parser *parser, tree list)
return list;
}

/* OpenACC 2.7:
self [( expression )] */

static tree
c_parser_oacc_compute_clause_self (c_parser *parser, tree list)
{
tree t;
location_t location = c_parser_peek_token (parser)->location;
if (c_parser_peek_token (parser)->type == CPP_OPEN_PAREN)
{
matching_parens parens;
parens.consume_open (parser);

location_t loc = c_parser_peek_token (parser)->location;
c_expr expr = c_parser_expr_no_commas (parser, NULL);
expr = convert_lvalue_to_rvalue (loc, expr, true, true);
t = c_objc_common_truthvalue_conversion (loc, expr.value);
t = c_fully_fold (t, false, NULL);
parens.skip_until_found_close (parser);
}
else
t = truthvalue_true_node;

for (tree c = list; c; c = OMP_CLAUSE_CHAIN (c))
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SELF)
{
error_at (location, "too many %<self%> clauses");
return list;
}

tree c = build_omp_clause (location, OMP_CLAUSE_SELF);
OMP_CLAUSE_SELF_EXPR (c) = t;
OMP_CLAUSE_CHAIN (c) = list;
return c;
}

/* OpenMP 5.0:
order ( concurrent )
Expand Down Expand Up @@ -17506,7 +17541,8 @@ c_parser_omp_clause_detach (c_parser *parser, tree list)

static tree
c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask,
const char *where, bool finish_p = true)
const char *where, bool finish_p = true,
bool compute_p = false)
{
tree clauses = NULL;
bool first = true;
Expand All @@ -17522,7 +17558,18 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask,
c_parser_consume_token (parser);

here = c_parser_peek_token (parser)->location;
c_kind = c_parser_omp_clause_name (parser);

/* For OpenACC compute directives */
if (compute_p
&& c_parser_next_token_is (parser, CPP_NAME)
&& !strcmp (IDENTIFIER_POINTER (c_parser_peek_token (parser)->value),
"self"))
{
c_kind = PRAGMA_OACC_CLAUSE_SELF;
c_parser_consume_token (parser);
}
else
c_kind = c_parser_omp_clause_name (parser);

switch (c_kind)
{
Expand Down Expand Up @@ -17654,6 +17701,10 @@ c_parser_oacc_all_clauses (c_parser *parser, omp_clause_mask mask,
false, clauses);
c_name = "reduction";
break;
case PRAGMA_OACC_CLAUSE_SELF:
clauses = c_parser_oacc_compute_clause_self (parser, clauses);
c_name = "self";
break;
case PRAGMA_OACC_CLAUSE_SEQ:
clauses = c_parser_oacc_simple_clause (here, OMP_CLAUSE_SEQ,
clauses);
Expand Down Expand Up @@ -18482,6 +18533,7 @@ c_parser_oacc_loop (location_t loc, c_parser *parser, char *p_name,
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_NUM_GANGS) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_NUM_WORKERS) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_PRESENT) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_SELF) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_VECTOR_LENGTH) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_WAIT) )

Expand All @@ -18502,6 +18554,7 @@ c_parser_oacc_loop (location_t loc, c_parser *parser, char *p_name,
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_NUM_WORKERS) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_PRESENT) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_REDUCTION) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_SELF) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_VECTOR_LENGTH) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_WAIT) )

Expand All @@ -18520,6 +18573,7 @@ c_parser_oacc_loop (location_t loc, c_parser *parser, char *p_name,
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_FIRSTPRIVATE) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_PRESENT) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_REDUCTION) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_SELF) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_WAIT) )

static tree
Expand Down Expand Up @@ -18562,7 +18616,7 @@ c_parser_oacc_compute (location_t loc, c_parser *parser,
}
}

tree clauses = c_parser_oacc_all_clauses (parser, mask, p_name);
tree clauses = c_parser_oacc_all_clauses (parser, mask, p_name, true, true);

tree block = c_begin_omp_parallel ();
add_stmt (c_parser_omp_structured_block (parser, if_p));
Expand Down
1 change: 1 addition & 0 deletions gcc/c/c-typeck.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15847,6 +15847,7 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
continue;

case OMP_CLAUSE_IF:
case OMP_CLAUSE_SELF:
case OMP_CLAUSE_NUM_THREADS:
case OMP_CLAUSE_NUM_TEAMS:
case OMP_CLAUSE_THREAD_LIMIT:
Expand Down
64 changes: 61 additions & 3 deletions gcc/cp/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40890,13 +40890,51 @@ cp_parser_oacc_clause_async (cp_parser *parser, tree list)
return list;
}

/* OpenACC 2.7:
self [( expression )] */

static tree
cp_parser_oacc_compute_clause_self (cp_parser *parser, tree list)
{
tree t;
location_t location = cp_lexer_peek_token (parser->lexer)->location;
if (cp_lexer_peek_token (parser->lexer)->type == CPP_OPEN_PAREN)
{
matching_parens parens;
parens.consume_open (parser);
t = cp_parser_assignment_expression (parser);
if (t == error_mark_node
|| !parens.require_close (parser))
{
cp_parser_skip_to_closing_parenthesis (parser, /*recovering=*/true,
/*or_comma=*/false,
/*consume_paren=*/true);
return list;
}
}
else
t = truthvalue_true_node;

for (tree c = list; c; c = OMP_CLAUSE_CHAIN (c))
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SELF)
{
error_at (location, "too many %<self%> clauses");
return list;
}

tree c = build_omp_clause (location, OMP_CLAUSE_SELF);
OMP_CLAUSE_SELF_EXPR (c) = t;
OMP_CLAUSE_CHAIN (c) = list;
return c;
}

/* Parse all OpenACC clauses. The set clauses allowed by the directive
is a bitmask in MASK. Return the list of clauses found. */

static tree
cp_parser_oacc_all_clauses (cp_parser *parser, omp_clause_mask mask,
const char *where, cp_token *pragma_tok,
bool finish_p = true)
bool finish_p = true, bool compute_p = false)
{
tree clauses = NULL;
bool first = true;
Expand All @@ -40916,7 +40954,19 @@ cp_parser_oacc_all_clauses (cp_parser *parser, omp_clause_mask mask,
cp_lexer_consume_token (parser->lexer);

here = cp_lexer_peek_token (parser->lexer)->location;
c_kind = cp_parser_omp_clause_name (parser);

/* For OpenACC compute directives */
if (compute_p
&& cp_lexer_next_token_is (parser->lexer, CPP_NAME)
&& !strcmp (IDENTIFIER_POINTER
(cp_lexer_peek_token (parser->lexer)->u.value),
"self"))
{
c_kind = PRAGMA_OACC_CLAUSE_SELF;
cp_lexer_consume_token (parser->lexer);
}
else
c_kind = cp_parser_omp_clause_name (parser);

switch (c_kind)
{
Expand Down Expand Up @@ -41050,6 +41100,10 @@ cp_parser_oacc_all_clauses (cp_parser *parser, omp_clause_mask mask,
false, clauses);
c_name = "reduction";
break;
case PRAGMA_OACC_CLAUSE_SELF:
clauses = cp_parser_oacc_compute_clause_self (parser, clauses);
c_name = "self";
break;
case PRAGMA_OACC_CLAUSE_SEQ:
clauses = cp_parser_oacc_simple_clause (here, OMP_CLAUSE_SEQ,
clauses);
Expand Down Expand Up @@ -46125,6 +46179,7 @@ cp_parser_oacc_loop (cp_parser *parser, cp_token *pragma_tok, char *p_name,
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_NUM_GANGS) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_NUM_WORKERS) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_PRESENT) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_SELF) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_VECTOR_LENGTH) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_WAIT) )

Expand All @@ -46145,6 +46200,7 @@ cp_parser_oacc_loop (cp_parser *parser, cp_token *pragma_tok, char *p_name,
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_PRESENT) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_PRIVATE) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_REDUCTION) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_SELF) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_VECTOR_LENGTH) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_WAIT) )

Expand All @@ -46163,6 +46219,7 @@ cp_parser_oacc_loop (cp_parser *parser, cp_token *pragma_tok, char *p_name,
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_FIRSTPRIVATE) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_PRESENT) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_REDUCTION) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_SELF) \
| (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_WAIT) )

static tree
Expand Down Expand Up @@ -46208,7 +46265,8 @@ cp_parser_oacc_compute (cp_parser *parser, cp_token *pragma_tok,
}
}

tree clauses = cp_parser_oacc_all_clauses (parser, mask, p_name, pragma_tok);
tree clauses = cp_parser_oacc_all_clauses (parser, mask, p_name, pragma_tok,
true, true);

tree block = begin_omp_parallel ();
unsigned int save = cp_parser_begin_omp_structured_block (parser);
Expand Down
1 change: 1 addition & 0 deletions gcc/cp/pt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18066,6 +18066,7 @@ tsubst_omp_clauses (tree clauses, enum c_omp_region_type ort,
/* FALLTHRU */
case OMP_CLAUSE_TILE:
case OMP_CLAUSE_IF:
case OMP_CLAUSE_SELF:
case OMP_CLAUSE_NUM_THREADS:
case OMP_CLAUSE_SCHEDULE:
case OMP_CLAUSE_COLLAPSE:
Expand Down
5 changes: 3 additions & 2 deletions gcc/cp/semantics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7301,13 +7301,14 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
goto handle_field_decl;

case OMP_CLAUSE_IF:
t = OMP_CLAUSE_IF_EXPR (c);
case OMP_CLAUSE_SELF:
t = OMP_CLAUSE_OPERAND (c, 0);
t = maybe_convert_cond (t);
if (t == error_mark_node)
remove = true;
else if (!processing_template_decl)
t = fold_build_cleanup_point_expr (TREE_TYPE (t), t);
OMP_CLAUSE_IF_EXPR (c) = t;
OMP_CLAUSE_OPERAND (c, 0) = t;
break;

case OMP_CLAUSE_FINAL:
Expand Down
1 change: 1 addition & 0 deletions gcc/fortran/gfortran.h
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,7 @@ typedef struct gfc_omp_clauses
{
gfc_omp_namelist *lists[OMP_LIST_NUM];
struct gfc_expr *if_expr;
struct gfc_expr *self_expr;
struct gfc_expr *final_expr;
struct gfc_expr *num_threads;
struct gfc_expr *chunk_size;
Expand Down
39 changes: 36 additions & 3 deletions gcc/fortran/openmp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,7 @@ enum omp_mask2
OMP_CLAUSE_ENTER, /* OpenMP 5.2 */
OMP_CLAUSE_DOACROSS, /* OpenMP 5.2 */
OMP_CLAUSE_ASSUMPTIONS, /* OpenMP 5.1. */
OMP_CLAUSE_SELF, /* OpenACC 2.7 */
/* This must come last. */
OMP_MASK2_LAST
};
Expand Down Expand Up @@ -3351,6 +3352,27 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
else
gfc_current_locus = old_loc;
}
if ((mask & OMP_CLAUSE_SELF)
&& (m = gfc_match_dupl_check (!c->self_expr, "self"))
!= MATCH_NO)
{
gcc_assert (!(mask & OMP_CLAUSE_HOST_SELF));
if (m == MATCH_ERROR)
goto error;
m = gfc_match (" ( %e )", &c->self_expr);
if (m == MATCH_ERROR)
{
gfc_current_locus = old_loc;
break;
}
else if (m == MATCH_NO)
{
c->self_expr = gfc_get_logical_expr (gfc_default_logical_kind,
NULL, true);
needs_space = true;
}
continue;
}
if ((mask & OMP_CLAUSE_HOST_SELF)
&& gfc_match ("self ( ") == MATCH_YES
&& gfc_match_omp_map_clause (&c->lists[OMP_LIST_MAP],
Expand Down Expand Up @@ -3618,19 +3640,22 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
| OMP_CLAUSE_COPY | OMP_CLAUSE_COPYIN | OMP_CLAUSE_COPYOUT \
| OMP_CLAUSE_CREATE | OMP_CLAUSE_NO_CREATE | OMP_CLAUSE_PRESENT \
| OMP_CLAUSE_DEVICEPTR | OMP_CLAUSE_PRIVATE | OMP_CLAUSE_FIRSTPRIVATE \
| OMP_CLAUSE_DEFAULT | OMP_CLAUSE_WAIT | OMP_CLAUSE_ATTACH)
| OMP_CLAUSE_DEFAULT | OMP_CLAUSE_WAIT | OMP_CLAUSE_ATTACH \
| OMP_CLAUSE_SELF)
#define OACC_KERNELS_CLAUSES \
(omp_mask (OMP_CLAUSE_IF) | OMP_CLAUSE_ASYNC | OMP_CLAUSE_NUM_GANGS \
| OMP_CLAUSE_NUM_WORKERS | OMP_CLAUSE_VECTOR_LENGTH | OMP_CLAUSE_DEVICEPTR \
| OMP_CLAUSE_COPY | OMP_CLAUSE_COPYIN | OMP_CLAUSE_COPYOUT \
| OMP_CLAUSE_CREATE | OMP_CLAUSE_NO_CREATE | OMP_CLAUSE_PRESENT \
| OMP_CLAUSE_DEFAULT | OMP_CLAUSE_WAIT | OMP_CLAUSE_ATTACH)
| OMP_CLAUSE_DEFAULT | OMP_CLAUSE_WAIT | OMP_CLAUSE_ATTACH \
| OMP_CLAUSE_SELF)
#define OACC_SERIAL_CLAUSES \
(omp_mask (OMP_CLAUSE_IF) | OMP_CLAUSE_ASYNC | OMP_CLAUSE_REDUCTION \
| OMP_CLAUSE_COPY | OMP_CLAUSE_COPYIN | OMP_CLAUSE_COPYOUT \
| OMP_CLAUSE_CREATE | OMP_CLAUSE_NO_CREATE | OMP_CLAUSE_PRESENT \
| OMP_CLAUSE_DEVICEPTR | OMP_CLAUSE_PRIVATE | OMP_CLAUSE_FIRSTPRIVATE \
| OMP_CLAUSE_DEFAULT | OMP_CLAUSE_WAIT | OMP_CLAUSE_ATTACH)
| OMP_CLAUSE_DEFAULT | OMP_CLAUSE_WAIT | OMP_CLAUSE_ATTACH \
| OMP_CLAUSE_SELF)
#define OACC_DATA_CLAUSES \
(omp_mask (OMP_CLAUSE_IF) | OMP_CLAUSE_DEVICEPTR | OMP_CLAUSE_COPY \
| OMP_CLAUSE_COPYIN | OMP_CLAUSE_COPYOUT | OMP_CLAUSE_CREATE \
Expand Down Expand Up @@ -6960,6 +6985,14 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
&expr->where);
if_without_mod = true;
}
if (omp_clauses->self_expr)
{
gfc_expr *expr = omp_clauses->self_expr;
if (!gfc_resolve_expr (expr)
|| expr->ts.type != BT_LOGICAL || expr->rank != 0)
gfc_error ("SELF clause at %L requires a scalar LOGICAL expression",
&expr->where);
}
for (ifc = 0; ifc < OMP_IF_LAST; ifc++)
if (omp_clauses->if_exprs[ifc])
{
Expand Down
18 changes: 18 additions & 0 deletions gcc/fortran/trans-openmp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3764,6 +3764,22 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
OMP_CLAUSE_IF_EXPR (c) = if_var;
omp_clauses = gfc_trans_add_clause (c, omp_clauses);
}

if (clauses->self_expr)
{
tree self_var;

gfc_init_se (&se, NULL);
gfc_conv_expr (&se, clauses->self_expr);
gfc_add_block_to_block (block, &se.pre);
self_var = gfc_evaluate_now (se.expr, block);
gfc_add_block_to_block (block, &se.post);

c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_SELF);
OMP_CLAUSE_SELF_EXPR (c) = self_var;
omp_clauses = gfc_trans_add_clause (c, omp_clauses);
}

for (ifc = 0; ifc < OMP_IF_LAST; ifc++)
if (clauses->if_exprs[ifc])
{
Expand Down Expand Up @@ -6407,6 +6423,8 @@ gfc_split_omp_clauses (gfc_code *code,
/* And this is copied to all. */
clausesa[GFC_OMP_SPLIT_TARGET].if_expr
= code->ext.omp_clauses->if_expr;
clausesa[GFC_OMP_SPLIT_TARGET].self_expr
= code->ext.omp_clauses->self_expr;
clausesa[GFC_OMP_SPLIT_TARGET].nowait
= code->ext.omp_clauses->nowait;
}
Expand Down
Loading

0 comments on commit 8f1146b

Please sign in to comment.