2007-02-19 Andreas Krebbel <krebbel1@de.ibm.com>
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Feb 2007 14:35:10 +0000 (14:35 +0000)
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Feb 2007 14:35:10 +0000 (14:35 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122129 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/s390/s390.c

index e6cdb6e..b5c4a67 100644 (file)
@@ -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)
index 1ef4510..ad73869 100644 (file)
@@ -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.  */