Skip to content
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

Fix issue 18461 - Do not remove assignments to ambiguous symbols #8015

Closed
wants to merge 1 commit into from

Conversation

LemonBoy
Copy link
Contributor

@LemonBoy LemonBoy commented Mar 12, 2018

If a value is reached through a pointer don't consider it as definitely
dead.

cc @WalterBright

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @LemonBoy! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
18461 major codegen bug in dmd

continue;
/* Do not remove assignments to ambiguous values as
* they might be reached trough a pointer */
if (!(v->Sflags & SFLunambig))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect the bug is elsewhere, as the testbit on b->Boutlv should take into account ambiguous values

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable doesn't escape the BB, that's why it's missing from there.
I've pushed another fix that's simpler and hopefully more correct.

Variables may be referenced via OPrelconst beside OPvar, take that into
account.
@@ -1488,6 +1488,7 @@ STATIC void accumda(elem *n,vec_t DEAD, vec_t POSS)
vec_free(Pr); vec_free(Dr);
break;

case OPrelconst:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is close, but not quite right. The fix is to add a case for OPbt. I'll work on that tomorrow.

@WalterBright
Copy link
Member

Turns out there was a bit more to fixing it. I rebooted it as #8065

Thank you for identifying where things were going wrong in the optimizer. That's 90% of the work in fixing this problem. This made it easy for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants