-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Issue 15450 - ICE during CTFE of legit function #5312
Conversation
Use `scope(exit)`, then we can reduce goto jumps.
`ForeachStatement` didn't set `LabelStatement.gotoTarget` correctly, so it had broke the jump behavior during CTFE. Don't use `sc2` for the `checkLabeledLoop` argument in `ForeachStatement.semantic`, because `sc2.slabel` is not same with `sc.slabel`. (it's reset to `null` in `sc.push()`).
|
|
Please put refactorings in separate PRs. The actual bug fix here is just a handful of lines, but it comes with 240 more lines of changes. Even b09f2d8 is mostly refactorings. |
|
@WalterBright Refactoring PR is normally left, so subsequent bugfix would also be left. So in order to fix the bug quickly, I should combine the refactorings and bugfix in a PR. In this case, I cannot understand why the refactoring part should go into other PR. It has no benefit. |
|
I am not a DMD contributor, but I'll try to be objective. @9rnsr fixes a lot issues, and he is doing this quick. @WalterBright I understand that it tooks a lot of yours time to review refactoring and changes. But D/Phobos idiomatic style allows other D contributors to made PRs by they self, and probably some of them will be a part of DMD reviewers team in the future. So you will be able to spend more time for more important questions rather than review :-) In addition, I am worrying about #5309 Thank you all for fastest compiler ever! |
|
I have explained the benefit multiple times in these PRs. |
|
The other issue I have with this is the use of scope(exit). The trouble is that it sets up an exception handler frame to do this, and that's slower, even though no exceptions are thrown (none of the functions in the body are marked 'nothrow'). I want to be very parsimonious in adding in things that may slow the compiler down. We should also improve the compiler so using scope is less impactful, but we aren't there yet. So, I'll pull this if b09f2d8 is the whole PR, and the scope(exit) refactoring is not part of it. |
|
Rebased and rebooted as #5336 as Kenji's bug fix but without the refactoring and reformatting. |
Reboot #5312: fix Issue 15450 - ICE during CTFE of legit function
ForeachStatementdidn't setLabelStatement.gotoTargetcorrectly, so it had broke the jump behavior during CTFE.Don't use
sc2for thecheckLabeledLoopargument inForeachStatement.semantic, becausesc2.slabelis not same withsc.slabel. (it's reset tonullinsc.push()).