-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
rewrite do-while loop as for loop #16187
Conversation
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#16187" |
f417754
to
78fecbf
Compare
This baffles me:
The generated .lst file and the expected .lst file are identical. |
Remove the last line.
|
78fecbf
to
27e597f
Compare
I'm expecting 100 or so lines to be removed then from blockexit, dinterpret, toir, ... |
@ibuclaw I am, too, I'm just waiting for it to work before taking a meat-axe to it. |
I'm not getting the fail220.d or the ice17074.d extra error messages on my setup. Neither of those files has a do-while in it, either. |
Thanks, that worked |
d29e2b1
to
11804dc
Compare
The 40 minute timeouts suggest an infinite loop in the compiler. |
Which means I need to replace every do-while in the compiler with a while, till I find out which one is broken. |
11804dc
to
9469eb6
Compare
A counter and a begin/end range to control when to do the old vs new behavior would allow skipping the manual code updating and allow for binary searching the codebase. |
Hi Brad! Nice to see you around. The real time waster is waiting 40 minutes for the test suite to run for each iteration. There are only a handful of do-while's in the source code, so the manual edits aren't that bad. The culprit may be in druntime, too. I must have done something stupid with this simple change, but I'm blind to what it is. Grump. |
9469eb6
to
fe6fcbb
Compare
I think I'll try your idea... |
7daf17d
to
d30b525
Compare
e0ea10e
to
9ffca38
Compare
9ffca38
to
d6c85f1
Compare
Definitely frustrating. I removed all the compiler uses of 'do' but the problem remains. |
The rewrite is not equivalent for do-while loops containing
Previously this printed the numbers from 10 to 1, but with this PR it is an endless loop always printing 10. |
@tim-dlang wow, thanks! How did you figure that out? |
Sometime ago I also wondered, why the do-while loop is not lowered like other loops. |
I'll have to think of another way to lower it! |
The way to make this work is to have the I'm going to reluctantly close this. |
I should have thought of this a long time ago.