Skip to content

Unexplained alt + expression block failure #940

Closed

Description

@marijnh

See patch 43b219d . The code before the patch runs fine with optimization turned off, but corrupts the result of the alt (when the third, bottom branch was taken) when optimization is on. This simple transformation -- assigning to a variable instead of returning from the block, removes the issue.

Either this is a really obscure compilation bug (I've failed to create a reduced test case so far), or it's some kind of corruption in another part of the compiler that shows up unpredictably based on the shape of the code.

Activity

  1. marijnh commented on Sep 22, 2011

    @marijnh
    ContributorAuthor

    I've been digging into this today. It is apparently related to LLVM moving the load from the return pointer above the function call, resulting in garbage. This only occurs in very specific circumstances. It appears to be an LLVM bug. Trying to get some LLVM person to comment on it (https://gist.github.com/1235034)

  2. brson commented on Sep 22, 2011

    @brson
    Contributor

    Nice sleuthing!

  3. marijnh commented on Sep 23, 2011

    @marijnh
    ContributorAuthor

    This is fixed in LLVM.. I'll close this issue the next time we update LLVM on the tinderboxes.

    (At which point we should also remove the val_ty hack near https://github.com/graydon/rust/blob/master/src/comp/middle/trans_alt.rs#L429 )

  4. marijnh commented on Oct 9, 2011

    @marijnh
    ContributorAuthor

    LLVM was upgraded, so this should not occur anymore. Closing.

  5. added a commit that references this issue on Aug 21, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions