<html>
<head>
<base href="http://bugzilla.gdcproject.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - GDC emits unnecessary dead struct inits"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=147#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - GDC emits unnecessary dead struct inits"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=147">bug 147</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>The codegen is:
S a; // memset(&a, 0, S.sizeof)
a.v = argv.length // a.v = argv.length
This first step is no easy to get around, as it is supposed to fill out any
alignment holes in the struct.
This itself ensures that 'assert(a == b)' is true in most cases (uses memcmp).
I do recognise that:
1) It's generally bad to use a == b to compare structs
2) Structs that return in registers have their 0'd alignment holes destroyed
with garbage.
Perhaps we shouldn't care about filling alignment holes, but that would break
the autotester (last time I checked), and maybe some code that relies on
memcmp'ing structs for equality.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>