summaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-05 17:26:05 +0000
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-05 17:26:05 +0000
commit35cc02b5c80ac6738c1a3362a822e3d7e4d0c587 (patch)
tree32d3ee1ddfcad180d619d756a84eeb0df779a6a2 /gcc/omp-low.c
parentfc297ba47e780c3659434d04f3c299b705154d5f (diff)
downloadgcc-35cc02b5c80ac6738c1a3362a822e3d7e4d0c587.tar.gz
Merge gimple-tuples-branch into mainline.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119546 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c73
1 files changed, 37 insertions, 36 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index f58ee1f1b6f..625ac374967 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -157,11 +157,11 @@ extract_omp_for_data (tree for_stmt, struct omp_for_data *fd)
fd->pre = NULL;
t = OMP_FOR_INIT (for_stmt);
- gcc_assert (TREE_CODE (t) == MODIFY_EXPR);
- fd->v = TREE_OPERAND (t, 0);
+ gcc_assert (TREE_CODE (t) == GIMPLE_MODIFY_STMT);
+ fd->v = GIMPLE_STMT_OPERAND (t, 0);
gcc_assert (DECL_P (fd->v));
gcc_assert (TREE_CODE (TREE_TYPE (fd->v)) == INTEGER_TYPE);
- fd->n1 = TREE_OPERAND (t, 1);
+ fd->n1 = GIMPLE_STMT_OPERAND (t, 1);
t = OMP_FOR_COND (for_stmt);
fd->cond_code = TREE_CODE (t);
@@ -187,9 +187,9 @@ extract_omp_for_data (tree for_stmt, struct omp_for_data *fd)
}
t = OMP_FOR_INCR (fd->for_stmt);
- gcc_assert (TREE_CODE (t) == MODIFY_EXPR);
- gcc_assert (TREE_OPERAND (t, 0) == fd->v);
- t = TREE_OPERAND (t, 1);
+ gcc_assert (TREE_CODE (t) == GIMPLE_MODIFY_STMT);
+ gcc_assert (GIMPLE_STMT_OPERAND (t, 0) == fd->v);
+ t = GIMPLE_STMT_OPERAND (t, 1);
gcc_assert (TREE_OPERAND (t, 0) == fd->v);
switch (TREE_CODE (t))
{
@@ -1680,7 +1680,7 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
x = built_in_decls[BUILT_IN_ALLOCA];
x = build_function_call_expr (x, args);
x = fold_convert (TREE_TYPE (ptr), x);
- x = build2 (MODIFY_EXPR, void_type_node, ptr, x);
+ x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ptr, x);
gimplify_and_add (x, ilist);
}
else if (is_reference (var))
@@ -1716,7 +1716,7 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
x = fold_convert (TREE_TYPE (new_var), x);
}
- x = build2 (MODIFY_EXPR, void_type_node, new_var, x);
+ x = build2 (GIMPLE_MODIFY_STMT, void_type_node, new_var, x);
gimplify_and_add (x, ilist);
new_var = build_fold_indirect_ref (new_var);
@@ -1799,7 +1799,7 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
{
x = omp_reduction_init (c, TREE_TYPE (new_var));
gcc_assert (TREE_CODE (TREE_TYPE (new_var)) != ARRAY_TYPE);
- x = build2 (MODIFY_EXPR, void_type_node, new_var, x);
+ x = build2 (GIMPLE_MODIFY_STMT, void_type_node, new_var, x);
gimplify_and_add (x, ilist);
}
break;
@@ -1964,7 +1964,7 @@ lower_reduction_clauses (tree clauses, tree *stmt_list, omp_context *ctx)
{
x = build2 (code, TREE_TYPE (ref), ref, new_var);
ref = build_outer_var_ref (var, ctx);
- x = build2 (MODIFY_EXPR, void_type_node, ref, x);
+ x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ref, x);
append_to_statement_list (x, &sub_list);
}
}
@@ -2003,7 +2003,7 @@ lower_copyprivate_clauses (tree clauses, tree *slist, tree *rlist,
ref = build_sender_ref (var, ctx);
x = (ctx->is_nested) ? lookup_decl_in_outer_ctx (var, ctx) : var;
x = by_ref ? build_fold_addr_expr (x) : x;
- x = build2 (MODIFY_EXPR, void_type_node, ref, x);
+ x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ref, x);
gimplify_and_add (x, slist);
ref = build_receiver_ref (var, by_ref, ctx);
@@ -2084,14 +2084,14 @@ lower_send_clauses (tree clauses, tree *ilist, tree *olist, omp_context *ctx)
{
ref = build_sender_ref (val, ctx);
x = by_ref ? build_fold_addr_expr (var) : var;
- x = build2 (MODIFY_EXPR, void_type_node, ref, x);
+ x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ref, x);
gimplify_and_add (x, ilist);
}
if (do_out)
{
ref = build_sender_ref (val, ctx);
- x = build2 (MODIFY_EXPR, void_type_node, var, ref);
+ x = build2 (GIMPLE_MODIFY_STMT, void_type_node, var, ref);
gimplify_and_add (x, olist);
}
}
@@ -2128,17 +2128,17 @@ lower_send_shared_vars (tree *ilist, tree *olist, omp_context *ctx)
{
x = build_sender_ref (ovar, ctx);
var = build_fold_addr_expr (var);
- x = build2 (MODIFY_EXPR, void_type_node, x, var);
+ x = build2 (GIMPLE_MODIFY_STMT, void_type_node, x, var);
gimplify_and_add (x, ilist);
}
else
{
x = build_sender_ref (ovar, ctx);
- x = build2 (MODIFY_EXPR, void_type_node, x, var);
+ x = build2 (GIMPLE_MODIFY_STMT, void_type_node, x, var);
gimplify_and_add (x, ilist);
x = build_sender_ref (ovar, ctx);
- x = build2 (MODIFY_EXPR, void_type_node, var, x);
+ x = build2 (GIMPLE_MODIFY_STMT, void_type_node, var, x);
gimplify_and_add (x, olist);
}
}
@@ -2236,13 +2236,13 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
si = bsi_start (then_bb);
t = build1 (LABEL_EXPR, void_type_node, then_lab);
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
- t = build2 (MODIFY_EXPR, void_type_node, tmp, val);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp, val);
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
si = bsi_start (else_bb);
t = build1 (LABEL_EXPR, void_type_node, else_lab);
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
- t = build2 (MODIFY_EXPR, void_type_node, tmp,
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp,
build_int_cst (unsigned_type_node, 1));
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
@@ -2483,19 +2483,20 @@ expand_omp_parallel (struct omp_region *region)
gcc_assert (!bsi_end_p (si));
stmt = bsi_stmt (si);
- if (TREE_CODE (stmt) != MODIFY_EXPR)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
continue;
- arg = TREE_OPERAND (stmt, 1);
+ arg = GIMPLE_STMT_OPERAND (stmt, 1);
STRIP_NOPS (arg);
if (TREE_CODE (arg) == ADDR_EXPR
&& TREE_OPERAND (arg, 0)
== OMP_PARALLEL_DATA_ARG (entry_stmt))
{
- if (TREE_OPERAND (stmt, 0) == DECL_ARGUMENTS (child_fn))
+ if (GIMPLE_STMT_OPERAND (stmt, 0)
+ == DECL_ARGUMENTS (child_fn))
bsi_remove (&si, true);
else
- TREE_OPERAND (stmt, 1) = DECL_ARGUMENTS (child_fn);
+ GIMPLE_STMT_OPERAND (stmt, 1) = DECL_ARGUMENTS (child_fn);
break;
}
}
@@ -2651,11 +2652,11 @@ expand_omp_for_generic (struct omp_region *region,
/* Iteration setup for sequential loop goes in L0_BB. */
list = alloc_stmt_list ();
t = fold_convert (type, istart0);
- t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
gimplify_and_add (t, &list);
t = fold_convert (type, iend0);
- t = build2 (MODIFY_EXPR, void_type_node, iend, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, iend, t);
gimplify_and_add (t, &list);
si = bsi_start (l0_bb);
@@ -2677,7 +2678,7 @@ expand_omp_for_generic (struct omp_region *region,
list = alloc_stmt_list ();
t = build2 (PLUS_EXPR, type, fd->v, fd->step);
- t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
gimplify_and_add (t, &list);
t = build2 (fd->cond_code, boolean_type_node, fd->v, iend);
@@ -2856,7 +2857,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
t = fold_convert (type, s0);
t = build2 (MULT_EXPR, type, t, fd->step);
t = build2 (PLUS_EXPR, type, t, fd->n1);
- t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
gimplify_and_add (t, &list);
t = fold_convert (type, e0);
@@ -2871,7 +2872,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
list = alloc_stmt_list ();
t = build2 (PLUS_EXPR, type, fd->v, fd->step);
- t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
gimplify_and_add (t, &list);
t = build2 (fd->cond_code, boolean_type_node, fd->v, e);
@@ -3040,7 +3041,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
t = fold_convert (type, s0);
t = build2 (MULT_EXPR, type, t, fd->step);
t = build2 (PLUS_EXPR, type, t, fd->n1);
- t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
gimplify_and_add (t, &list);
t = fold_convert (type, e0);
@@ -3056,7 +3057,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
list = alloc_stmt_list ();
t = build2 (PLUS_EXPR, type, fd->v, fd->step);
- t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
gimplify_and_add (t, &list);
t = build2 (fd->cond_code, boolean_type_node, fd->v, e);
@@ -3075,7 +3076,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
t = build_int_cst (type, 1);
t = build2 (PLUS_EXPR, type, trip, t);
- t = build2 (MODIFY_EXPR, void_type_node, trip, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, trip, t);
gimplify_and_add (t, &list);
si = bsi_start (trip_update_bb);
@@ -3224,7 +3225,7 @@ expand_omp_sections (struct omp_region *region)
t = tree_cons (NULL, t, NULL);
u = built_in_decls[BUILT_IN_GOMP_SECTIONS_START];
t = build_function_call_expr (u, t);
- t = build2 (MODIFY_EXPR, void_type_node, v, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, v, t);
bsi_insert_after (&si, t, BSI_SAME_STMT);
}
bsi_remove (&si, true);
@@ -3293,7 +3294,7 @@ expand_omp_sections (struct omp_region *region)
t = built_in_decls[BUILT_IN_GOMP_SECTIONS_NEXT];
t = build_function_call_expr (t, NULL);
- t = build2 (MODIFY_EXPR, void_type_node, v, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, v, t);
bsi_insert_after (&si, t, BSI_SAME_STMT);
bsi_remove (&si, true);
}
@@ -3731,7 +3732,7 @@ lower_omp_single_copy (tree single_stmt, tree *pre_p, omp_context *ctx)
t = built_in_decls[BUILT_IN_GOMP_SINGLE_COPY_START];
t = build_function_call_expr (t, NULL);
t = fold_convert (ptr_type, t);
- t = build2 (MODIFY_EXPR, void_type_node, ctx->receiver_decl, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, ctx->receiver_decl, t);
gimplify_and_add (t, pre_p);
t = build2 (EQ_EXPR, boolean_type_node, ctx->receiver_decl,
@@ -4048,7 +4049,7 @@ lower_omp_for (tree *stmt_p, omp_context *ctx)
We just need to make sure that VAL1, VAL2 and VAL3 are lowered
using the .omp_data_s mapping, if needed. */
- rhs_p = &TREE_OPERAND (OMP_FOR_INIT (stmt), 1);
+ rhs_p = &GIMPLE_STMT_OPERAND (OMP_FOR_INIT (stmt), 1);
if (!is_gimple_min_invariant (*rhs_p))
*rhs_p = get_formal_tmp_var (*rhs_p, body_p);
@@ -4056,7 +4057,7 @@ lower_omp_for (tree *stmt_p, omp_context *ctx)
if (!is_gimple_min_invariant (*rhs_p))
*rhs_p = get_formal_tmp_var (*rhs_p, body_p);
- rhs_p = &TREE_OPERAND (TREE_OPERAND (OMP_FOR_INCR (stmt), 1), 1);
+ rhs_p = &TREE_OPERAND (GIMPLE_STMT_OPERAND (OMP_FOR_INCR (stmt), 1), 1);
if (!is_gimple_min_invariant (*rhs_p))
*rhs_p = get_formal_tmp_var (*rhs_p, body_p);
@@ -4144,7 +4145,7 @@ lower_omp_parallel (tree *stmt_p, omp_context *ctx)
t = build_fold_addr_expr (ctx->sender_decl);
/* fixup_child_record_type might have changed receiver_decl's type. */
t = fold_convert (TREE_TYPE (ctx->receiver_decl), t);
- t = build2 (MODIFY_EXPR, void_type_node, ctx->receiver_decl, t);
+ t = build2 (GIMPLE_MODIFY_STMT, void_type_node, ctx->receiver_decl, t);
append_to_statement_list (t, &new_body);
}