An LLVM bug that affect both LDC and SDC. Worth pushing for
Iain Buclaw via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jun 18 02:28:38 PDT 2014
On 16 June 2014 20:37, deadalnix via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Monday, 16 June 2014 at 19:18:29 UTC, Iain Buclaw via Digitalmars-d
> wrote:
>>
>> On 16 June 2014 17:31, safety0ff via Digitalmars-d
>> <digitalmars-d at puremagic.com> wrote:
>>>
>>> On Monday, 16 June 2014 at 06:09:28 UTC, deadalnix wrote:
>>>>
>>>>
>>>> http://llvm.org/bugs/show_bug.cgi?id=20049
>>>>
>>>> Basically when you have a closure in a closure and the whole thing get
>>>> inlined, LLVM mess up, which result in compiler not being able to
>>>> optimize
>>>> GC allocation away.
>>>>
>>>> Probably worth pushing for. It does probably affect other functional
>>>> languages as well, but I didn't checked.
>>>
>>>
>>>
>>> This is the corresponding D code:
>>> https://github.com/deadalnix/SDC/blob/master/tests/test0156.d
>>>
>>> Correct?
>>
>>
>> That code shouldn't create a GC allocated closure. :o)
>
>
> Change return bar to return &bar and you got one possible candidate to
> trigger the bug.
Yeah, I did get that bit. I'm not sure of the optimisation though.
IMO, the closure/frame generation should occur *after* inlining.
More information about the Digitalmars-d
mailing list