Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: STARYNKEVITCH Basile <Basile.Starynkevitch@cea.fr>
To: Manuel Fahndrich <maf@microsoft.com>
To: "'caml-list@inria.fr'" <caml-list@inria.fr>
Subject: Problems with ocamlopt under windows?
Date: Wed, 7 Jun 2000 08:53:03 +0200 (MET DST)	[thread overview]
Message-ID: <14653.61775.564855.950848@gargle.gargle.HOWL> (raw)
In-Reply-To: <783D93998201D311B0CF00805FEAA07B7E9261@RED-MSG-42>

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




  reply	other threads:[~2000-06-07 18:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-06  7:30 Manuel Fahndrich
2000-06-07  6:53 ` STARYNKEVITCH Basile [this message]
2000-06-07 12:50 Don Syme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14653.61775.564855.950848@gargle.gargle.HOWL \
    --to=basile.starynkevitch@cea.fr \
    --cc=maf@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox