diff options
Diffstat (limited to 'gcc/tree-tailcall.c')
-rw-r--r-- | gcc/tree-tailcall.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index f483585..a99cd11 100644 --- a/gcc/tree-tailcall.c +++ b/gcc/tree-tailcall.c @@ -140,6 +140,7 @@ suitable_for_tail_opt_p (void) return true; } + /* Returns false when the function is not suitable for tail call optimization for some reason (e.g. if it takes variable number of arguments). This test must pass in addition to suitable_for_tail_opt_p in order to make @@ -168,6 +169,11 @@ suitable_for_tail_call_opt_p (void) if (cfun->calls_setjmp) return false; + /* Various targets don't handle tail calls correctly in functions + that call __builtin_eh_return. */ + if (cfun->calls_eh_return) + return false; + /* ??? It is OK if the argument of a function is taken in some cases, but not in all cases. See PR15387 and PR19616. Revisit for 4.1. */ for (param = DECL_ARGUMENTS (current_function_decl); |