From 87ed0134d982ea4a876c3f179a6a83eec22dc1a9 Mon Sep 17 00:00:00 2001 From: rth Date: Sat, 7 Oct 2000 01:46:42 +0000 Subject: [PATCH 1/1] * cp/cp-tree.h (struct cp_language_function): Remove x_result_rtx. (original_result_rtx): Remove. * cp/decl.c (save_function_data): Don't clear x_result_rtx. (mark_lang_function): Don't mark it either. * cp/expr.c (fixup_result_decl): Remove. * cp/semantics.c (genrtl_named_return_value): Frob the return decl before calling emit_local_var. (genrtl_finish_function): Don't call fixup_result_decl. Always emit the jump to return_label. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36770 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 12 ++++++++++++ gcc/cp/cp-tree.h | 10 ---------- gcc/cp/decl.c | 3 --- gcc/cp/expr.c | 30 ------------------------------ gcc/cp/semantics.c | 19 +++++-------------- 5 files changed, 17 insertions(+), 57 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ef328907259..e7fdacea402 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,15 @@ +2000-10-06 Richard Henderson + + * cp-tree.h (struct cp_language_function): Remove x_result_rtx. + (original_result_rtx): Remove. + * decl.c (save_function_data): Don't clear x_result_rtx. + (mark_lang_function): Don't mark it either. + * expr.c (fixup_result_decl): Remove. + * semantics.c (genrtl_named_return_value): Frob the return decl + before calling emit_local_var. + (genrtl_finish_function): Don't call fixup_result_decl. + Always emit the jump to return_label. + 2000-10-06 Nathan Sidwell * pt.c (lookup_template_class): Set current access for enum. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 1156495f22b..1a6c5184817 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -882,8 +882,6 @@ struct cp_language_function tree *x_vcalls_possible_p; - struct rtx_def *x_result_rtx; - int returns_value; int returns_null; int in_function_try_handler; @@ -963,13 +961,6 @@ struct cp_language_function #define doing_semantic_analysis_p() (!expanding_p) -/* If original DECL_RESULT of current function was a register, - but due to being an addressable named return value, would up - on the stack, this variable holds the named return value's - original location. */ - -#define original_result_rtx cp_function_chain->x_result_rtx - #define in_function_try_handler cp_function_chain->in_function_try_handler /* Nonzero if __FUNCTION__ and its ilk have been declared in this @@ -4042,7 +4033,6 @@ extern void check_handlers PARAMS ((tree)); /* in expr.c */ extern void init_cplus_expand PARAMS ((void)); -extern void fixup_result_decl PARAMS ((tree, struct rtx_def *)); extern int extract_init PARAMS ((tree, tree)); extern tree cplus_expand_constant PARAMS ((tree)); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d467f5a5f1b..82ebc36af0e 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -13992,7 +13992,6 @@ save_function_data (decl) /* Clear out the bits we don't need. */ f->base.x_stmt_tree.x_last_stmt = NULL_TREE; f->base.x_stmt_tree.x_last_expr_type = NULL_TREE; - f->x_result_rtx = NULL_RTX; f->x_named_label_uses = NULL; f->bindings = NULL; @@ -14631,8 +14630,6 @@ mark_lang_function (p) ggc_mark_tree (p->x_current_class_ref); ggc_mark_tree (p->x_eh_spec_try_block); - ggc_mark_rtx (p->x_result_rtx); - mark_named_label_lists (&p->x_named_labels, &p->x_named_label_uses); mark_binding_level (&p->bindings); } diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index c49a2f93583..918e54dbb0f 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -148,36 +148,6 @@ init_cplus_expand () lang_expand_constant = cplus_expand_constant; } -/* If DECL had its rtl moved from where callers expect it - to be, fix it up. RESULT is the nominal rtl for the RESULT_DECL, - which may be a pseudo instead of a hard register. */ - -void -fixup_result_decl (decl, result) - tree decl; - rtx result; -{ - if (REG_P (result)) - { - if (REGNO (result) >= FIRST_PSEUDO_REGISTER) - { - rtx real_decl_result; - -#ifdef FUNCTION_OUTGOING_VALUE - real_decl_result - = FUNCTION_OUTGOING_VALUE (TREE_TYPE (decl), current_function_decl); -#else - real_decl_result - = FUNCTION_VALUE (TREE_TYPE (decl), current_function_decl); -#endif - REG_FUNCTION_VALUE_P (real_decl_result) = 1; - result = real_decl_result; - } - store_expr (decl, result, 0); - emit_insn (gen_rtx (USE, VOIDmode, result)); - } -} - int extract_init (decl, init) tree decl ATTRIBUTE_UNUSED, init ATTRIBUTE_UNUSED; diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index e3d1dec952d..28c0f35b075 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -975,17 +975,12 @@ finish_decl_cleanup (decl, cleanup) static void genrtl_named_return_value () { - tree decl; - - decl = DECL_RESULT (current_function_decl); - - emit_local_var (decl); + tree decl = DECL_RESULT (current_function_decl); /* If this named return value comes in a register, put it in a pseudo-register. */ if (DECL_REGISTER (decl)) { - original_result_rtx = DECL_RTL (decl); /* Note that the mode of the old DECL_RTL may be wider than the mode of DECL_RESULT, depending on the calling conventions for the processor. For example, on the Alpha, a 32-bit integer @@ -993,10 +988,12 @@ genrtl_named_return_value () SImode but the DECL_RTL for the DECL_RESULT has DImode. So, here, we use the mode the back-end has already assigned for the return value. */ - DECL_RTL (decl) = gen_reg_rtx (GET_MODE (original_result_rtx)); + DECL_RTL (decl) = gen_reg_rtx (GET_MODE (DECL_RTL (decl))); if (TREE_ADDRESSABLE (decl)) put_var_into_stack (decl); } + + emit_local_var (decl); } /* Bind a name and initialization to the return value of @@ -2602,15 +2599,9 @@ genrtl_finish_function (fn) emit_label (cleanup_label); } - /* Get return value into register if that's where it's supposed to - be. */ - if (original_result_rtx) - fixup_result_decl (DECL_RESULT (fn), original_result_rtx); - /* Finish building code that will trigger warnings if users forget to make their functions return values. */ - if (no_return_label || cleanup_label) - emit_jump (return_label); + emit_jump (return_label); if (no_return_label) { /* We don't need to call `expand_*_return' here because we don't -- 2.11.0