Mercurial > hg > CbC > CbC_gcc
changeset 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 | 70947ddafad7 |
children | 1b10fe6932e1 |
files | gcc/calls.c |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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