# HG changeset patch # User Ryoma SHINYA # Date 1292266713 -32400 # Node ID b362627d71bab4e085fb880543ac43dcb35c5c24 # Parent 70947ddafad7763ea0ce5a1cc494b2412d3d6834 bug-fix: modify tail-call-optimization enforcing rules. (calls.c.) diff -r 70947ddafad7 -r b362627d71ba gcc/calls.c --- a/gcc/calls.c Sun Apr 25 17:46:01 2010 +0900 +++ b/gcc/calls.c Tue Dec 14 03:58:33 2010 +0900 @@ -2429,12 +2429,14 @@ // when tail call optimization flag was down, warn about them. // and flag it to force a tail call optimize. #ifndef noCbC - if (fndecl && CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)) && try_tail_call == 0) + if (fndecl && CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)) + && CbC_IS_CODE_SEGMENT (TREE_TYPE (current_function_decl)) + && try_tail_call == 0) { location_t loc = EXPR_LOCATION (exp); char *name_callee = IDENTIFIER_POINTER(DECL_NAME(fndecl)); - warning_at (loc, 0, "Jump to Code Segment \"%s\" with CbC goto, but tail call optimization was cut.", - name_callee); + warning_at (loc, 0, "transition to code segment \"%s\" with CbC goto, but tail call optimization was cut.", + name_callee); try_tail_call = 1; } #endif