comparison 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
comparison
equal deleted inserted replaced
80:d8bf5c8fdea8 82:895e19fe9c22
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
2357 TREE_TYPE (current_function_decl), 2362 TREE_TYPE (current_function_decl),
2358 crtl->args.size)) 2363 crtl->args.size))
2359 || !lang_hooks.decls.ok_for_sibcall (fndecl)) 2364 || !lang_hooks.decls.ok_for_sibcall (fndecl))
2360 try_tail_call = 0; 2365 try_tail_call = 0;
2361 2366
2367
2362 /* Check if caller and callee disagree in promotion of function 2368 /* Check if caller and callee disagree in promotion of function
2363 return value. */ 2369 return value. */
2364 if (try_tail_call) 2370 #ifndef noCbC
2371 if (try_tail_call && (!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl))))
2372 #else
2373 if (try_tail_call)
2374 #endif
2365 { 2375 {
2366 enum machine_mode caller_mode, caller_promoted_mode; 2376 enum machine_mode caller_mode, caller_promoted_mode;
2367 enum machine_mode callee_mode, callee_promoted_mode; 2377 enum machine_mode callee_mode, callee_promoted_mode;
2368 int caller_unsignedp, callee_unsignedp; 2378 int caller_unsignedp, callee_unsignedp;
2369 tree caller_res = DECL_RESULT (current_function_decl); 2379 tree caller_res = DECL_RESULT (current_function_decl);