[m-dev.] Mutually recursive tailcalls in hlc.

Mark Brown mark at mercurylang.org
Sat Nov 7 13:49:37 AEDT 2015


On Sat, Nov 7, 2015 at 1:25 PM, Zoltan Somogyi
<zoltan.somogyi at runbox.com> wrote:
> On Sat, 7 Nov 2015 06:06:21 +1100, Mark Brown <mark at mercurylang.org> wrote:
>> Come to think of it, could you meet gcc's criteria by just
>> padding out the functions in the SCC so they all have the same number
>> of arguments?
>
> Two functions with the same number of arguments may still have
> different stack frame sizes,

Yes, I know. I think Paul may be mistaken about gcc's criteria,
however: "the compiler considers two functions as being siblings if
they share the same structural equivalence of return types, as well as
matching space requirements of their arguments" [1]. That should be
easier to satisfy than having the same stack size (I haven't tried it
though).

Mark

[1] http://www.drdobbs.com/tackling-c-tail-calls/184401756



More information about the developers mailing list