-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Miscompile in DestinationPropagation? #146383
Copy link
Copy link
Closed
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-rustlantisArea: A miscompilation found by RustlantisArea: A miscompilation found by RustlantisC-bugCategory: This is a bug.Category: This is a bug.I-miscompileIssue: Correct Rust code lowers to incorrect machine codeIssue: Correct Rust code lowers to incorrect machine codeS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-rustlantisArea: A miscompilation found by RustlantisArea: A miscompilation found by RustlantisC-bugCategory: This is a bug.Category: This is a bug.I-miscompileIssue: Correct Rust code lowers to incorrect machine codeIssue: Correct Rust code lowers to incorrect machine codeS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Reduced example from rustlantis, which is accepted by Miri using Tree Borrows without optimizations enabled:
I'm sure this is caused by DestinationPropagation, because
accepts this code, but
reports UB (ignore the span, it's confusing because the source code that's displayed is the pre-optimization MIR):
The errant transformation rewrite the entire body:
This is probably #145541 cc @cjgillot @Amanieu