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

Miscompilation introduced by CopyPropagation #76740

Closed
tmiasko opened this issue Sep 15, 2020 · 2 comments · Fixed by #77373
Closed

Miscompilation introduced by CopyPropagation #76740

tmiasko opened this issue Sep 15, 2020 · 2 comments · Fixed by #77373
Labels
A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@tmiasko
Copy link
Contributor

tmiasko commented Sep 15, 2020

To reproduce the issue:

  • Checkout 41dc394 (for reproducibility, but might be unnecessary).
  • Enable copy propagation so that it runs on mir-opt-level=1.
  • ./x.py test --stage 2 src/test/ui (disable incremental compilation, so that rustc is rebuild completely).
  • Observe tests failures: "not all trait items implemented, missing ...".
@tmiasko tmiasko added the C-bug Category: This is a bug. label Sep 15, 2020
@jonas-schievink jonas-schievink added A-mir-opt Area: MIR optimizations I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness requires-nightly This issue requires a nightly compiler in some way. labels Sep 15, 2020
@jyn514 jyn514 added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 15, 2020
@tmiasko
Copy link
Contributor Author

tmiasko commented Sep 20, 2020

The copy propagation incorrectly assumes that a use of a local in Operand::Move will not mutate it.

@jonas-schievink
Copy link
Contributor

#72632 has landed now, so we could remove CopyPropagation and focus on that instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants