+2016-03-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70376
+ * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
+ for OMP_TASKLOOP here.
+ (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
+ genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
+
2016-03-23 Alexandre Oliva <aoliva@redhat.com>
Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>
tree clab = begin_bc_block (bc_continue, locus);
cp_walk_tree (&OMP_FOR_BODY (stmt), cp_genericize_r, data, NULL);
- cp_walk_tree (&OMP_FOR_CLAUSES (stmt), cp_genericize_r, data, NULL);
+ if (TREE_CODE (stmt) != OMP_TASKLOOP)
+ cp_walk_tree (&OMP_FOR_CLAUSES (stmt), cp_genericize_r, data, NULL);
cp_walk_tree (&OMP_FOR_INIT (stmt), cp_genericize_r, data, NULL);
cp_walk_tree (&OMP_FOR_COND (stmt), cp_genericize_r, data, NULL);
cp_walk_tree (&OMP_FOR_INCR (stmt), cp_genericize_r, data, NULL);
if (TREE_CODE (d) == VAR_DECL)
gcc_assert (CP_DECL_THREAD_LOCAL_P (d) == DECL_THREAD_LOCAL_P (d));
}
- else if (TREE_CODE (stmt) == OMP_PARALLEL || TREE_CODE (stmt) == OMP_TASK)
+ else if (TREE_CODE (stmt) == OMP_PARALLEL
+ || TREE_CODE (stmt) == OMP_TASK
+ || TREE_CODE (stmt) == OMP_TASKLOOP)
{
struct cp_genericize_omp_taskreg omp_ctx;
tree c, decl;
default:
break;
}
- cp_walk_tree (&OMP_BODY (stmt), cp_genericize_r, data, NULL);
+ if (TREE_CODE (stmt) == OMP_TASKLOOP)
+ genericize_omp_for_stmt (stmt_p, walk_subtrees, data);
+ else
+ cp_walk_tree (&OMP_BODY (stmt), cp_genericize_r, data, NULL);
wtd->omp_ctx = omp_ctx.outer;
splay_tree_delete (omp_ctx.variables);
}
genericize_break_stmt (stmt_p);
else if (TREE_CODE (stmt) == OMP_FOR
|| TREE_CODE (stmt) == OMP_SIMD
- || TREE_CODE (stmt) == OMP_DISTRIBUTE
- || TREE_CODE (stmt) == OMP_TASKLOOP)
+ || TREE_CODE (stmt) == OMP_DISTRIBUTE)
genericize_omp_for_stmt (stmt_p, walk_subtrees, data);
else if ((flag_sanitize
& (SANITIZE_NULL | SANITIZE_ALIGNMENT | SANITIZE_VPTR))