Issue 148949
Summary [AArch64] Unexpected illegal type!
Labels new issue
Assignees
Reporter sjoerdmeijer
    Compiling this:

```
char a, d;
int b, c;
void e(char f[][7], bool g[][7], int h[][7][7]) {
  for (char i;;)
 for (signed j;; j += 7)
      for (bool k; k < h[4][4][1]; k = f[j][1])
#pragma clang loop vectorize(enable)
        for (int l(d); l < 17; l += bool(7)) {
          a = !g[j + 1][1] + (g[j + 1][1] ? 0 : 2);
 if (g[i][i])
            b = c = 0;
        }
}
```

with `-std=c++11 -msve-vector-bits=128 -Ofast -mcpu=grace` results an `Unexpected illegal type!` error:

```
clang++: gllvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:991: void (anonymous namespace)::SelectionDAGLegalize::LegalizeOp(SDNode *): Assertion `(TLI.getTypeAction(*DAG.getContext(), Op.getValueType()) == TargetLowering::TypeLegal || Op.getOpcode() == ISD::TargetConstant || Op.getOpcode() == ISD::Register) && "Unexpected illegal type!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: gllvm-project/build/bin/clang++ -std=c++11 -w -fPIC -msve-vector-bits=128 -Ofast -mcpu=grace -o clang_ofast_func.o -c func.cpp
1.      <eof> parser at end of file
2.      Code generation
3. Running pass 'Function Pass Manager' on module 'func.cpp'.
4.      Running pass 'AArch64 Instruction Selection' on function '@_Z1ePA7_cPA7_bPA7_A7_i'
 #0 0x0000aaaab3809a90 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) gllvm-project/llvm/lib/Support/Unix/Signals.inc:834:11
 #1 0x0000aaaab3809fb0 PrintStackTraceSignalHandler(void*) gllvm-project/llvm/lib/Support/Unix/Signals.inc:918:1
 #2 0x0000aaaab3808050 llvm::sys::RunSignalHandlers() gllvm-project/llvm/lib/Support/Signals.cpp:104:5
 #3 0x0000aaaab38092d8 llvm::sys::CleanupOnSignal(unsigned long) gllvm-project/llvm/lib/Support/Unix/Signals.inc:374:1
 #4 0x0000aaaab372b228 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) gllvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:71:7
 #5 0x0000aaaab372b65c CrashRecoverySignalHandler(int) gllvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:390:5
 #6 0x0000fffff7fb09d0 (linux-vdso.so.1+0x9d0)
 #7 0x0000fffff7a1f200 __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #8 0x0000fffff79da67c gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #9 0x0000fffff79c7130 abort ./stdlib/abort.c:81:7
#10 0x0000fffff79d3fd0 __assert_fail_base ./assert/assert.c:89:7
#11 0x0000fffff79d4040 __assert_perror_fail ./assert/assert-perr.c:31:1
#12 0x0000aaaab664c38c (anonymous namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*) gllvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:986:3
#13 0x0000aaaab664bf8c llvm::SelectionDAG::Legalize() gllvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:6120:13
#14 0x0000aaaab6770bfc llvm::SelectionDAGISel::CodeGenAndEmitDAG() gllvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1067:13
```

I don't quite understand yet why compiler explorer, see https://godbolt.org/z/GoafTc8Yx, shows a different error:

```
fatal error: error in backend: Cannot select: 0x33eb9910: i32 = zero_extend 0x33eb4df0
  0x33eb4df0: i1 = xor 0x33eb9600, Constant:i1<-1>
 0x33eb9600: i1 = truncate 0x33eb6f50
      0x33eb6f50: i32 = freeze 0x33eb9360
        0x33eb9360: i32,ch = load<(load (s8) from %ir.52, !tbaa !70, !alias.scope !73, !range !72), anyext from i8> 0x33e2b260, 0x33eb8db0, undef:i64
          0x33eb8db0: i64,ch = CopyFromReg 0x33e2b260, Register:i64 %18
In function: _Z1ePA7_cPA7_bPA7_A7_i
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to