[dmd-internals] dmd commit, revision 821
Brad Roberts
braddr at puremagic.com
Mon Dec 27 12:11:22 PST 2010
Thanks for the explanation. Makes sense and makes the bug fix make more
sense too.
On Mon, 27 Dec 2010, Don Clugston wrote:
>
> On 27 December 2010 09:01, Brad Roberts <braddr at puremagic.com> wrote:
> > Would this alternative be better (totally untested)?
> >
> > // Each pass through the loop can reduce only one level of comma expression.
> > // The infinite loop check needs to take this into account.
> > int iterationLimit = 200;
> > for (b = startblock; b; b = b->Bnext)
> > {
> > if (!b->Belem)
> > continue;
> > int d = el_countCommas(b->Belem);
> > iterationLimit += d;
> > }
> >
> > The justification being that each comma operator really ought to have a chance
> > to be reduced, not just the first max number of commas in a single block.
>
> No, it doesn't work like that. The optimizer drops one level of comma
> expressions on _every_ expression tree in the block.
> The number of iterations is determined by the maximum, not the total.
> Also note that this commit does *not* affect the generated code in any
> way, it's used only in an assert, to check for infinite loops in the
> optimizer.
>
> There is a further explanation in the patch I attached to the bug report.
>
> >> bugzilla 3681 ICE(go.c): when function takes too long to optimize, only with -O.
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals
>
More information about the dmd-internals
mailing list