<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#c7">Comment # 7</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:johannespfau@gmail.com" title="Johannes Pfau <johannespfau@gmail.com>"> <span class="fn">Johannes Pfau</span></a>
</span></b>
<pre>I'm doing some experiments with D on microcontrollers lately (AVR 8 bit
hello-world(blinking LED) is working: <a href="https://github.com/jpf91/GDC/tree/microD">https://github.com/jpf91/GDC/tree/microD</a>
) and I came across this again.
This bugfix leads to the strange situation that zero initializers are a
performance penalty on these systems as RW memory is scarce, but intilizers
with one member not set to zero are put into .rodata and are therefore a better
option.
GCC puts all zero initialzed objects into rodata as well:
------------------------------------------------------------
struct Test
{
int a;
int b;
};
const struct Test tb = {0,0};
------------------------------------------------------------
.globl tb
.section .rodata
.align 4
.type tb, @object
.size tb, 8
tb:
.zero 8
------------------------------------------------------------
So are there any objections against reverting this commit?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>