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

Rollup of 10 pull requests #77013

Merged
merged 21 commits into from
Sep 21, 2020
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
69ffed7
Add error explanation for E0755
GuillaumeGomez Sep 7, 2020
a06edda
Fix segfault if pthread_getattr_np fails
tavianator Sep 9, 2020
a684153
Only call pthread_attr_destroy() after getattr_np() succeeds on all l…
tavianator Sep 9, 2020
026922a
make replace_prefix only take &str as arguments
matthiaskrgr Sep 17, 2020
65edf54
Add a regression test for copy propagation miscompilation
tmiasko Sep 20, 2020
5ef1db3
Revert adding Atomic::from_mut.
m-ou-se Sep 20, 2020
d99bb9d
liballoc bench use imported path Bencher
pickfire Sep 20, 2020
37ec045
BTreeMap: extra testing unveiling mistakes in future PR
ssomers Sep 19, 2020
fc20b78
Fix typo in rustc_lexer docs
LingMan Sep 21, 2020
9172e27
Dogfood total_cmp in the test crate
est31 Sep 21, 2020
57baec7
update Miri for another bugfix
RalfJung Sep 21, 2020
670e204
Rollup merge of #76439 - GuillaumeGomez:add-error-explanation-e0755, …
RalfJung Sep 21, 2020
ae4b677
Rollup merge of #76521 - tavianator:fix-pthread-getattr-destroy, r=Am…
RalfJung Sep 21, 2020
982c4a9
Rollup merge of #76835 - matthiaskrgr:replace_prefix, r=lcnr
RalfJung Sep 21, 2020
b0c2eab
Rollup merge of #76967 - fusion-engineering-forks:revert-atomic-from-…
RalfJung Sep 21, 2020
9c14ef5
Rollup merge of #76977 - tmiasko:issue-76740, r=wesleywiser
RalfJung Sep 21, 2020
4b362bb
Rollup merge of #76981 - pickfire:patch-5, r=Mark-Simulacrum
RalfJung Sep 21, 2020
4547ebb
Rollup merge of #76983 - ssomers:btree_extra_test, r=Mark-Simulacrum
RalfJung Sep 21, 2020
48fc20c
Rollup merge of #76996 - LingMan:patch-1, r=ecstatic-morse
RalfJung Sep 21, 2020
fb3cb14
Rollup merge of #77009 - est31:dogfood_total_cmp, r=lcnr
RalfJung Sep 21, 2020
6417eb0
Rollup merge of #77012 - RalfJung:miri, r=RalfJung
RalfJung Sep 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a regression test for copy propagation miscompilation
  • Loading branch information
tmiasko committed Sep 20, 2020
commit 65edf54c256e5369fdf9c0a972cd83d2414d5bb5
30 changes: 30 additions & 0 deletions src/test/ui/mir/issue-76740-copy-propagation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Regression test for issue #76740.
// run-fail FIXME: change to run-pass once #76899 lands
// compile-flags: -Zmir-opt-level=3

#[derive(Copy, Clone)]
pub struct V([usize; 4]);

impl V {
fn new() -> Self {
V([0; 4])
}

#[inline(never)]
fn check(mut self) {
assert_eq!(self.0[0], 0);
self.0[0] = 1;
}
}

fn main() {
let v = V::new();
let mut i = 0;
while i != 10 {
// Copy propagation incorrectly assumed that Operand::Move does not
// mutate the local, and used the same v for each V::check call,
// rather than a copy.
v.check();
i += 1;
}
}