public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* GCCJIT and tail-recursive calls
@ 2015-01-01  0:00 Basile Starynkevitch
  2015-01-01  0:00 ` David Malcolm
  0 siblings, 1 reply; 5+ messages in thread
From: Basile Starynkevitch @ 2015-01-01  0:00 UTC (permalink / raw)
  To: jit

Hello all,

It is well known that GCC is sometimes able to optimize some calls to 
tail-recursive calls (or tail calls
https://en.wikipedia.org/wiki/Tail_call ...) which do not consume any stack.

can a GCCJIT application issues such tail calls? I'm not talking of 
letting GCC decide entirely by itself (GCCJIT is probably doing that 
already). I was thinking of adding a construct where the GCCJIT client knows
for sure that the call should be tail-rec (and if GCCJIT was not able to 
make a tailcall, that would be an error).
Also, even without optimization (i.e. at -O0) that should remain a 
tailcall...

Perhaps adding a gcc_jit_block_end_with_tail_call function?

Regards.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-10 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-01  0:00 GCCJIT and tail-recursive calls Basile Starynkevitch
2015-01-01  0:00 ` David Malcolm
2015-01-01  0:00   ` Basile Starynkevitch
2015-01-01  0:00     ` David Malcolm
2015-01-01  0:00       ` Basile Starynkevitch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).