diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-nested.c | 24 |
2 files changed, 28 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3dde73b..c27c721 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-03-22 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/52547 + * tree-nested.c (convert_tramp_reference_stmt): Call declare_vars + on any new_local_var_chain vars declared during recursing on + GIMPLE_OMP_PARALLEL or GIMPLE_OMP_TASK body. + 2012-03-22 Uros Bizjak <ubizjak@gmail.com> * config/alpha/alpha.h (ASM_OUTPUT_ALIGN): Move to config/alpha/elf.h diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c index ae3a8dd..8851f3c 100644 --- a/gcc/tree-nested.c +++ b/gcc/tree-nested.c @@ -1954,6 +1954,7 @@ static tree convert_tramp_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, struct walk_stmt_info *wi) { + struct nesting_info *info = (struct nesting_info *) wi->info; gimple stmt = gsi_stmt (*gsi); switch (gimple_code (stmt)) @@ -1966,16 +1967,33 @@ convert_tramp_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, for (i = 0; i < nargs; i++) walk_tree (gimple_call_arg_ptr (stmt, i), convert_tramp_reference_op, wi, NULL); + break; + } - *handled_ops_p = true; - return NULL_TREE; + case GIMPLE_OMP_PARALLEL: + case GIMPLE_OMP_TASK: + { + tree save_local_var_chain; + walk_gimple_op (stmt, convert_tramp_reference_op, wi); + save_local_var_chain = info->new_local_var_chain; + info->new_local_var_chain = NULL; + walk_body (convert_tramp_reference_stmt, convert_tramp_reference_op, + info, gimple_omp_body (stmt)); + if (info->new_local_var_chain) + declare_vars (info->new_local_var_chain, + gimple_seq_first_stmt (gimple_omp_body (stmt)), + false); + info->new_local_var_chain = save_local_var_chain; } + break; default: + *handled_ops_p = false; + return NULL_TREE; break; } - *handled_ops_p = false; + *handled_ops_p = true; return NULL_TREE; } |