[Bug 140] New: Inlining certain trivial function fails

via D.gnu d.gnu at puremagic.com
Sat Jul 12 08:39:54 PDT 2014


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: ibuclaw at gdcproject.org
          Reporter: art.08.09 at gmail.com

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/mailman.75.1396605155.19942.d.gnu@puremagic.com ;
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20140712/7ce651ab/attachment.html>


More information about the D.gnu mailing list