changeset 83:6fb1a677d0b5

modify expand_call
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Fri, 11 Nov 2011 04:29:33 +0900
parents 895e19fe9c22
children a5786e986ad2
files gcc/calls.c gcc/calls.c~ gcc/function.c
diffstat 3 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/gcc/calls.c	Fri Nov 11 02:35:16 2011 +0900
+++ b/gcc/calls.c	Fri Nov 11 04:29:33 2011 +0900
@@ -2353,8 +2353,14 @@
 	 function, we cannot change it into a sibling call.
 	 crtl->args.pretend_args_size is not part of the
 	 stack allocated by our caller.  */
+#ifndef noCbC
+      || (args_size.constant > (crtl->args.size
+			       - crtl->args.pretend_args_size)
+	  && (!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl))))
+#else
       || args_size.constant > (crtl->args.size
 			       - crtl->args.pretend_args_size)
+#endif 
       /* If the callee pops its own arguments, then it must pop exactly
 	 the same number of arguments as the current function.  */
       || (targetm.calls.return_pops_args (fndecl, funtype, args_size.constant)
--- a/gcc/calls.c~	Fri Nov 11 02:35:16 2011 +0900
+++ b/gcc/calls.c~	Fri Nov 11 04:29:33 2011 +0900
@@ -2337,7 +2337,7 @@
 	 into a sibcall.  */
 #ifndef noCbC
       || (!targetm.function_ok_for_sibcall (fndecl, exp)
-	  && !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)))
+	 && (!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl))))
 #else
       || !targetm.function_ok_for_sibcall (fndecl, exp)
 #endif 
@@ -2368,9 +2368,9 @@
   /* Check if caller and callee disagree in promotion of function
      return value.  */
 #ifndef noCbC
-  if(0)
+  if (try_tail_call && (!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl))))
 #else
-  if (try_tail_call)
+    if (try_tail_call)
 #endif 
     {
       enum machine_mode caller_mode, caller_promoted_mode;
--- a/gcc/function.c	Fri Nov 11 02:35:16 2011 +0900
+++ b/gcc/function.c	Fri Nov 11 04:29:33 2011 +0900
@@ -65,10 +65,6 @@
 #include "timevar.h"
 #include "vecprim.h"
 
-#ifndef noCbC
-#include "cbc-tree.h"
-#define CbC_STACK_SIZE (1024 * 8)
-#endif
 
 
 /* So we can assign to cfun in this file.  */
@@ -3487,8 +3483,8 @@
     }
 
 #ifndef noCbC
-  if (CbC_IS_CODE_SEGMENT(TREE_TYPE(fndecl)) )
-    all.stack_args_size.constant = CbC_STACK_SIZE;
+  //  if (CbC_IS_CODE_SEGMENT(TREE_TYPE(fndecl)) )
+  //    all.stack_args_size.constant = CbC_STACK_SIZE;
 #endif
 
   /* We have aligned all the args, so add space for the pretend args.  */