# HG changeset patch # User Nobuyasu Oshiro # Date 1326748297 -32400 # Node ID 506ac5e3963a215f748c493a2f5eaa82a2cbd1b0 # Parent 70c969e0d1dd2ab101e3d7811bc67abf73904f32 modify expand_call diff -r 70c969e0d1dd -r 506ac5e3963a gcc/calls.c --- a/gcc/calls.c Tue Jan 17 06:00:44 2012 +0900 +++ b/gcc/calls.c Tue Jan 17 06:11:37 2012 +0900 @@ -2353,14 +2353,8 @@ 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) diff -r 70c969e0d1dd -r 506ac5e3963a gcc/calls.c~ --- a/gcc/calls.c~ Tue Jan 17 06:00:44 2012 +0900 +++ b/gcc/calls.c~ Tue Jan 17 06:11:37 2012 +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) + - 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)