[Issue 4379] ICE(blockopt.c): foreach over huge tuple, only with -O

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 25 00:00:34 PDT 2010


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au
            Summary|DMD chokes on large nested  |ICE(blockopt.c): foreach
                   |loop over tuple.            |over huge tuple, only with
                   |                            |-O


--- Comment #4 from Don <clugdbug at yahoo.com.au> 2010-06-25 00:00:21 PDT ---
Only occurs when compiled with -O. It's an optimizer issue.
This hits the limit of the optimizer, which loops a maximum of 200 times,
hence the ICE at 198 elements. Bug 3681 also hits the same limit, but for a
different reason. Actually I think the problem is in the glue layer (maybe in
UnrolledStatement?) because the backend shouldn't need to do much work in this
example.


Reduced test case
----------
template BigTuple(U...) {
    alias U BigTuple;
}

alias
BigTuple!(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1) Tuple4379;

void bug4379() {
    foreach(x; Tuple4379) {    }
}

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


More information about the Digitalmars-d-bugs mailing list