Bug 11237 – zero initializer emitted to read-only data segment, slow compilation

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-12T16:14:00Z
Last change time
2013-11-02T20:31:40Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2013-10-12T16:14:46Z
cat > bug.d << CODE struct Buffer { ubyte[64 * 1024] buffer; } CODE dmd -c bug ---- The compilation takes forever (5s) due to the reasons named in http://d.puremagic.com/issues/show_bug.cgi?id=10866#c20. It's a regression introduced after v2.063.2 that the initializer is not emitted as BSS symbol.
Comment #1 by k.hara.pg — 2013-10-13T00:55:39Z
*** This issue has been marked as a duplicate of issue 11233 ***
Comment #2 by code — 2013-10-13T09:33:19Z
Bug 11233 was resolved which dix the performance issue. We still need to do something about the rdata vs. BSS thing, otherwise zero initializers use up unnecessary space in the object files.
Comment #3 by bugzilla — 2013-10-13T13:12:20Z
Comment #4 by github-bugzilla — 2013-10-13T16:26:27Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ba8b515e0adc6471aeef0bb1cca6a4092c15c037 fix Issue 11237 - zero initializer emitted to read-only data segment, slow compilation https://github.com/D-Programming-Language/dmd/commit/fc9b88cddaf3a279dcf5ce1ec8b262c4a47020e1 Merge pull request #2660 from WalterBright/fix11237 fix Issue 11237 - zero initializer emitted to read-only data segment, sl...
Comment #5 by github-bugzilla — 2013-10-13T22:32:37Z
Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/056d444ceb70ede8dff9b5fcca5deadb42c21433 Merge pull request #2660 from WalterBright/fix11237 fix Issue 11237 - zero initializer emitted to read-only data segment, sl...
Comment #6 by code — 2013-10-31T18:39:41Z
The broke struct initializers. They are emitted to object files with a symbol size of 1 byte regardless of their actual size. Also I wonder why the initializer are now common symbols ('V') while they previously were normal uninitialized variables ('B'). Test case cat > bug.d << CODE struct Buffer { ubyte[64 * 1024] buffer; } CODE dmd2.063.2 -c bug nm -S bug.o 0000000000000000 0000000000010000 B _D4bug26Buffer6__initZ // 1-byte size and weak object dmd2.064 -c bug nm -S bug.o 0000000000000000 0000000000000001 V _D4bug26Buffer6__initZ
Comment #7 by code — 2013-10-31T19:37:39Z
Comment #8 by github-bugzilla — 2013-11-01T23:52:36Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a7985b238c08da200f1c68c50a52ee6f7aa7c941 fix ElfObj::common_block size - fix Issue 11237 - Need to explicitly pass the size of the defined common symbol as it can't be computed from the symbol type. https://github.com/D-Programming-Language/dmd/commit/ac537e9b7eb7f2910bbbbb6022a26e3eb08e348e struct initializer are not weak symbols - fix Issue 11237 - The function outdata will take care of the BSS optimization for DTallzeros. https://github.com/D-Programming-Language/dmd/commit/77632a636ae16605bb45c9f6f0ce0932adbfcf82 add test case for Issue 11237 - fix OS name of linux in Makefile https://github.com/D-Programming-Language/dmd/commit/37e15abcd77a67423f166d9de6895b63e22c4676 Merge pull request #2701 from dawgfoto/fix11237 fix Issue 11237
Comment #9 by github-bugzilla — 2013-11-01T23:53:42Z