From a3f1744823d6dbeaf400812de86263fb615bbbba Mon Sep 17 00:00:00 2001 From: xleroy Date: Fri, 17 May 2013 11:37:39 +0000 Subject: Add option -fno-tailcalls to turn off tailcall elimination (causes problem with some static analysis tools). */PrintAsm.ml: don't cfa_adjust at Pfreeframe, as more code from the function can appear after (in case of tailcalls). git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2256 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- backend/Tailcall.v | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'backend/Tailcall.v') diff --git a/backend/Tailcall.v b/backend/Tailcall.v index 917ec83..26beb34 100644 --- a/backend/Tailcall.v +++ b/backend/Tailcall.v @@ -95,10 +95,13 @@ Definition transf_instr (f: function) (pc: node) (instr: instruction) := end. (** A function is transformed only if its stack block is empty, - as explained above. *) + as explained above. Moreover, we can turn tail calls off + using a compilation option. *) + +Parameter eliminate_tailcalls: unit -> bool. Definition transf_function (f: function) : function := - if zeq f.(fn_stacksize) 0 + if zeq f.(fn_stacksize) 0 && eliminate_tailcalls tt then RTL.transf_function (transf_instr f) f else f. -- cgit v1.2.3