comparison gcc/calls.c @ 66:b362627d71ba

bug-fix: modify tail-call-optimization enforcing rules. (calls.c.)
author Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp>
date Tue, 14 Dec 2010 03:58:33 +0900
parents 60c1b2f8487a
children 1b10fe6932e1
comparison
equal deleted inserted replaced
62:70947ddafad7 66:b362627d71ba
2427 #endif 2427 #endif
2428 2428
2429 // when tail call optimization flag was down, warn about them. 2429 // when tail call optimization flag was down, warn about them.
2430 // and flag it to force a tail call optimize. 2430 // and flag it to force a tail call optimize.
2431 #ifndef noCbC 2431 #ifndef noCbC
2432 if (fndecl && CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)) && try_tail_call == 0) 2432 if (fndecl && CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl))
2433 && CbC_IS_CODE_SEGMENT (TREE_TYPE (current_function_decl))
2434 && try_tail_call == 0)
2433 { 2435 {
2434 location_t loc = EXPR_LOCATION (exp); 2436 location_t loc = EXPR_LOCATION (exp);
2435 char *name_callee = IDENTIFIER_POINTER(DECL_NAME(fndecl)); 2437 char *name_callee = IDENTIFIER_POINTER(DECL_NAME(fndecl));
2436 warning_at (loc, 0, "Jump to Code Segment \"%s\" with CbC goto, but tail call optimization was cut.", 2438 warning_at (loc, 0, "transition to code segment \"%s\" with CbC goto, but tail call optimization was cut.",
2437 name_callee); 2439 name_callee);
2438 try_tail_call = 1; 2440 try_tail_call = 1;
2439 } 2441 }
2440 #endif 2442 #endif
2441 2443
2442 /* We want to make two insn chains; one for a sibling call, the other 2444 /* We want to make two insn chains; one for a sibling call, the other