<html>
<head>
<base href="http://bugzilla.gdcproject.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - invalid code generation with -O2 for method returning ref"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=179#c7">Comment # 7</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - invalid code generation with -O2 for method returning ref"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=179">bug 179</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>There seems to be a key thing happening here:
---
struct SignalImpl
{
@disable this(this); // SignalImpl is now non-POD
}
---
Because of this, TypeFunction::toCtype sets TREE_ADDRESSABLE on functions
returning SignalImpl (which is correct behaviour, we do *not* want non-POD
types to return in registers).
However...
---
ref RestrictedSignal valueChanged()
{
return valueChangedSg.mRestricted; // returned by ref
}
---
Reference returns should not have TREE_ADDRESSABLE set as they are already
returning in memory.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>