New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do all interpreting inside CTFE instead of in optimize(WANTinterpret) #2136
Do all interpreting inside CTFE instead of in optimize(WANTinterpret) #2136
Conversation
Note that the "run semantic on global variables" commit isn't doing anything new, it is just moving a couple of lines of code from optimize.c into interpret.c. |
The recent default argument stuff has changed when it is valid to use pointer comparison to compare types, and I expect this is what is causing the failure here. |
Only seems to happen with forward-referenced globals, for example: const int c23 = b23 * b23; const int a23 = 1; const int b23 = a23 * 3;
instead of in the optimizer
It is no longer used.
This is finally ready, after 18 months and 53 pull requests! Please merge this now. |
Do all interpreting inside CTFE instead of in optimize(WANTinterpret)
Rock on, Don! You da man! |
Thanks, Walter! This was the toughest bit of work I've ever done in the compiler. The number of bugs it exposed was incredible. |
Awesome work! |
Awesome indeed! |
Just a note, a regression has come up with this commit: http://d.puremagic.com/issues/show_bug.cgi?id=10722 |
Another regression: http://d.puremagic.com/issues/show_bug.cgi?id=10687 |
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.