Inlining problems again

Artur Skawina art.08.09 at gmail.com
Fri Apr 4 06:42:18 PDT 2014


On 04/04/14 15:14, Johannes Pfau wrote:
> Am Fri, 04 Apr 2014 11:52:13 +0200
> schrieb Artur Skawina <art.08.09 at gmail.com>:
> 
>> Built latest gcc4-8-based gdc (fdf0c614) today; immediately ran into
>> this:
>>
>> Which is much more reasonable, and shouldn't require such hacks.
>> I thought that inlining /templated/ functions across modules already
>> worked; is this a different problem, and, more importantly, is it
>> fixable?

> Please try to reduce such examples in the future ;-)

Sorry. Yes, I should have tried harder.

[I'm probably subconsciously avoiding going near any phobos code... :)]


> http://goo.gl/SJ0iEq
> http://goo.gl/ykumCI
> 
> @property bool empty(T)(in T[] a) @safe pure nothrow
> 
> it's the 'in' which causes inlining to fail (const also fails).

Hmm, I remember const-args were a problem in the past, but I had
thought this was already fixed. A quick search reveals:

http://gdcproject.org/bugzilla/show_bug.cgi?id=37 (-ENOPERM)
https://bitbucket.org/goshawk/gdc/issue/300/array-empty-function-does-not-get-inlined
 (which says WONTFIX, but IIRC Iain fixed)

artur


More information about the D.gnu mailing list