Summary: optlink creates bad debug info for a large number of
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optlink

--- Comment #0 from Rainer Schuetze <> 2012-03-03 04:03:43 
PST ---
Here's some code to generate 4000 functions:

import std.stdio;
import std.typetuple;

template countTuple(int n)
    static if (n > 0)
        alias TypeTuple!(countTuple!(n - 1), n - 1) countTuple;
        alias TypeTuple!() countTuple;

void func(int i, int j)()
     writeln(i, j);

void fun()
    foreach(i; countTuple!(40))
        foreach(j; countTuple!(100))
            func!(i, j)();

When compiling it to a library with debug information:
>dmd -g -lib test.d

And linking it with a simple main.d:

import test;

void main()

>dmd -g main.d test.lib

the linker generates bad sstModule information for modules #2730, #4095,
#6826,..., e.g.

Module #2730 (0074CB64)
  SubSection:            0000 (<undefined>)
  iMod:                  0
  lfo:                   76412
  cb:                    25
unsupported type 0

Module #2731 (0074CB70)
  SubSection:            0120 (sstModule)
  iMod:                  2731
  lfo:                   76440

The module numbers seem fixed, they also appear in completely different code.

BTW: if you increase the numbers of functions to 10000, optlink crashes. Maybe
some of the other reported crashes are related.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to