diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-03-22 20:25:36 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-03-22 20:25:36 +0100 |
commit | c140ddf3923d59603aa2ceb834085ab159b77972 (patch) | |
tree | 939527349ade70d1f8b4bee64cb898cba3de8246 /gcc/tree-nested.c | |
parent | e75b54a2d932929a9b2e940c5aad1ef33a86c008 (diff) | |
download | gcc-c140ddf3923d59603aa2ceb834085ab159b77972.zip gcc-c140ddf3923d59603aa2ceb834085ab159b77972.tar.gz gcc-c140ddf3923d59603aa2ceb834085ab159b77972.tar.bz2 |
re PR middle-end/52547 (ICE with openmp with nested function which requires a trampoline)
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.
* testsuite/libgomp.c/pr52547.c: New test.
From-SVN: r185707
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r-- | gcc/tree-nested.c | 24 |
1 files changed, 21 insertions, 3 deletions
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; } |