aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel1@de.ibm.com>2007-02-19 14:35:10 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2007-02-19 14:35:10 +0000
commit9a6f71b45c63bbcd47e7dc34b5aeecc3b43c7531 (patch)
treed50bb9a6aef59dd091d1f8ffcfd0471187d31c1e /gcc
parent991c42ace3e11a0685b2ff65a4d33a0d88ede2cc (diff)
downloadgcc-9a6f71b45c63bbcd47e7dc34b5aeecc3b43c7531.zip
gcc-9a6f71b45c63bbcd47e7dc34b5aeecc3b43c7531.tar.gz
gcc-9a6f71b45c63bbcd47e7dc34b5aeecc3b43c7531.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/s390/s390.c18
2 files changed, 12 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e6cdb6e..b5c4a67 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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>
* config/cris/cris.c (cris_movem_load_rest_p, cris_store_multiple_op_p)
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 1ef4510..ad73869 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -8703,28 +8703,26 @@ s390_valid_pointer_mode (enum machine_mode mode)
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
optimization could be performed on the respective function
call. */
static bool
-s390_call_saved_register_used (tree argument_list)
+s390_call_saved_register_used (tree call_expr)
{
CUMULATIVE_ARGS cum;
tree parameter;
enum machine_mode mode;
tree type;
rtx parm_rtx;
- int reg;
+ int reg, i;
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);
- argument_list = TREE_CHAIN (argument_list);
-
+ parameter = CALL_EXPR_ARG (call_expr, i);
gcc_assert (parameter);
/* For an undeclared variable passed as parameter we will get
@@ -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
"caller saved". This makes functions needing this register for arguments
not suitable for sibcalls. */
- if (TREE_OPERAND (exp, 1)
- && s390_call_saved_register_used (TREE_OPERAND (exp, 1)))
- return false;
-
- return true;
+ return !s390_call_saved_register_used (exp);
}
/* Return the fixed registers used for condition codes. */