<html>
<head>
<base href="http://bugzilla.gdcproject.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - GDC writes all-zero initialisers in the rodata section"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=139#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - GDC writes all-zero initialisers in the rodata section"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=139">bug 139</a>
from <span class="vcard"><a class="email" href="mailto:ibuclaw@gdcproject.org" title="Iain Buclaw <ibuclaw@gdcproject.org>"> <span class="fn">Iain Buclaw</span></a>
</span></b>
<pre>FYI, the backend does *almost* the right thing.
.globl _D4test6Buffer6__initZ
.section .rodata
.align 64
.type _D4test6Buffer6__initZ, @object
.size _D4test6Buffer6__initZ, 65536
_D4test6Buffer6__initZ:
.zero 65536
It is able to correctly recognise that the initialiser is all zeros, and
reduces it to .zero 65536. Unfortunately, because there *is* an initialiser in
the first place means that it puts it in .section .rodata, instead of
optimising for size and putting it in .bss
What we should be doing is checking if initializer_zerop, then undoing our
work.
This has a run-time cost (it would be nice to have a test for all zeros before
building and discarding trees) but for the size reduction, it would be worth
it.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>