Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

MatchBranchSimplication (a disabled mir-opt) is unsound #78239

Closed

Description

@pnkfelix

Spawned off of PR #78151, which turned the mir-opt MatchBranchSimplification off by default.

I just want a dedicated issue for discussing the unsoundness identified there, and to track how resolve this bug in the mir-opt (and then maybe turn it back on again, if it can pay for its own cost, which it might not have done before...)

Activity

  1. added
    C-bug
    on Oct 22, 2020
  2. changed the title [-]MatchBranchSimplication is unsound[/-] [+]MatchBranchSimplication (a disabled mir-opt) is unsound[/+] on Oct 22, 2020
  3. added
    A-mir-opt
    on Oct 22, 2020
  4. added
    I-unsound
    on Oct 22, 2020
  5. added
    I-prioritize
    on Oct 22, 2020
  6. removed
    I-prioritize
    on Oct 22, 2020
  7. added
    T-compiler
    on Oct 22, 2020
  8. tmiasko commented on Nov 3, 2020

    @tmiasko
    Contributor

    For the record, an example code that was being miscompiled:

    fn main() {
        let a = &mut true;
        let b;
        match  *a {
            true => {
                *a = false;
                b = true;
                ()
            }
            _ => {
                *a = false;
                b = false;
                ()
            }
        };
        assert!(b);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-optC-bugI-unsoundT-compiler

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions