/* Tail call optimization on trees.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
static bool
suitable_for_tail_call_opt_p (void)
{
+ tree param;
+
/* alloca (until we have stack slot life analysis) inhibits
sibling call optimizations, but not tail recursion. */
if (current_function_calls_alloca)
if (current_function_calls_setjmp)
return false;
+ /* ??? It is OK if the argument of a function is taken in some cases,
+ but not in all cases. See PR15387 and PR19616. Revisit for 4.1. */
+ for (param = DECL_ARGUMENTS (current_function_decl);
+ param;
+ param = TREE_CHAIN (param))
+ if (TREE_ADDRESSABLE (param))
+ return false;
+
return true;
}
if (PHI_RESULT (phi) == a_acc)
break;
- add_phi_arg (&phi, a_acc_arg, back);
+ add_phi_arg (phi, a_acc_arg, back);
}
if (m_acc)
if (PHI_RESULT (phi) == m_acc)
break;
- add_phi_arg (&phi, m_acc_arg, back);
+ add_phi_arg (phi, m_acc_arg, back);
}
}
if (!phi)
continue;
- add_phi_arg (&phi, TREE_VALUE (args), e);
+ add_phi_arg (phi, TREE_VALUE (args), e);
}
/* Add phi nodes for the call clobbered variables. */
var_ann (param)->default_def = new_name;
phi = create_phi_node (name, first);
SSA_NAME_DEF_STMT (name) = phi;
- add_phi_arg (&phi, new_name, EDGE_SUCC (ENTRY_BLOCK_PTR, 0));
+ add_phi_arg (phi, new_name, EDGE_SUCC (ENTRY_BLOCK_PTR, 0));
/* For all calls the same set of variables should be clobbered. This
means that there always should be the appropriate phi node except
gcc_assert (EDGE_COUNT (first->preds) <= 2);
}
- add_phi_arg (&phi, V_MAY_DEF_OP (v_may_defs, i), e);
+ add_phi_arg (phi, V_MAY_DEF_OP (v_may_defs, i), e);
}
/* Update the values of accumulators. */
var_ann (param)->default_def = new_name;
phi = create_phi_node (name, first);
SSA_NAME_DEF_STMT (name) = phi;
- add_phi_arg (&phi, new_name, EDGE_PRED (first, 0));
+ add_phi_arg (phi, new_name, EDGE_PRED (first, 0));
}
phis_constructed = true;
}
add_referenced_tmp_var (tmp);
phi = create_phi_node (tmp, first);
- add_phi_arg (&phi,
+ add_phi_arg (phi,
/* RET_TYPE can be a float when -ffast-maths is
enabled. */
fold_convert (ret_type, integer_zero_node),
add_referenced_tmp_var (tmp);
phi = create_phi_node (tmp, first);
- add_phi_arg (&phi,
+ add_phi_arg (phi,
/* RET_TYPE can be a float when -ffast-maths is
enabled. */
fold_convert (ret_type, integer_one_node),