diff options
author | Richard Henderson <rth@cygnus.com> | 2000-08-12 09:28:10 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-08-12 09:28:10 -0700 |
commit | 055bcfeedad2c54d2abbf2dc85f50565defc92f0 (patch) | |
tree | 0b58003a89bb66321aeaebb663ee8fe8ba653669 /gcc/stmt.c | |
parent | 3ac597cb9a7b77b48e54670f6d9f3a028bd75b8f (diff) | |
download | gcc-055bcfeedad2c54d2abbf2dc85f50565defc92f0.zip gcc-055bcfeedad2c54d2abbf2dc85f50565defc92f0.tar.gz gcc-055bcfeedad2c54d2abbf2dc85f50565defc92f0.tar.bz2 |
sibcall.c (uses_addressof): Accept both addressof and current_function_internal_arg_pointer inside a mem.
* sibcall.c (uses_addressof): Accept both addressof and
current_function_internal_arg_pointer inside a mem.
(optimize_sibling_and_tail_recursive_call): Fail tail recursion
if current_function_uses_addressof.
* stmt.c (expand_return): Kill tail recursion and HAVE_return
optimizations.
From-SVN: r35657
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 79 |
1 files changed, 0 insertions, 79 deletions
@@ -2809,9 +2809,6 @@ expand_return (retval) rtx last_insn = 0; rtx result_rtl = DECL_RTL (DECL_RESULT (current_function_decl)); register rtx val = 0; -#ifdef HAVE_return - register rtx op0; -#endif tree retval_rhs; int cleanups; @@ -2885,82 +2882,6 @@ expand_return (retval) return; } - /* Attempt to optimize the call if it is tail recursive. */ - if (flag_optimize_sibling_calls - && retval_rhs != NULL_TREE - && frame_offset == 0 - && TREE_CODE (retval_rhs) == CALL_EXPR - && TREE_CODE (TREE_OPERAND (retval_rhs, 0)) == ADDR_EXPR - && (TREE_OPERAND (TREE_OPERAND (retval_rhs, 0), 0) - == current_function_decl) - && optimize_tail_recursion (TREE_OPERAND (retval_rhs, 1), last_insn)) - return; - -#ifdef HAVE_return - /* This optimization is safe if there are local cleanups - because expand_null_return takes care of them. - ??? I think it should also be safe when there is a cleanup label, - because expand_null_return takes care of them, too. - Any reason why not? */ - if (HAVE_return && cleanup_label == 0 - && ! current_function_returns_pcc_struct - && BRANCH_COST <= 1) - { - /* If this is return x == y; then generate - if (x == y) return 1; else return 0; - if we can do it with explicit return insns and branches are cheap, - but not if we have the corresponding scc insn. */ - int has_scc = 0; - if (retval_rhs) - switch (TREE_CODE (retval_rhs)) - { - case EQ_EXPR: -#ifdef HAVE_seq - has_scc = HAVE_seq; -#endif - case NE_EXPR: -#ifdef HAVE_sne - has_scc = HAVE_sne; -#endif - case GT_EXPR: -#ifdef HAVE_sgt - has_scc = HAVE_sgt; -#endif - case GE_EXPR: -#ifdef HAVE_sge - has_scc = HAVE_sge; -#endif - case LT_EXPR: -#ifdef HAVE_slt - has_scc = HAVE_slt; -#endif - case LE_EXPR: -#ifdef HAVE_sle - has_scc = HAVE_sle; -#endif - case TRUTH_ANDIF_EXPR: - case TRUTH_ORIF_EXPR: - case TRUTH_AND_EXPR: - case TRUTH_OR_EXPR: - case TRUTH_NOT_EXPR: - case TRUTH_XOR_EXPR: - if (! has_scc) - { - op0 = gen_label_rtx (); - jumpifnot (retval_rhs, op0); - expand_value_return (const1_rtx); - emit_label (op0); - expand_value_return (const0_rtx); - return; - } - break; - - default: - break; - } - } -#endif /* HAVE_return */ - /* If the result is an aggregate that is being returned in one (or more) registers, load the registers here. The compiler currently can't handle copying a BLKmode value into registers. We could put this code in a |