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

Zoltan Somogyi zoltan.somogyi at runbox.com
Sat Nov 7 13:25:53 AEDT 2015



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, for several reasons. First, different arguments
may need different amounts of space (char vs int vs float), and having the
same bag of argument types in different order can still lead to differences
due to alignment requirements. Second, different function bodies have
different set of local variables, and third, they also have different sets of
temporaries created for them. We could conceivably account for the first
two factors, but the third depends on internals of the C code generator,
so it is effectively beyond our reach.

Zoltan.



More information about the developers mailing list