aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-07-23 15:37:23 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-07-23 15:37:23 -0700
commitab8907ef75b71c987932a299bddf04cb73907c69 (patch)
tree6fa3fcbf916c4e6bd0c3081ee4de2cf5ae950925 /gcc/expr.c
parent5aa33bdb4f75939b9467a4580aa13bb6997f192c (diff)
downloadgcc-ab8907ef75b71c987932a299bddf04cb73907c69.zip
gcc-ab8907ef75b71c987932a299bddf04cb73907c69.tar.gz
gcc-ab8907ef75b71c987932a299bddf04cb73907c69.tar.bz2
expr.c (expand_expr_real_1): Don't handle non-local variables.
* expr.c (expand_expr_real_1): Don't handle non-local variables. * expr.h (fix_lexical_addr): Remove. * function.c (NEED_SEPARATE_AP): Remove. (fix_lexical_addr): Remove. * tree-alias-common.c (get_alias_var_decl): Check TREE_STATIC, not null decl_function_context. (create_alias_vars): Likewise. * tree-cfg.c (make_ctrl_stmt_edges): Don't check for non-local labels. (simple_goto_p): Likewise. * tree-dfa.c (add_referenced_var): Don't check for non-local variables. * tree-ssa-ccp.c (get_default_value): Likewise. * tree-tailcall.c (suitable_for_tail_opt_p): Likewise. * tree.c (needs_to_live_in_memory): Likewise. * tree-flow-inline.h (may_be_aliased): Move... * tree-ssa-alias.c (may_be_aliased): ... here. Enhance check for when TREE_STATIC variables may be addressable. From-SVN: r85099
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index d8ab443..b3ef3ef 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6368,33 +6368,15 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* Show we haven't gotten RTL for this yet. */
temp = 0;
- /* Handle variables inherited from containing functions. */
+ /* Variables inherited from containing functions should have
+ been lowered by this point. */
context = decl_function_context (exp);
-
- if (context != 0 && context != current_function_decl
- /* If var is static, we don't need a static chain to access it. */
- && ! (MEM_P (DECL_RTL (exp))
- && CONSTANT_P (XEXP (DECL_RTL (exp), 0))))
- {
- rtx addr;
-
- /* Mark as non-local and addressable. */
- DECL_NONLOCAL (exp) = 1;
- if (DECL_NO_STATIC_CHAIN (current_function_decl))
- abort ();
- lang_hooks.mark_addressable (exp);
- if (!MEM_P (DECL_RTL (exp)))
- abort ();
- addr = XEXP (DECL_RTL (exp), 0);
- if (MEM_P (addr))
- addr
- = replace_equiv_address (addr,
- fix_lexical_addr (XEXP (addr, 0), exp));
- else
- addr = fix_lexical_addr (addr, exp);
-
- temp = replace_equiv_address (DECL_RTL (exp), addr);
- }
+ if (context != 0
+ && context != current_function_decl
+ && !TREE_STATIC (exp)
+ /* ??? C++ creates functions that are not TREE_STATIC. */
+ && TREE_CODE (exp) != FUNCTION_DECL)
+ abort ();
/* This is the case of an array whose size is to be determined
from its initializer, while the initializer is still being parsed.