diff gcc/calls.c @ 82:895e19fe9c22

modify calls.c
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Fri, 11 Nov 2011 02:35:16 +0900
parents ce75bd9117e4
children 6fb1a677d0b5
line wrap: on
line diff
--- a/gcc/calls.c	Sat Sep 24 02:41:02 2011 +0900
+++ b/gcc/calls.c	Fri Nov 11 02:35:16 2011 +0900
@@ -2335,7 +2335,12 @@
 #endif
       /* Check whether the target is able to optimize the call
 	 into a sibcall.  */
+#ifndef noCbC
+      || (!targetm.function_ok_for_sibcall (fndecl, exp)
+	 && (!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl))))
+#else
       || !targetm.function_ok_for_sibcall (fndecl, exp)
+#endif 
       /* Functions that do not return exactly once may not be sibcall
 	 optimized.  */
       || (flags & (ECF_RETURNS_TWICE | ECF_NORETURN))
@@ -2359,9 +2364,14 @@
       || !lang_hooks.decls.ok_for_sibcall (fndecl))
     try_tail_call = 0;
 
+
   /* Check if caller and callee disagree in promotion of function
      return value.  */
-  if (try_tail_call)
+#ifndef noCbC
+  if (try_tail_call && (!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl))))
+#else
+    if (try_tail_call)
+#endif 
     {
       enum machine_mode caller_mode, caller_promoted_mode;
       enum machine_mode callee_mode, callee_promoted_mode;