Mercurial > hg > CbC > CbC_gcc
comparison 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 |
comparison
equal
deleted
inserted
replaced
87:4a89a0a804df | 88:f214c1d5b862 |
---|---|
2333 != OUTGOING_REG_PARM_STACK_SPACE (TREE_TYPE (current_function_decl))) | 2333 != OUTGOING_REG_PARM_STACK_SPACE (TREE_TYPE (current_function_decl))) |
2334 || (reg_parm_stack_space != REG_PARM_STACK_SPACE (fndecl)) | 2334 || (reg_parm_stack_space != REG_PARM_STACK_SPACE (fndecl)) |
2335 #endif | 2335 #endif |
2336 /* Check whether the target is able to optimize the call | 2336 /* Check whether the target is able to optimize the call |
2337 into a sibcall. */ | 2337 into a sibcall. */ |
2338 #ifndef noCbC | |
2339 || (!targetm.function_ok_for_sibcall (fndecl, exp) | |
2340 && (!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)))) | |
2341 #else | |
2338 || !targetm.function_ok_for_sibcall (fndecl, exp) | 2342 || !targetm.function_ok_for_sibcall (fndecl, exp) |
2343 #endif | |
2339 /* Functions that do not return exactly once may not be sibcall | 2344 /* Functions that do not return exactly once may not be sibcall |
2340 optimized. */ | 2345 optimized. */ |
2341 || (flags & (ECF_RETURNS_TWICE | ECF_NORETURN)) | 2346 || (flags & (ECF_RETURNS_TWICE | ECF_NORETURN)) |
2342 || TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (addr))) | 2347 || TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (addr))) |
2343 /* If the called function is nested in the current one, it might access | 2348 /* If the called function is nested in the current one, it might access |
2346 || (fndecl && decl_function_context (fndecl) == current_function_decl) | 2351 || (fndecl && decl_function_context (fndecl) == current_function_decl) |
2347 /* If this function requires more stack slots than the current | 2352 /* If this function requires more stack slots than the current |
2348 function, we cannot change it into a sibling call. | 2353 function, we cannot change it into a sibling call. |
2349 crtl->args.pretend_args_size is not part of the | 2354 crtl->args.pretend_args_size is not part of the |
2350 stack allocated by our caller. */ | 2355 stack allocated by our caller. */ |
2356 #ifndef noCbC | |
2357 || (args_size.constant > (crtl->args.size | |
2358 - crtl->args.pretend_args_size) | |
2359 && (!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)))) | |
2360 #else | |
2351 || args_size.constant > (crtl->args.size | 2361 || args_size.constant > (crtl->args.size |
2352 - crtl->args.pretend_args_size) | 2362 - crtl->args.pretend_args_size) |
2363 #endif | |
2353 /* If the callee pops its own arguments, then it must pop exactly | 2364 /* If the callee pops its own arguments, then it must pop exactly |
2354 the same number of arguments as the current function. */ | 2365 the same number of arguments as the current function. */ |
2355 || (targetm.calls.return_pops_args (fndecl, funtype, args_size.constant) | 2366 || (targetm.calls.return_pops_args (fndecl, funtype, args_size.constant) |
2356 != targetm.calls.return_pops_args (current_function_decl, | 2367 != targetm.calls.return_pops_args (current_function_decl, |
2357 TREE_TYPE (current_function_decl), | 2368 TREE_TYPE (current_function_decl), |
2358 crtl->args.size)) | 2369 crtl->args.size)) |
2359 || !lang_hooks.decls.ok_for_sibcall (fndecl)) | 2370 || !lang_hooks.decls.ok_for_sibcall (fndecl)) |
2360 try_tail_call = 0; | 2371 try_tail_call = 0; |
2361 | 2372 |
2373 | |
2362 /* Check if caller and callee disagree in promotion of function | 2374 /* Check if caller and callee disagree in promotion of function |
2363 return value. */ | 2375 return value. */ |
2364 if (try_tail_call) | 2376 #ifndef noCbC |
2377 if (try_tail_call && (!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)))) | |
2378 #else | |
2379 if (try_tail_call) | |
2380 #endif | |
2365 { | 2381 { |
2366 enum machine_mode caller_mode, caller_promoted_mode; | 2382 enum machine_mode caller_mode, caller_promoted_mode; |
2367 enum machine_mode callee_mode, callee_promoted_mode; | 2383 enum machine_mode callee_mode, callee_promoted_mode; |
2368 int caller_unsignedp, callee_unsignedp; | 2384 int caller_unsignedp, callee_unsignedp; |
2369 tree caller_res = DECL_RESULT (current_function_decl); | 2385 tree caller_res = DECL_RESULT (current_function_decl); |