This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tuples] fix omp reduction clauses
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: dnovillo at google dot com, gcc-patches at gcc dot gnu dot org
- Date: Wed, 21 May 2008 00:26:13 -0400
- Subject: [tuples] fix omp reduction clauses
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);
}