[Bug 140] Inlining certain trivial function fails

via D.gnu d.gnu at puremagic.com
Sat Jul 12 12:50:40 PDT 2014


http://bugzilla.gdcproject.org/show_bug.cgi?id=140

art.08.09 at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |art.08.09 at gmail.com

--- Comment #2 from art.08.09 at gmail.com ---
(In reply to Johannes Pfau from comment #1)
> Try to add @attribute("forceinline") to the failing function (you might have
> to copy std.algorith to some other file, name it xtd.algorithm or
> something), then compiling should fail with some error message and you can
> use dustmite to reduce the test case.

Well, that results in basically the same testcase and a stripped-down std.array
with just the necessary primitives.

But after adding the always_inline attribute I at least got a little more
informative diagnostic:

std/algorithm.d: In member function 'pure nothrow @property @safe bool
xstd.algorithm.__T12FilterResultS633std10functional36__T8unaryFunVAyaa8_612e6c656e677468Z8unaryFunTAAyaZ.FilterResult.empty()':
std/array.d:408: error: inlining failed in call to always_inline 'pure nothrow
@property @safe bool
xstd.array.empty!(immutable(char)[]).empty(const(immutable(char)[][]))':
mismatched arguments
std/algorithm.d:1449: error: called from here


If I call std.array.empty /directly/ then there is no problem and `empty` is
properly inlined. The problem appears only when calling it via eg
std.algorithm.FilterResult.empty...

-- 
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/4532ef22/attachment.html>


More information about the D.gnu mailing list