Skip to content

Commit

Permalink
Revert "Merge branch 'teams' into master"
Browse files Browse the repository at this point in the history
This reverts commit 96ce792, reversing
changes made to afff591.
  • Loading branch information
scrasmussen committed Nov 28, 2017
1 parent 96ce792 commit 8826a41
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 272 deletions.
15 changes: 1 addition & 14 deletions gcc/fortran/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,20 +231,7 @@ gfc_match_array_ref (gfc_array_ref *ar, gfc_array_spec *as, int init,
return MATCH_ERROR;

stat_just_seen = false;

if (gfc_match (" , team = %e", &tmp) == MATCH_YES && ar->stat == NULL)
{
ar->team = tmp;
team_just_seen = true;
}

if (ar->team && !team_just_seen)
{
gfc_error ("TEAM= attribute in %C misplaced");
return MATCH_ERROR;
}

if (gfc_match (" , stat = %e",&tmp) == MATCH_YES && ar->stat == NULL)
if (gfc_match(" , stat = %e",&tmp) == MATCH_YES && ar->stat == NULL)
{
ar->stat = tmp;
stat_just_seen = true;
Expand Down
20 changes: 1 addition & 19 deletions gcc/fortran/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -5006,25 +5006,7 @@ gfc_ref_this_image (gfc_ref *ref)
}

gfc_expr *
gfc_find_team_co (gfc_expr *e)
{
gfc_ref *ref;

for (ref = e->ref; ref; ref = ref->next)
if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0)
return ref->u.ar.team;

if (e->value.function.actual->expr)
for (ref = e->value.function.actual->expr->ref; ref;
ref = ref->next)
if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0)
return ref->u.ar.team;

return NULL;
}

gfc_expr *
gfc_find_stat_co (gfc_expr *e)
gfc_find_stat_co(gfc_expr *e)
{
gfc_ref *ref;

Expand Down
5 changes: 0 additions & 5 deletions gcc/fortran/intrinsic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1940,11 +1940,6 @@ add_functions (void)

make_generic ("getpid", GFC_ISYM_GETPID, GFC_STD_GNU);

add_sym_1 ("get_team", GFC_ISYM_GET_TEAM, CLASS_TRANSFORMATIONAL,
ACTUAL_NO, BT_INTEGER, di, GFC_STD_F2008_TS,
gfc_check_get_team, NULL, gfc_resolve_get_team,
"level", BT_INTEGER, di, OPTIONAL);

add_sym_0 ("getuid", GFC_ISYM_GETUID, CLASS_IMPURE, ACTUAL_NO, BT_INTEGER,
di, GFC_STD_GNU, NULL, NULL, gfc_resolve_getuid);

Expand Down
125 changes: 0 additions & 125 deletions gcc/fortran/match.c
Original file line number Diff line number Diff line change
Expand Up @@ -3343,131 +3343,6 @@ gfc_match_fail_image (void)
return MATCH_ERROR;
}

/* Match a FORM TEAM statement. */

match
gfc_match_form_team (void)
{
match m;
gfc_expr *teamid,*team;

if (!gfc_notify_std (GFC_STD_F2008_TS, "FORM TEAM statement at %C"))
return MATCH_ERROR;

if (gfc_match_char ('(') == MATCH_NO)
goto syntax;

new_st.op = EXEC_FORM_TEAM;

if (gfc_match ("%e", &teamid) != MATCH_YES)
goto syntax;
m = gfc_match_char (',');
if (m == MATCH_ERROR)
goto syntax;
if (gfc_match ("%e", &team) != MATCH_YES)
goto syntax;

m = gfc_match_char (')');
if (m == MATCH_NO)
goto syntax;

new_st.expr1 = teamid;
new_st.expr2 = team;

return MATCH_YES;

syntax:
gfc_syntax_error (ST_FORM_TEAM);

return MATCH_ERROR;
}

/* Match a CHANGE TEAM statement. */

match
gfc_match_change_team (void)
{
match m;
gfc_expr *team;

if (!gfc_notify_std (GFC_STD_F2008_TS, "CHANGE TEAM statement at %C"))
return MATCH_ERROR;

if (gfc_match_char ('(') == MATCH_NO)
goto syntax;

new_st.op = EXEC_CHANGE_TEAM;

if (gfc_match ("%e", &team) != MATCH_YES)
goto syntax;

m = gfc_match_char (')');
if (m == MATCH_NO)
goto syntax;

new_st.expr1 = team;

return MATCH_YES;

syntax:
gfc_syntax_error (ST_CHANGE_TEAM);

return MATCH_ERROR;
}

/* Match a END TEAM statement. */

match
gfc_match_end_team (void)
{
if (!gfc_notify_std (GFC_STD_F2008_TS, "END TEAM statement at %C"))
return MATCH_ERROR;

if (gfc_match_char ('(') == MATCH_YES)
goto syntax;

new_st.op = EXEC_END_TEAM;

return MATCH_YES;

syntax:
gfc_syntax_error (ST_END_TEAM);

return MATCH_ERROR;
}

/* Match a SYNC TEAM statement. */

match
gfc_match_sync_team (void)
{
match m;
gfc_expr *team;

if (!gfc_notify_std (GFC_STD_F2008_TS, "SYNC TEAM statement at %C"))
return MATCH_ERROR;

if (gfc_match_char ('(') == MATCH_NO)
goto syntax;

new_st.op = EXEC_SYNC_TEAM;

if (gfc_match ("%e", &team) != MATCH_YES)
goto syntax;

m = gfc_match_char (')');
if (m == MATCH_NO)
goto syntax;

new_st.expr1 = team;

return MATCH_YES;

syntax:
gfc_syntax_error (ST_SYNC_TEAM);

return MATCH_ERROR;
}

/* Match LOCK/UNLOCK statement. Syntax:
LOCK ( lock-variable [ , lock-stat-list ] )
Expand Down
6 changes: 3 additions & 3 deletions gcc/fortran/trans-decl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3360,7 +3360,7 @@ gfc_build_intrinsic_function_decls (void)
jtype = gfc_get_int_type (ikinds[jkind]);
if (itype && jtype)
{
sprintf (name, PREFIX("pow_i%d_i%d"), ikinds[ikind],
sprintf(name, PREFIX("pow_i%d_i%d"), ikinds[ikind],
ikinds[jkind]);
gfor_fndecl_math_powi[jkind][ikind].integer =
gfc_build_library_function_decl (get_identifier (name),
Expand All @@ -3375,7 +3375,7 @@ gfc_build_intrinsic_function_decls (void)
rtype = gfc_get_real_type (rkinds[rkind]);
if (rtype && itype)
{
sprintf (name, PREFIX("pow_r%d_i%d"), rkinds[rkind],
sprintf(name, PREFIX("pow_r%d_i%d"), rkinds[rkind],
ikinds[ikind]);
gfor_fndecl_math_powi[rkind][ikind].real =
gfc_build_library_function_decl (get_identifier (name),
Expand All @@ -3387,7 +3387,7 @@ gfc_build_intrinsic_function_decls (void)
ctype = gfc_get_complex_type (rkinds[rkind]);
if (ctype && itype)
{
sprintf (name, PREFIX("pow_c%d_i%d"), rkinds[rkind],
sprintf(name, PREFIX("pow_c%d_i%d"), rkinds[rkind],
ikinds[ikind]);
gfor_fndecl_math_powi[rkind][ikind].cmplx =
gfc_build_library_function_decl (get_identifier (name),
Expand Down
3 changes: 1 addition & 2 deletions gcc/fortran/trans-intrinsic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1850,7 +1850,7 @@ conv_caf_send (gfc_code *code) {
gfc_se lhs_se, rhs_se;
stmtblock_t block;
tree caf_decl, token, offset, image_index, tmp, lhs_kind, rhs_kind;
tree may_require_tmp, src_stat, dst_stat, dst_team;
tree may_require_tmp, src_stat, dst_stat;
tree lhs_type = NULL_TREE;
tree vec = null_pointer_node, rhs_vec = null_pointer_node;
symbol_attribute lhs_caf_attr, rhs_caf_attr;
Expand All @@ -1866,7 +1866,6 @@ conv_caf_send (gfc_code *code) {
lhs_caf_attr = gfc_caf_attr (lhs_expr);
rhs_caf_attr = gfc_caf_attr (rhs_expr);
src_stat = dst_stat = null_pointer_node;
dst_team = null_pointer_node;

/* LHS. */
gfc_init_se (&lhs_se, NULL);
Expand Down
104 changes: 0 additions & 104 deletions gcc/fortran/trans-stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,110 +696,6 @@ gfc_trans_fail_image (gfc_code *code ATTRIBUTE_UNUSED)
}
}

