From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA24151 for caml-red; Wed, 7 Jun 2000 20:22:52 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA13765 for ; Wed, 7 Jun 2000 08:53:04 +0200 (MET DST) Received: from nenuphar.saclay.cea.fr (nenuphar.saclay.cea.fr [132.166.192.7]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e576r4X23434 for ; Wed, 7 Jun 2000 08:53:04 +0200 (MET DST) Received: from muguet.saclay.cea.fr (muguet.saclay.cea.fr [132.166.192.6]) by nenuphar.saclay.cea.fr (8.9.1a/8.9.1/CEAnet-relay-5.0.D20+Y2K) with ESMTP id IAA20173 for ; Wed, 7 Jun 2000 08:53:04 +0200 (MET DST) Received: from harpie.saclay.cea.fr (harpie.saclay.cea.fr [132.166.133.152]) by muguet.saclay.cea.fr (8.9.1a/8.9.1/CEAnet-relay-5.2.D20+Y2K) with ESMTP id IAA09470; Wed, 7 Jun 2000 08:53:02 +0200 (MET DST) Received: by harpie.saclay.cea.fr (8.8.8+Sun/CEANET.2.0.1) id IAA04101; Wed, 7 Jun 2000 08:53:03 +0200 (MET DST) From: STARYNKEVITCH Basile MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <14653.61775.564855.950848@gargle.gargle.HOWL> Date: Wed, 7 Jun 2000 08:53:03 +0200 (MET DST) To: Manuel Fahndrich To: "'caml-list@inria.fr'" Subject: Problems with ocamlopt under windows? In-Reply-To: <783D93998201D311B0CF00805FEAA07B7E9261@RED-MSG-42> References: <783D93998201D311B0CF00805FEAA07B7E9261@RED-MSG-42> X-Mailer: VM 6.72 under 21.1 (patch 9) "Canyonlands" XEmacs Lucid Content-Transfer-Encoding: 8bit Content-Transfer-Encoding: 8bit Sender: weis >>>>> "Manuel" == Manuel Fahndrich 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