| Issue |
55519
|
| Summary |
LLVM ERROR: Don't know how to emit this value.
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
MrMetric
|
This IR:
```llvm
@x = global i8 0
@y = constant i65 ptrtoint (i8* @x to i65)
```
causes the following output when given to LLVM 14's `llc`:
```
LLVM ERROR: Don't know how to emit this value.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: ./llvm_14.0.0/bin/llc ptr_to_i65.ll
#0 0x000000000231b3e3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./llvm_14.0.0/bin/llc+0x231b3e3)
#1 0x000000000231933e llvm::sys::RunSignalHandlers() (./llvm_14.0.0/bin/llc+0x231933e)
#2 0x000000000231b76f SignalHandler(int) Signals.cpp:0:0
#3 0x00007f00f51ff560 __restore_rt libc_sigaction.c:0:0
#4 0x00007f00f524c34c __pthread_kill_implementation pthread_kill.c:0:0
#5 0x00007f00f51ff4b8 gsignal (/usr/lib/libc.so.6+0x424b8)
#6 0x00007f00f51e9534 abort (/usr/lib/libc.so.6+0x2c534)
#7 0x0000000002297108 (./llvm_14.0.0/bin/llc+0x2297108)
#8 0x0000000002296f26 (./llvm_14.0.0/bin/llc+0x2296f26)
#9 0x0000000001d78068 (./llvm_14.0.0/bin/llc+0x1d78068)
#10 0x00000000017c637a emitGlobalConstantImpl(llvm::DataLayout const&, llvm::Constant const*, llvm::AsmPrinter&, llvm::Constant const*, unsigned long) AsmPrinter.cpp:0:0
#11 0x00000000017bc236 llvm::AsmPrinter::emitGlobalConstant(llvm::DataLayout const&, llvm::Constant const*) (./llvm_14.0.0/bin/llc+0x17bc236)
#12 0x00000000017bbb3a llvm::AsmPrinter::emitGlobalVariable(llvm::GlobalVariable const*) (./llvm_14.0.0/bin/llc+0x17bbb3a)
#13 0x00000000017c1ee7 llvm::AsmPrinter::doFinalization(llvm::Module&) (./llvm_14.0.0/bin/llc+0x17c1ee7)
#14 0x0000000001cfdec1 llvm::FPPassManager::doFinalization(llvm::Module&) (./llvm_14.0.0/bin/llc+0x1cfdec1)
#15 0x0000000001cf8161 llvm::legacy::PassManagerImpl::run(llvm::Module&) (./llvm_14.0.0/bin/llc+0x1cf8161)
#16 0x00000000006e749e main (./llvm_14.0.0/bin/llc+0x6e749e)
#17 0x00007f00f51ea310 __libc_start_call_main libc-start.c:0:0
#18 0x00007f00f51ea3c1 __libc_start_main@GLIBC_2.2.5 (/usr/lib/libc.so.6+0x2d3c1)
#19 0x00000000006e25da _start (./llvm_14.0.0/bin/llc+0x6e25da)
Aborted (core dumped)
```
This bug was found by AFL while fuzzing a compiler I wrote. When the compiler generates that IR, the LLVM API exits the program with only this output:
```
error: <unknown>:0: expected relocatable _expression_
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs