Mercurial > hg > CbC > CbC_gcc
diff gcc/calls.c~ @ 88:f214c1d5b862
merge 89
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 20 Dec 2011 18:53:46 +0900 |
parents | 4a89a0a804df 12b3180c7d07 |
children | 70c969e0d1dd |
line wrap: on
line diff
--- a/gcc/calls.c~ Tue Dec 20 18:51:07 2011 +0900 +++ b/gcc/calls.c~ Tue Dec 20 18:53:46 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)) @@ -2348,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) @@ -2359,9 +2370,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;