Issue 53105
Summary ICE on valid code: Assertion `C1->getType() == C2->getType() && "Op types should be identical!"' failed
Labels new issue
Assignees
Reporter arindam-8
    LLVM crashes when built with debug information (flags RelWithDebInfo and LLVM_ENABLE_ASSERTIONS):

llvm/lib/IR/Constants.cpp:2388: static llvm::Constant* llvm::ConstantExpr::getCompare(short unsigned int, llvm::Constant*, llvm::Constant*, bool): Assertion `C1->getType() == C2->getType() && "Op types should be identical!"' failed

The program resulting in this crash is as follows:
```

int a[];
 static int b();
 int *c() {
   int *d = b;
   return d;
 }
 int b() {
   e(&a == e);
   return 0;
 }

```
This was tested on llvm-11,12,13 and yesterday's master (llvm-14) with the following compilation command:

`clang-14 A_0e836490069ceb4a485d852034e50a9c_878_test2520436154.c`

The code is badly-typed because not all variables are declared. However, this should lead to the program being rejected with an error, and not to an ICE, so it looks like a bug.
 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to