comparison gcc/calls.c @ 86:12b3180c7d07

modify calls.c.
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Thu, 15 Dec 2011 02:37:13 +0900
parents 6fb1a677d0b5
children 70c969e0d1dd
comparison
equal deleted inserted replaced
85:32380d8cb035 86:12b3180c7d07
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
2342 || !targetm.function_ok_for_sibcall (fndecl, exp) 2338 || !targetm.function_ok_for_sibcall (fndecl, exp)
2343 #endif
2344 /* Functions that do not return exactly once may not be sibcall 2339 /* Functions that do not return exactly once may not be sibcall
2345 optimized. */ 2340 optimized. */
2346 || (flags & (ECF_RETURNS_TWICE | ECF_NORETURN)) 2341 || (flags & (ECF_RETURNS_TWICE | ECF_NORETURN))
2347 || TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (addr))) 2342 || TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (addr)))
2348 /* If the called function is nested in the current one, it might access 2343 /* If the called function is nested in the current one, it might access
2351 || (fndecl && decl_function_context (fndecl) == current_function_decl) 2346 || (fndecl && decl_function_context (fndecl) == current_function_decl)
2352 /* If this function requires more stack slots than the current 2347 /* If this function requires more stack slots than the current
2353 function, we cannot change it into a sibling call. 2348 function, we cannot change it into a sibling call.
2354 crtl->args.pretend_args_size is not part of the 2349 crtl->args.pretend_args_size is not part of the
2355 stack allocated by our caller. */ 2350 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
2361 || args_size.constant > (crtl->args.size 2351 || args_size.constant > (crtl->args.size
2362 - crtl->args.pretend_args_size) 2352 - crtl->args.pretend_args_size)
2363 #endif
2364 /* If the callee pops its own arguments, then it must pop exactly 2353 /* If the callee pops its own arguments, then it must pop exactly
2365 the same number of arguments as the current function. */ 2354 the same number of arguments as the current function. */
2366 || (targetm.calls.return_pops_args (fndecl, funtype, args_size.constant) 2355 || (targetm.calls.return_pops_args (fndecl, funtype, args_size.constant)
2367 != targetm.calls.return_pops_args (current_function_decl, 2356 != targetm.calls.return_pops_args (current_function_decl,
2368 TREE_TYPE (current_function_decl), 2357 TREE_TYPE (current_function_decl),