This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Small sibbling call tweak
- To: egcs at egcs dot cygnus dot com, rth at cygnus dot com
- Subject: Small sibbling call tweak
- From: Jan Hubicka <jh at suse dot cz>
- Date: Tue, 9 May 2000 17:15:22 +0200
Hi
The sibbling call sequence is not generated for calls appearing
lexically inside loops. This is not good idea IMO, since it is
common practice to have loop with conditional return inside
such as:
main()
{ while (1) if (q()) return t();
}
So here is patch to disable it so t() can be recogniyed as sibling
call.
Tue May 9 17:13:40 MET DST 2000 Jan Hubicka <jh@suse.cz>
* calls.c (expand_call): Generate sibbling_call sequences
for calls inside lexical loops.
Index: egcs/gcc/calls.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/calls.c,v
retrieving revision 1.131
diff -c -3 -p -r1.131 calls.c
*** calls.c 2000/05/09 14:33:41 1.131
--- calls.c 2000/05/09 15:11:37
*************** expand_call (exp, target, ignore)
*** 2308,2314 ****
if (!flag_optimize_sibling_calls
|| !rtx_equal_function_value_matters
|| currently_expanding_call
- || !stmt_loop_nest_empty ()
|| any_pending_cleanups (1)
|| args_size.var)
try_tail_call = try_tail_recursion = 0;
--- 2308,2313 ----