Skip to content

LLVM stumbles over branch conditional on missing status register #8

@reinvantveer

Description

@reinvantveer

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_

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions