2019-01-24 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/89015
+ * tree-nested.c (convert_nonlocal_reference_stmt,
+ convert_local_reference_stmt, convert_tramp_reference_stmt,
+ convert_gimple_call) <case GIMPLE_OMP_TEAMS>: Treat
+ gimple_omp_teams_host teams stmts like GIMPLE_OMP_PARALLEL
+ or GIMPLE_OMP_TASK.
+
PR tree-optimization/89027
* tree-inline.c (add_clobbers_to_eh_landing_pad): Don't add clobbers
for "omp simd array" variables.
}
break;
+ case GIMPLE_OMP_TEAMS:
+ if (!gimple_omp_teams_host (as_a <gomp_teams *> (stmt)))
+ {
+ save_suppress = info->suppress_expansion;
+ convert_nonlocal_omp_clauses (gimple_omp_teams_clauses_ptr (stmt),
+ wi);
+ walk_body (convert_nonlocal_reference_stmt,
+ convert_nonlocal_reference_op, info,
+ gimple_omp_body_ptr (stmt));
+ info->suppress_expansion = save_suppress;
+ break;
+ }
+ /* FALLTHRU */
+
case GIMPLE_OMP_PARALLEL:
case GIMPLE_OMP_TASK:
save_suppress = info->suppress_expansion;
info->suppress_expansion = save_suppress;
break;
- case GIMPLE_OMP_TEAMS:
- save_suppress = info->suppress_expansion;
- convert_nonlocal_omp_clauses (gimple_omp_teams_clauses_ptr (stmt), wi);
- walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
- info, gimple_omp_body_ptr (stmt));
- info->suppress_expansion = save_suppress;
- break;
-
case GIMPLE_OMP_SECTION:
case GIMPLE_OMP_MASTER:
case GIMPLE_OMP_ORDERED:
switch (gimple_code (stmt))
{
+ case GIMPLE_OMP_TEAMS:
+ if (!gimple_omp_teams_host (as_a <gomp_teams *> (stmt)))
+ {
+ save_suppress = info->suppress_expansion;
+ convert_local_omp_clauses (gimple_omp_teams_clauses_ptr (stmt), wi);
+ walk_body (convert_local_reference_stmt, convert_local_reference_op,
+ info, gimple_omp_body_ptr (stmt));
+ info->suppress_expansion = save_suppress;
+ break;
+ }
+ /* FALLTHRU */
+
case GIMPLE_OMP_PARALLEL:
case GIMPLE_OMP_TASK:
save_suppress = info->suppress_expansion;
info->static_chain_added |= save_static_chain_added;
break;
- case GIMPLE_OMP_TEAMS:
- save_suppress = info->suppress_expansion;
- convert_local_omp_clauses (gimple_omp_teams_clauses_ptr (stmt), wi);
- walk_body (convert_local_reference_stmt, convert_local_reference_op,
- info, gimple_omp_body_ptr (stmt));
- info->suppress_expansion = save_suppress;
- break;
-
case GIMPLE_OMP_SECTION:
case GIMPLE_OMP_MASTER:
case GIMPLE_OMP_ORDERED:
break;
}
+ case GIMPLE_OMP_TEAMS:
+ if (!gimple_omp_teams_host (as_a <gomp_teams *> (stmt)))
+ {
+ *handled_ops_p = false;
+ return NULL_TREE;
+ }
+ goto do_parallel;
+
case GIMPLE_OMP_TARGET:
if (!is_gimple_omp_offloaded (stmt))
{
/* FALLTHRU */
case GIMPLE_OMP_PARALLEL:
case GIMPLE_OMP_TASK:
+ do_parallel:
{
tree save_local_var_chain = info->new_local_var_chain;
walk_gimple_op (stmt, convert_tramp_reference_op, wi);
}
break;
+ case GIMPLE_OMP_TEAMS:
+ if (!gimple_omp_teams_host (as_a <gomp_teams *> (stmt)))
+ {
+ walk_body (convert_gimple_call, NULL, info,
+ gimple_omp_body_ptr (stmt));
+ break;
+ }
+ /* FALLTHRU */
+
case GIMPLE_OMP_PARALLEL:
case GIMPLE_OMP_TASK:
save_static_chain_added = info->static_chain_added;
case GIMPLE_OMP_SECTIONS:
case GIMPLE_OMP_SECTION:
case GIMPLE_OMP_SINGLE:
- case GIMPLE_OMP_TEAMS:
case GIMPLE_OMP_MASTER:
case GIMPLE_OMP_TASKGROUP:
case GIMPLE_OMP_ORDERED: