<html>
    <head>
      <base href="http://bugzilla.gdcproject.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><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">140</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Inlining certain trivial function fails
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>GDC
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>4.9.x
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>gdc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>ibuclaw@gdcproject.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>art.08.09@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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 @
<a href="http://forum.dlang.org/post/mailman.75.1396605155.19942.d.gnu@puremagic.com">http://forum.dlang.org/post/mailman.75.1396605155.19942.d.gnu@puremagic.com</a> ;
some more info in that thread.

Could be related to <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Inlining of some functions fails (arrays with qualified element types)"
   href="show_bug.cgi?id=120">http://bugzilla.gdcproject.org/show_bug.cgi?id=120</a> ,
which I thought was the same bug, but it turns out that the testcase in #120
does *not* fail here.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>