diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2003-05-07 21:14:48 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2003-05-07 21:14:48 +0000 |
commit | 046e4e367e33c781229e0f33b936f8c64aa25dc1 (patch) | |
tree | 3614f193205349c343ee4e569d08b222253384a4 /gcc/expr.c | |
parent | 9d70d418dbe366666be1ec6501d93cf2b661e1a0 (diff) | |
download | gcc-046e4e367e33c781229e0f33b936f8c64aa25dc1.zip gcc-046e4e367e33c781229e0f33b936f8c64aa25dc1.tar.gz gcc-046e4e367e33c781229e0f33b936f8c64aa25dc1.tar.bz2 |
stmt.c (force_label_rtx): New function, based on logic formerly found in expand_expr.
* stmt.c (force_label_rtx): New function, based on logic
formerly found in expand_expr.
* expr.h: Prototype it.
* expr.c (expand_expr <LABEL_DECL>): Use force_label_rtx if
appropriate.
* varasm.c (decode_addr_const <LABEL_DECL>): Use force_label_rtx.
* print-tree.c (debug_tree): Free the table after we're done
with it. Use putc.
treelang:
* Make-lang.in: Set -Wno-error for treelang/lex.o.
From-SVN: r66579
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 26 |
1 files changed, 9 insertions, 17 deletions
@@ -6753,25 +6753,17 @@ expand_expr (exp, target, tmode, modifier) case LABEL_DECL: { tree function = decl_function_context (exp); - /* Handle using a label in a containing function. */ - if (function != current_function_decl - && function != inline_function_decl && function != 0) - { - struct function *p = find_function_data (function); - p->expr->x_forced_labels - = gen_rtx_EXPR_LIST (VOIDmode, label_rtx (exp), - p->expr->x_forced_labels); - } + /* Labels in containing functions, or labels used from initializers, + must be forced. */ + if (modifier == EXPAND_INITIALIZER + || (function != current_function_decl + && function != inline_function_decl + && function != 0)) + temp = force_label_rtx (exp); else - { - if (modifier == EXPAND_INITIALIZER) - forced_labels = gen_rtx_EXPR_LIST (VOIDmode, - label_rtx (exp), - forced_labels); - } + temp = label_rtx (exp); - temp = gen_rtx_MEM (FUNCTION_MODE, - gen_rtx_LABEL_REF (Pmode, label_rtx (exp))); + temp = gen_rtx_MEM (FUNCTION_MODE, gen_rtx_LABEL_REF (Pmode, temp)); if (function != current_function_decl && function != inline_function_decl && function != 0) LABEL_REF_NONLOCAL_P (XEXP (temp, 0)) = 1; |