/* Translate the FORM TEAM statement. */

tree
gfc_trans_form_team (gfc_code *code)
{
if (flag_coarray == GFC_FCOARRAY_LIB)
{
gfc_se argse;
tree team_id,team_type;
gfc_init_se (&argse, NULL);
gfc_conv_expr_val (&argse, code->expr1);
team_id = fold_convert (integer_type_node, argse.expr);
gfc_init_se (&argse, NULL);
gfc_conv_expr_val (&argse, code->expr2);
team_type = gfc_build_addr_expr (ppvoid_type_node, argse.expr);

return build_call_expr_loc (input_location,
gfor_fndecl_caf_form_team, 3,
team_id, team_type,
build_int_cst (integer_type_node, 0));
}
else
{
const char *name = gfc_get_string (PREFIX ("exit_i%d"), 4);
gfc_symbol *exsym = gfc_get_intrinsic_sub_symbol (name);
tree tmp = gfc_get_symbol_decl (exsym);
return build_call_expr_loc (input_location, tmp, 1, integer_zero_node);
}
}

/* Translate the CHANGE TEAM statement. */

tree
gfc_trans_change_team (gfc_code *code)
{
if (flag_coarray == GFC_FCOARRAY_LIB)
{
gfc_se argse;
tree team_type;

gfc_init_se (&argse, NULL);
gfc_conv_expr_val (&argse, code->expr1);
team_type = gfc_build_addr_expr (ppvoid_type_node, argse.expr);

return build_call_expr_loc (input_location,
gfor_fndecl_caf_change_team, 2, team_type,
build_int_cst (integer_type_node, 0));
}
else
{
const char *name = gfc_get_string (PREFIX ("exit_i%d"), 4);
gfc_symbol *exsym = gfc_get_intrinsic_sub_symbol (name);
tree tmp = gfc_get_symbol_decl (exsym);
return build_call_expr_loc (input_location, tmp, 1, integer_zero_node);
}
}

/* Translate the END TEAM statement. */

tree
gfc_trans_end_team (gfc_code *code ATTRIBUTE_UNUSED)
{
if (flag_coarray == GFC_FCOARRAY_LIB)
{
return build_call_expr_loc (input_location,
gfor_fndecl_caf_end_team, 1,
build_int_cst (pchar_type_node, 0));
}
else
{
const char *name = gfc_get_string (PREFIX ("exit_i%d"), 4);
gfc_symbol *exsym = gfc_get_intrinsic_sub_symbol (name);
tree tmp = gfc_get_symbol_decl (exsym);
return build_call_expr_loc (input_location, tmp, 1, integer_zero_node);
}
}

/* Translate the SYNC TEAM statement. */

tree
gfc_trans_sync_team (gfc_code *code)
{
if (flag_coarray == GFC_FCOARRAY_LIB)
{
gfc_se argse;
tree team_type;

gfc_init_se (&argse, NULL);
gfc_conv_expr_val (&argse, code->expr1);
team_type = gfc_build_addr_expr (ppvoid_type_node, argse.expr);

return build_call_expr_loc (input_location,
gfor_fndecl_caf_sync_team, 2,
team_type,
build_int_cst (integer_type_node, 0));
}
else
{
const char *name = gfc_get_string (PREFIX ("exit_i%d"), 4);
gfc_symbol *exsym = gfc_get_intrinsic_sub_symbol (name);
tree tmp = gfc_get_symbol_decl (exsym);
return build_call_expr_loc (input_location, tmp, 1, integer_zero_node);
}
}

tree
gfc_trans_lock_unlock (gfc_code *code, gfc_exec_op op)
Expand Down

0 comments on commit 8826a41

Please sign in to comment.