diff options
Diffstat (limited to 'gcc/tree-tailcall.c')
-rw-r--r-- | gcc/tree-tailcall.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index c91c9da0222..70d167a58e9 100644 --- a/gcc/tree-tailcall.c +++ b/gcc/tree-tailcall.c @@ -25,7 +25,13 @@ along with GCC; see the file COPYING3. If not see #include "tm_p.h" #include "basic-block.h" #include "function.h" -#include "tree-ssa.h" +#include "gimple.h" +#include "gimple-ssa.h" +#include "tree-cfg.h" +#include "tree-phinodes.h" +#include "tree-ssanames.h" +#include "tree-into-ssa.h" +#include "tree-dfa.h" #include "gimple-pretty-print.h" #include "except.h" #include "tree-pass.h" @@ -446,7 +452,9 @@ find_tail_calls (basic_block bb, struct tailcall **ret) /* We found the call, check whether it is suitable. */ tail_recursion = false; func = gimple_call_fndecl (call); - if (func && recursive_call_p (current_function_decl, func)) + if (func + && !DECL_BUILT_IN (func) + && recursive_call_p (current_function_decl, func)) { tree arg; @@ -1083,12 +1091,12 @@ const pass_data pass_data_tail_recursion = class pass_tail_recursion : public gimple_opt_pass { public: - pass_tail_recursion(gcc::context *ctxt) - : gimple_opt_pass(pass_data_tail_recursion, ctxt) + pass_tail_recursion (gcc::context *ctxt) + : gimple_opt_pass (pass_data_tail_recursion, ctxt) {} /* opt_pass methods: */ - opt_pass * clone () { return new pass_tail_recursion (ctxt_); } + opt_pass * clone () { return new pass_tail_recursion (m_ctxt); } bool gate () { return gate_tail_calls (); } unsigned int execute () { return execute_tail_recursion (); } @@ -1122,8 +1130,8 @@ const pass_data pass_data_tail_calls = class pass_tail_calls : public gimple_opt_pass { public: - pass_tail_calls(gcc::context *ctxt) - : gimple_opt_pass(pass_data_tail_calls, ctxt) + pass_tail_calls (gcc::context *ctxt) + : gimple_opt_pass (pass_data_tail_calls, ctxt) {} /* opt_pass methods: */ |