<html>
<head>
<base href="http://bugzilla.gdcproject.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Inlining certain trivial function fails"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=140#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Inlining certain trivial function fails"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=140">bug 140</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>Reduced:
test.d
----------------------------------------------------
import xtd.array;
int main()
{
void[] a = [];
return (FilterResult!(void[])(a)).empty;
}
struct FilterResult(Range)
{
Range _input;
@property empty() { return xtd.array.empty(_input); }
}
----------------------------------------------------
xtd/array.d
----------------------------------------------------
import gcc.attribute;
@attribute("forceinline") @property empty(T)(in T[] a)
{
return !a.length;
}
----------------------------------------------------
gdc test.d -finline
----------------------------------------------------
test.d: In member function 'empty':
xtd/array.d:3: error: inlining failed in call to always_inline 'empty':
mismatched arguments
test.d:14: error: called from here
----------------------------------------------------
Merging array.d/test.d leads to a different error:
test.d
----------------------------------------------------
import gcc.attribute;
@attribute("forceinline") @property empty2(T)(in T[] a)
{
return !a.length;
}
int main()
{
void[] a = [];
return (FilterResult!(void[])(a)).empty;
}
struct FilterResult(Range)
{
Range _input;
@property empty() { return empty2(_input); }
}
----------------------------------------------------
gdc test.d -finline
----------------------------------------------------
cc1d: /build/gdc/src/gcc-4.9.0/gcc/d/dfrontend/interpret.c:676: void
FuncDeclaration::ctfeCompile(): Assertion `semanticRun == PASSsemantic3done'
failed.
test.d: In member function 'empty':
test.d:18: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <<a href="https://bugs.archlinux.org/">https://bugs.archlinux.org/</a>> for instructions.
----------------------------------------------------
This error vanishes if the forceinline attribute is removed.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>