Issue 149644
Summary [AArch64] Bad machine code: Virtual register killed in block, but needed live out
Labels new issue
Assignees
Reporter sjoerdmeijer
    A build with expensive checks enabled, and with this input:

```
#include <algorithm>
bool a;
extern int h[];
extern char b[];
void i(int c[][7][7]) {
  for (short d = 0; d < 17; d += 3)
 for (int e = 0; e < 17; e += 2) {
      for (short f = 1; f < 014; f += 3) {
        h[e] |= 9;
        a = std::max(a, bool(c[d][f][2]));
      }
 for (; short(c[1][1][1]);)
        for (int g = 0; g < 7; g += 4)
 b[d] = 0;
    }
}
```

runs into this errors like these:

```
*** Bad machine code: Virtual register killed in block, but needed live out. ***
- function:    _Z4testiyixxstjbhiPA18_sPtPA18_A18_j
- basic block: %bb.6 for.body34.us.us (0xaaaab39738a0)
Virtual register %35 is used after the block.

*** Bad machine code: Virtual register killed in block, but needed live out. ***
- function:    _Z4testiyixxstjbhiPA18_sPtPA18_A18_j
- basic block: %bb.6 for.body34.us.us (0xaaaab39738a0)
Virtual register %37 is used after the block.

*** Bad machine code: Virtual register killed in block, but needed live out. ***
- function: _Z4testiyixxstjbhiPA18_sPtPA18_A18_j
- basic block: %bb.6 for.body34.us.us (0xaaaab39738a0)
Virtual register %39 is used after the block.
```

See also https://godbolt.org/z/665x9eqr4.


This could be related to https://github.com/llvm/llvm-project/issues/149585, but I am raising this separately because the error is different, i.e. this is speaking about live-outs.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to