>>>>> "Manuel" == Manuel Fahndrich <maf@microsoft.com> writes:
Manuel> I'm wondering if other people are experiencing problems
Manuel> with ocamlopt under windows.
This is probably not Windows related, but x86 related. I discovered it
on Linux/x86 too.
Manuel> I have a program that works fine as bytecode, but it runs
Manuel> out of stack space when compiled with ocamlopt. I'm
Manuel> suspecting an infinite loop.
On x86 (and other architectures too) tail-recursive
calls are passing their arguments thru the machine registers. The x86
has only few of them (8, of which a couple of them are reserved).
So a tail-recursive call with more than about 6 or 7 arguments is not
executed tail-recursively (in constant stack space) but pushes stuff
on the stack.
On the bytecode machine all tail-rec calls are done correctly (in
constant stack space) even those with many arguments.
(I did happen to tell this bug to Ocaml developper team at JFLA2000 in
february 2000).
My wish would be at least an ocamlopt warning when the ocamlopt
compile handles a big tail-recursive call as a non-tail-rec one.
Regards.
N.B. Any opinions expressed here are only mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.
---------------------------------------------------------------------
Basile STARYNKEVITCH ---- Commissariat Ã l Energie Atomique
DTA/LETI/DEIN/SLA * CEA/Saclay b.528 (p111f) * 91191 GIF/YVETTE CEDEX * France
phone: 1,69.08.60.55; fax: 1.69.08.83.95 home: 1,46.65.45.53
email: Basile point Starynkevitch at cea point fr