[tuples] fix omp reduction clauses
Aldy Hernandez
aldyh@redhat.com
Wed May 21 07:24:00 GMT 2008
This patch creates the __builtin_gomp_atomic_{start,end} gimplified code
directly instead of going through the gimplifier. But most importantly,
this patch fixes a concatenation problem where we had swapped the
arguments.
2 down. 16 to go.
Applied to branch.
* omp-low.c (lower_reduction_clauses): Generate OMP_ATOMIC_* directly.
Concatenate atomic code correctly.
Index: omp-low.c
===================================================================
--- omp-low.c (revision 135688)
+++ omp-low.c (working copy)
@@ -2001,6 +2001,7 @@ static void
lower_reduction_clauses (tree clauses, gimple_seq *stmt_seqp, omp_context *ctx)
{
gimple_seq sub_seq = NULL;
+ gimple stmt;
tree x, c;
int count = 0;
@@ -2074,13 +2075,13 @@ lower_reduction_clauses (tree clauses, g
}
}
- x = build_call_expr (built_in_decls[BUILT_IN_GOMP_ATOMIC_START], 0);
- gimplify_and_add (x, stmt_seqp);
+ stmt = gimple_build_call (built_in_decls[BUILT_IN_GOMP_ATOMIC_START], 0);
+ gimple_seq_add_stmt (stmt_seqp, stmt);
- gimple_seq_add_seq (&sub_seq, *stmt_seqp);
+ gimple_seq_add_seq (stmt_seqp, sub_seq);
- x = build_call_expr (built_in_decls[BUILT_IN_GOMP_ATOMIC_END], 0);
- gimplify_and_add (x, stmt_seqp);
+ stmt = gimple_build_call (built_in_decls[BUILT_IN_GOMP_ATOMIC_END], 0);
+ gimple_seq_add_stmt (stmt_seqp, stmt);
}
More information about the Gcc-patches
mailing list