www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21763] New: Zeroed static array is not placed in BSS with -g

https://issues.dlang.org/show_bug.cgi?id=21763

          Issue ID: 21763
           Summary: Zeroed static array is not placed in BSS with -g build
                    option
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ryuukk.dev gmail.com

The following code:

```
__gshared ubyte[0x1000000 - 1] BUFFER = 0;
void main() {}
```

When compiled with: dmd -g -m64

Will produce an exe of size: 21_378_560 bytes

Without -g, it'll produce an exe of size: 415_744 bytes

It only happen on windows, only with DMD, only with that -g option

--
Mar 24 2021