http://d.puremagic.com/issues/show_bug.cgi?id=4504

           Summary: Internal compiler error using std.algorithm.count with
                    recursive nested function in release.
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: peter.alexander...@gmail.com


--- Comment #0 from Peter Alexander <peter.alexander...@gmail.com> 2010-07-25 
04:44:05 PDT ---
Compiling the following produces the error at compile time: "Internal error:
toir.c 190"

import std.algorithm;
import std.range;

void main()
{
    int foo(int i) { return i == 1 ? 1 : foo(1); }
    auto x = count(map!foo(iota(1, 2)), 1);
}

Only happens when:
- foo is recursive
- foo is a local function (doesn't happen if it is global)
- when using count (calling the function alone, or just mapping is fine)
- when compiling with (-inline)

If any one of these conditions isn't met then the code compiles as expected.

Note that while I have only noticed that std.algorithm.count causes this
problem, and std.algorithm.map doesn't, I haven't tested any other algorithms.

I'm using DMD 2.047.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to