D-Programming-Language/dmd — pull request #2136 by donc (2013-06-05 11:20:07+00:00)
Title: Do all interpreting inside CTFE instead of in optimize(WANTinterpret)

This is ultimate goal I've been working towards with all my CTFE patches over the past 18 months. It will fail until all of my remaining patches are merged in.
Once this passes, CTFE will be able to use proper variable storage, fixing a multitude of bugs, and JIT compilation will become possible.
----
The reason why merging optimize(WANTinterpret) and CTFE is necessary is that in things like:
const int x = bar[ { return $-1; } ];
__dollar is a temporary variable, which CTFE needs to read, but it's not declared in a CTFE function. It's not possible to JIT compile a CTFE function without creating a stack to put all its parameters on.