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

LLVM stumbles over branch conditional on missing status register #8

Open
reinvantveer opened this issue Jul 9, 2021 · 1 comment
Open

Comments

@reinvantveer
Copy link
Contributor

reinvantveer commented Jul 9, 2021

For some very interesting effects: do

        let coin = random_number & 1;
        flipped.push(coin);

        let heads_or_tails_tile_idx = match flipped.pop() {
            None => {coin + 1}
            Some(pushed) => {pushed + 1}
        };

This results in some kind of machine code dump from LLVM

# In Register Scavenger
# Machine code for function main: NoPHIs, TracksLiveness, NoVRegs, TiedOpsRewritten
Frame Objects:
  fi#0: size=12, align=4, at location [SP-52]
... [lots of dumping]
*** Bad machine code: Using an undefined physical register ***
- function:    main
- basic block: %bb.25  (0x7fbdb81207e0)
- instruction: Bcs8 %bb.26, implicit killed $ccr
- operand 1:   implicit killed $ccr
LLVM ERROR: Found 1 machine code errors.
error: could not compile `megacoinflip`
...

_Originally posted by @reinvantveer in https://github.com/ricky26/rust-mega-drive/issues/7#issuecomment-875025971_
@reinvantveer
Copy link
Contributor Author

(more full-ish log attached)
compilation-log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant