aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-nested.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2006-06-13 08:55:40 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2006-06-13 08:55:40 +0000
commit5123ad0975a0a439b6c97670beb1125a7f929d8f (patch)
tree05d681245e58a72d16cb2087bd700186752c60c2 /gcc/tree-nested.c
parent6f2ba390aeb310887314db61d9c4876ac7801474 (diff)
downloadgcc-5123ad0975a0a439b6c97670beb1125a7f929d8f.zip
gcc-5123ad0975a0a439b6c97670beb1125a7f929d8f.tar.gz
gcc-5123ad0975a0a439b6c97670beb1125a7f929d8f.tar.bz2
re PR debug/26754 (Wrong debug info for variable accessed non-locally)
PR debug/26754 * gimplify.c (declare_tmp_vars): Rename into declare_vars. Add debug_info parameter. Chain the vars to the BLOCK instead of the BIND_EXPR if debug info are requested for them. (pop_gimplify_context): Adjust for above change. (gimple_add_tmp_var): Likewise. * tree-gimple.h (declare_tmp_vars): Rename into declare_vars. Add bool parameter. * tree-nested.c (convert_nonlocal_reference): Adjust for above change. (convert_local_reference): Likewise. (get_local_debug_decl): Set DECL_IGNORED_P on the original variable. (finalize_nesting_tree_1): Request that debug info be emitted for debug_var_chain. From-SVN: r114605
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r--gcc/tree-nested.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 8866819..67a13c2 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -1048,7 +1048,7 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
walk_body (convert_nonlocal_reference, info, &OMP_PARALLEL_BODY (t));
if (info->new_local_var_chain)
- declare_tmp_vars (info->new_local_var_chain, OMP_PARALLEL_BODY (t));
+ declare_vars (info->new_local_var_chain, OMP_PARALLEL_BODY (t), false);
info->new_local_var_chain = save_local_var_chain;
info->suppress_expansion = save_suppress;
break;
@@ -1186,6 +1186,9 @@ get_local_debug_decl (struct nesting_info *info, tree decl, tree field)
TREE_CHAIN (new_decl) = info->debug_var_chain;
info->debug_var_chain = new_decl;
+ /* Do not emit debug info twice. */
+ DECL_IGNORED_P (decl) = 1;
+
return new_decl;
}
@@ -1331,7 +1334,7 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
walk_body (convert_local_reference, info, &OMP_PARALLEL_BODY (t));
if (info->new_local_var_chain)
- declare_tmp_vars (info->new_local_var_chain, OMP_PARALLEL_BODY (t));
+ declare_vars (info->new_local_var_chain, OMP_PARALLEL_BODY (t), false);
info->new_local_var_chain = save_local_var_chain;
info->suppress_expansion = save_suppress;
break;
@@ -1804,11 +1807,11 @@ finalize_nesting_tree_1 (struct nesting_info *root)
/* Make sure all new local variables get inserted into the
proper BIND_EXPR. */
if (root->new_local_var_chain)
- declare_tmp_vars (root->new_local_var_chain,
- DECL_SAVED_TREE (root->context));
+ declare_vars (root->new_local_var_chain, DECL_SAVED_TREE (root->context),
+ false);
if (root->debug_var_chain)
- declare_tmp_vars (root->debug_var_chain,
- DECL_SAVED_TREE (root->context));
+ declare_vars (root->debug_var_chain, DECL_SAVED_TREE (root->context),
+ true);
/* Dump the translated tree function. */
dump_function (TDI_nested, root->context);