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

           Summary: ICE with 199 or 200 repeated integer increments w/
                    optimisation
           Product: D
           Version: D2
          Platform: x86
        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> 2011-12-22 
14:53:02 PST ---
This is a bit of a bizarre one. If you have 199 or 200 repeated integer
increments then you get an ICE when optimisations are enabled.

string rep(string s, int n)
{
    return n > 1 ? s ~ rep(s, n-1) : s;
}

void main()
{
    int i;
    version (A) mixin(rep("++i;", 198));
    version (B) mixin(rep("++i;", 199));
    version (C) mixin(rep("++i;", 200));
    version (D) mixin(rep("++i;", 201));
}


% time dmd test.d -O -version=A
dmd test.d -O -version=A  0.53s user 0.03s system 80% cpu 0.687 total

% time dmd test.d -O -version=B
Internal error: ../ztc/go.c 242
dmd test.d -O -version=B  0.49s user 0.01s system 95% cpu 0.528 total

% time dmd test.d -O -version=C
Internal error: ../ztc/go.c 242
dmd test.d -O -version=C  0.50s user 0.01s system 92% cpu 0.547 total

% time dmd test.d -O -version=D
dmd test.d -O -version=D  0.54s user 0.03s system 93% cpu 0.613 total


Notice the internal errors in versions B and C, but not A or D.

With no -O flag, there is no ICE in any version.

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

Reply via email to