# HG changeset patch # User Nobuyasu Oshiro # Date 1320953373 -32400 # Node ID 6fb1a677d0b511cd86936d075fac9a060e301763 # Parent 895e19fe9c2240d9492ec2187e6268d70194eaaa modify expand_call diff -r 895e19fe9c22 -r 6fb1a677d0b5 gcc/calls.c --- 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) diff -r 895e19fe9c22 -r 6fb1a677d0b5 gcc/calls.c~ --- 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; diff -r 895e19fe9c22 -r 6fb1a677d0b5 gcc/function.c --- 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. */