caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Assembly labels overflow
@ 2009-05-02 11:59 Geoffroy
  2009-05-05  9:21 ` [Caml-list] " Dmitry Bely
  0 siblings, 1 reply; 2+ messages in thread
From: Geoffroy @ 2009-05-02 11:59 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

Hello

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.

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.

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.

Thanx

[-- Attachment #2: Type: text/html, Size: 829 bytes --]

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

* Re: [Caml-list] Assembly labels overflow
  2009-05-02 11:59 Assembly labels overflow Geoffroy
@ 2009-05-05  9:21 ` Dmitry Bely
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Bely @ 2009-05-05  9:21 UTC (permalink / raw)
  To: Caml List

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


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

end of thread, other threads:[~2009-05-05  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-02 11:59 Assembly labels overflow Geoffroy
2009-05-05  9:21 ` [Caml-list] " Dmitry Bely

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).