Commit b5cd4ed4 by Richard Kenner Committed by Richard Kenner

calls.c (flags_from_decl_or_type): Move ECF_SP_DEPRESSED here.

	* calls.c (flags_from_decl_or_type): Move ECF_SP_DEPRESSED here.
	(expand_call): Delete from here.
	Do pending stack adjustments if ECF_SP_DEPRESSED.

From-SVN: r48267
parent c470afad
Sat Dec 22 08:59:50 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Sat Dec 22 08:59:50 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* calls.c (flags_from_decl_or_type): Move ECF_SP_DEPRESSED here.
(expand_call): Delete from here.
Do pending stack adjustments if ECF_SP_DEPRESSED.
* dwarf2out.c (save_rtx): Deleted. * dwarf2out.c (save_rtx): Deleted.
(mem_loc_descriptor): Do equivalent operation. (mem_loc_descriptor): Do equivalent operation.
(add_const_value_attribute, case CONST): Likewise. (add_const_value_attribute, case CONST): Likewise.
......
...@@ -789,17 +789,19 @@ setjmp_call_p (fndecl) ...@@ -789,17 +789,19 @@ setjmp_call_p (fndecl)
return special_function_p (fndecl, 0) & ECF_RETURNS_TWICE; return special_function_p (fndecl, 0) & ECF_RETURNS_TWICE;
} }
/* Detect flags (function attributes) from the function type node. */ /* Detect flags (function attributes) from the function decl or type node. */
static int static int
flags_from_decl_or_type (exp) flags_from_decl_or_type (exp)
tree exp; tree exp;
{ {
int flags = 0; int flags = 0;
tree type = exp;
/* ??? We can't set IS_MALLOC for function types? */ /* ??? We can't set IS_MALLOC for function types? */
if (DECL_P (exp)) if (DECL_P (exp))
{ {
type = TREE_TYPE (exp);
/* The function exp may have the `malloc' attribute. */ /* The function exp may have the `malloc' attribute. */
if (DECL_P (exp) && DECL_IS_MALLOC (exp)) if (DECL_P (exp) && DECL_IS_MALLOC (exp))
flags |= ECF_MALLOC; flags |= ECF_MALLOC;
...@@ -818,6 +820,14 @@ flags_from_decl_or_type (exp) ...@@ -818,6 +820,14 @@ flags_from_decl_or_type (exp)
if (TREE_THIS_VOLATILE (exp)) if (TREE_THIS_VOLATILE (exp))
flags |= ECF_NORETURN; flags |= ECF_NORETURN;
/* Mark if the function returns with the stack pointer depressed. We
cannot consider it pure or constant in that case. */
if (TREE_CODE (type) == FUNCTION_TYPE && TYPE_RETURNS_STACK_DEPRESSED (type))
{
flags |= ECF_SP_DEPRESSED;
flags &= ~(ECF_PURE | ECF_CONST);
}
return flags; return flags;
} }
...@@ -2206,14 +2216,6 @@ expand_call (exp, target, ignore) ...@@ -2206,14 +2216,6 @@ expand_call (exp, target, ignore)
else else
flags |= flags_from_decl_or_type (TREE_TYPE (TREE_TYPE (p))); flags |= flags_from_decl_or_type (TREE_TYPE (TREE_TYPE (p)));
/* Mark if the function returns with the stack pointer depressed. */
if (TREE_CODE (TREE_TYPE (TREE_TYPE (p))) == FUNCTION_TYPE
&& TYPE_RETURNS_STACK_DEPRESSED (TREE_TYPE (TREE_TYPE (p))))
{
flags |= ECF_SP_DEPRESSED;
flags &= ~(ECF_PURE | ECF_CONST);
}
#ifdef REG_PARM_STACK_SPACE #ifdef REG_PARM_STACK_SPACE
#ifdef MAYBE_REG_PARM_STACK_SPACE #ifdef MAYBE_REG_PARM_STACK_SPACE
reg_parm_stack_space = MAYBE_REG_PARM_STACK_SPACE; reg_parm_stack_space = MAYBE_REG_PARM_STACK_SPACE;
...@@ -2658,9 +2660,11 @@ expand_call (exp, target, ignore) ...@@ -2658,9 +2660,11 @@ expand_call (exp, target, ignore)
/* Don't let pending stack adjusts add up to too much. /* Don't let pending stack adjusts add up to too much.
Also, do all pending adjustments now if there is any chance Also, do all pending adjustments now if there is any chance
this might be a call to alloca or if we are expanding a sibling this might be a call to alloca or if we are expanding a sibling
call sequence. */ call sequence or if we are calling a function that is to return
with stack pointer depressed. */
if (pending_stack_adjust >= 32 if (pending_stack_adjust >= 32
|| (pending_stack_adjust > 0 && (flags & ECF_MAY_BE_ALLOCA)) || (pending_stack_adjust > 0
&& (flags & (ECF_MAY_BE_ALLOCA | ECF_SP_DEPRESSED)))
|| pass == 0) || pass == 0)
do_pending_stack_adjust (); do_pending_stack_adjust ();
...@@ -3170,9 +3174,7 @@ expand_call (exp, target, ignore) ...@@ -3170,9 +3174,7 @@ expand_call (exp, target, ignore)
if (TYPE_MODE (TREE_TYPE (exp)) == VOIDmode if (TYPE_MODE (TREE_TYPE (exp)) == VOIDmode
|| ignore) || ignore)
{ target = const0_rtx;
target = const0_rtx;
}
else if (structure_value_addr) else if (structure_value_addr)
{ {
if (target == 0 || GET_CODE (target) != MEM) if (target == 0 || GET_CODE (target) != MEM)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment