public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* No tail call optimization in Thumb mode?
@ 2005-06-24  6:15 Kazu Hirata
  2005-06-28  9:48 ` Richard Earnshaw
  0 siblings, 1 reply; 2+ messages in thread
From: Kazu Hirata @ 2005-06-24  6:15 UTC (permalink / raw)
  To: gcc; +Cc: nickc, rearnsha, paul

Hi,

Why is tail call optimization for Thumb disabled on GCC?  I am
wondering if this is a TODO item or something that we cannot do
intrinsically.

"The ARM-THUMB Procedure Call Standard" says "No tail continuation in
Thumb-state" several times in its figures and measurements, but the
document doesn't explicitly forbid tail call optimization for Thumb.

Thanks in advance,

Kazu Hirata

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

* Re: No tail call optimization in Thumb mode?
  2005-06-24  6:15 No tail call optimization in Thumb mode? Kazu Hirata
@ 2005-06-28  9:48 ` Richard Earnshaw
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw @ 2005-06-28  9:48 UTC (permalink / raw)
  To: Kazu Hirata; +Cc: gcc, nickc, Paul Brook

On Fri, 2005-06-24 at 07:15, Kazu Hirata wrote:
> Hi,
> 
> Why is tail call optimization for Thumb disabled on GCC?  I am
> wondering if this is a TODO item or something that we cannot do
> intrinsically.
> 
> "The ARM-THUMB Procedure Call Standard" says "No tail continuation in
> Thumb-state" several times in its figures and measurements, but the
> document doesn't explicitly forbid tail call optimization for Thumb.
> 

There's no prohibition on it, but the thumb-1 branch instruction has a
range of only +/- 2kB (which is too small to reach an arbitrary target
address in an image) and we currently don't support tail-calls via a
register for either ARM or Thumb state.

If we *knew* that the target address would be reachable, then we could
probably use a tail-call, but in practice I don't think we can.

R.

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

end of thread, other threads:[~2005-06-28  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-24  6:15 No tail call optimization in Thumb mode? Kazu Hirata
2005-06-28  9:48 ` Richard Earnshaw

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).