aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-nested.c
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2005-05-25 21:36:24 +0000
committerJeff Law <law@gcc.gnu.org>2005-05-25 15:36:24 -0600
commit81fc305201e8913727cb61303c4812730a95c59c (patch)
tree97fb8429916e88ae81fa00fe312809a322531099 /gcc/tree-nested.c
parent3d0994b83115f9da0a1e454c3693e0d93771cac3 (diff)
downloadgcc-81fc305201e8913727cb61303c4812730a95c59c.zip
gcc-81fc305201e8913727cb61303c4812730a95c59c.tar.gz
gcc-81fc305201e8913727cb61303c4812730a95c59c.tar.bz2
tree-cfg.c (verify_expr, [...]): Verify invariant, constant and side_effects of the ADDR_EXPR are consistent.
* tree-cfg.c (verify_expr, case ADDR_EXPR): Verify invariant, constant and side_effects of the ADDR_EXPR are consistent. * tree-nested.c (convert_local_reference): Set CURRENT_FUNCTION_DECL appropriately around calls to recompute_tree_invarant_for_addr_expr. Co-Authored-By: Jeff Law <law@redhat.com> From-SVN: r100168
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r--gcc/tree-nested.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 124bbf9..2f9985d 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -871,9 +871,14 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
if (wi->changed)
{
+ tree save_context;
+
/* If we changed anything, then TREE_INVARIANT is be wrong,
since we're no longer directly referencing a decl. */
+ save_context = current_function_decl;
+ current_function_decl = info->context;
recompute_tree_invarant_for_addr_expr (t);
+ current_function_decl = save_context;
/* If the callback converted the address argument in a context
where we only accept variables (and min_invariant, presumably),
@@ -996,10 +1001,15 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
/* If we converted anything ... */
if (wi->changed)
{
+ tree save_context;
+
/* Then the frame decl is now addressable. */
TREE_ADDRESSABLE (info->frame_decl) = 1;
+ save_context = current_function_decl;
+ current_function_decl = info->context;
recompute_tree_invarant_for_addr_expr (t);
+ current_function_decl = save_context;
/* If we are in a context where we only accept values, then
compute the address into a temporary. */