http://bugzilla.gdcproject.org/show_bug.cgi?id=140
Bug ID: 140
Summary: Inlining certain trivial function fails
Product: GDC
Version: 4.9.x
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Normal
Component: gdc
Assignee: [email protected]
Reporter: [email protected]
GDC fails to inline some trivial functions (like array.empty) in certain cases.
The simplest testcase (that i can think of) that still exhibits the problem:
import std.array, std.algorithm;
immutable a = [1];
int main() {
return a.filter!"true"().empty;
}
This gets compiled to:
<_Dmain>:
sub $0x18,%rsp
mov $0x1,%edi
mov $0x65d968,%esi
callq <pure nothrow @property @safe bool
std.array.empty!(int).empty(const(int[]))>
add $0x18,%rsp
movzbl %al,%eax
retq
Originally reported on ML @
http://forum.dlang.org/post/[email protected] ;
some more info in that thread.
Could be related to http://bugzilla.gdcproject.org/show_bug.cgi?id=120 ,
which I thought was the same bug, but it turns out that the testcase in #120
does *not* fail here.
--
You are receiving this mail because:
You are watching all bug changes.