Commit 9a6f71b4 by Andreas Krebbel Committed by Andreas Krebbel

s390.c (s390_call_saved_register_used, [...]): Adjust the way CALL_EXPR…

s390.c (s390_call_saved_register_used, [...]): Adjust the way CALL_EXPR arguments are accessed to the new scheme.

2007-02-19  Andreas Krebbel  <krebbel1@de.ibm.com>

	* config/s390/s390.c (s390_call_saved_register_used,
	s390_function_ok_for_sibcall): Adjust the way CALL_EXPR arguments are
	accessed to the new scheme.

From-SVN: r122129
parent 991c42ac
2007-02-19 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.c (s390_call_saved_register_used,
s390_function_ok_for_sibcall): Adjust the way CALL_EXPR arguments are
accessed to the new scheme.
2007-02-19 Jan-Benedict Glaw <jbglaw@lug-owl.de> 2007-02-19 Jan-Benedict Glaw <jbglaw@lug-owl.de>
* config/cris/cris.c (cris_movem_load_rest_p, cris_store_multiple_op_p) * config/cris/cris.c (cris_movem_load_rest_p, cris_store_multiple_op_p)
......
...@@ -8703,28 +8703,26 @@ s390_valid_pointer_mode (enum machine_mode mode) ...@@ -8703,28 +8703,26 @@ s390_valid_pointer_mode (enum machine_mode mode)
return (mode == SImode || (TARGET_64BIT && mode == DImode)); return (mode == SImode || (TARGET_64BIT && mode == DImode));
} }
/* Checks whether the given ARGUMENT_LIST would use a caller /* Checks whether the given CALL_EXPR would use a caller
saved register. This is used to decide whether sibling call saved register. This is used to decide whether sibling call
optimization could be performed on the respective function optimization could be performed on the respective function
call. */ call. */
static bool static bool
s390_call_saved_register_used (tree argument_list) s390_call_saved_register_used (tree call_expr)
{ {
CUMULATIVE_ARGS cum; CUMULATIVE_ARGS cum;
tree parameter; tree parameter;
enum machine_mode mode; enum machine_mode mode;
tree type; tree type;
rtx parm_rtx; rtx parm_rtx;
int reg; int reg, i;
INIT_CUMULATIVE_ARGS (cum, NULL, NULL, 0, 0); INIT_CUMULATIVE_ARGS (cum, NULL, NULL, 0, 0);
while (argument_list) for (i = 0; i < call_expr_nargs (call_expr); i++)
{ {
parameter = TREE_VALUE (argument_list); parameter = CALL_EXPR_ARG (call_expr, i);
argument_list = TREE_CHAIN (argument_list);
gcc_assert (parameter); gcc_assert (parameter);
/* For an undeclared variable passed as parameter we will get /* For an undeclared variable passed as parameter we will get
...@@ -8780,11 +8778,7 @@ s390_function_ok_for_sibcall (tree decl, tree exp) ...@@ -8780,11 +8778,7 @@ s390_function_ok_for_sibcall (tree decl, tree exp)
/* Register 6 on s390 is available as an argument register but unfortunately /* Register 6 on s390 is available as an argument register but unfortunately
"caller saved". This makes functions needing this register for arguments "caller saved". This makes functions needing this register for arguments
not suitable for sibcalls. */ not suitable for sibcalls. */
if (TREE_OPERAND (exp, 1) return !s390_call_saved_register_used (exp);
&& s390_call_saved_register_used (TREE_OPERAND (exp, 1)))
return false;
return true;
} }
/* Return the fixed registers used for condition codes. */ /* Return the fixed registers used for condition codes. */
......
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