caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dmitry Bely <dmitry.bely@gmail.com>
To: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Assembly labels overflow
Date: Tue, 5 May 2009 13:21:08 +0400	[thread overview]
Message-ID: <90823c940905050221l28a1967qcd4530fb0a632c88@mail.gmail.com> (raw)
In-Reply-To: <b1a2ac070905020459u5493a9cbr7c4b26c882332c6@mail.gmail.com>

On Sat, May 2, 2009 at 3:59 PM, Geoffroy <c.geoffroy@gmail.com> wrote:

> I am currently working on a tool which is generating a lot of ocaml code.
> The problem comes during compilation : due to the amount of source code or
> the length of function, i got some "already define symbol" error when the
> camlasm is build. Basically assembly labels appear more than one time.

Probably label_counter exceeds 100000 and local labels overlap L1xxxxx
and L2xxxxxx labels that ocamlopt uses for some internal purposes.
Does your module really need more that 100000 labels? What does your
code do?

> To avoid this i decided to split my generated ocaml code in several small
> pack (down to 5 functions by .ml files) and to use the "-compact" option.
> With this the problem was push back a little.
>
> But now i am once again facing this problem and i didn't have any more idea
> for it.

In theory you can hack ocamlopt, making internally used labels to
start from 1000000 and 2000000 or more. See files asmcomp/<your
architecture>/emit.mlp and asmcomp/emitaux.ml.

> So i wanted to know if someone got enough knowledge in ocaml internal to
> explain me the perfect form for function to minimise the label production
> during assembly generation.

No, I think it's not possible. If you need to do some action
conditionally, how can you manage without jumps and labels?

- Dmitry Bely


      reply	other threads:[~2009-05-05  9:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-02 11:59 Geoffroy
2009-05-05  9:21 ` Dmitry Bely [this message]

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=90823c940905050221l28a1967qcd4530fb0a632c88@mail.gmail.com \
    --to=dmitry.bely@gmail.com \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).