caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Problems with ocamlopt under windows?
@ 2000-06-06  7:30 Manuel Fahndrich
  2000-06-07  6:53 ` STARYNKEVITCH Basile
  0 siblings, 1 reply; 3+ messages in thread
From: Manuel Fahndrich @ 2000-06-06  7:30 UTC (permalink / raw)
  To: 'caml-list@inria.fr'


I'm wondering if other people are experiencing problems with ocamlopt under
windows.

I have a program that works fine as bytecode, but it runs out of stack space
when 
compiled with ocamlopt. I'm suspecting an infinite loop.

I can't seem to narrow down the problem for now, since changing the amount
of print output
masks the error.

-Manuel




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

* Problems with ocamlopt under windows?
  2000-06-06  7:30 Problems with ocamlopt under windows? Manuel Fahndrich
@ 2000-06-07  6:53 ` STARYNKEVITCH Basile
  0 siblings, 0 replies; 3+ messages in thread
From: STARYNKEVITCH Basile @ 2000-06-07  6:53 UTC (permalink / raw)
  To: Manuel Fahndrich, 'caml-list@inria.fr'

>>>>> "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 




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

* RE: Problems with ocamlopt under windows?
@ 2000-06-07 12:50 Don Syme
  0 siblings, 0 replies; 3+ messages in thread
From: Don Syme @ 2000-06-07 12:50 UTC (permalink / raw)
  To: Manuel Fahndrich, 'caml-list@inria.fr'


I had a problem like this a couple of months ago that I never reoprted.
Changing an action in ocamlyacc from

foo:  ... { my_ref := true; () }

to

foo:  ... { my_ref := true }

actually changed the behaviour of the program, from stack overflow to
correct behaviour.  At the time I couldn't get a small program illustrating
the error, and so didn't file a bug report.  I was using 2.02.

Cheers,
Don


-----Original Message-----
From: Manuel Fahndrich [mailto:maf@microsoft.com]
Sent: 06 June 2000 08:30
To: 'caml-list@inria.fr'
Subject: Problems with ocamlopt under windows?



I'm wondering if other people are experiencing problems with ocamlopt under
windows.

I have a program that works fine as bytecode, but it runs out of stack space
when 
compiled with ocamlopt. I'm suspecting an infinite loop.

I can't seem to narrow down the problem for now, since changing the amount
of print output
masks the error.

-Manuel




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

end of thread, other threads:[~2000-06-07 18:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-06  7:30 Problems with ocamlopt under windows? Manuel Fahndrich
2000-06-07  6:53 ` STARYNKEVITCH Basile
2000-06-07 12:50 Don Syme

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 NNTP newsgroup(s).