Issue |
89514
|
Summary |
[BUG] Clang crashes when compiling IR
|
Labels |
clang
|
Assignees |
|
Reporter |
maxomatic458
|
```llvm
define i64 @main() {
entry:
; let num = 17
%_3 = alloca i64
store i64 17, i64* %_3
%_2 = load i64, i64* %_3
%_num_1 = alloca i64
store i64 %_2, i64* %_num_1
%_5 = load i64, i64* %_num_1
%_7 = alloca i64
store i64 0, i64* %_7
%_6 = load i64, i64* %_7
%_8 = icmp eq i64 %_5, %_6
br i1 %_8, label %if_9, label %else_9
if_9:
; return 0
%_11 = alloca i64
store i64 0, i64* %_11
%_10 = load i64, i64* %_11
ret i64 %_10
else_9:
%_13 = load i64, i64* %_num_1
%_15 = alloca i64
store i64 1, i64* %_15
%_14 = load i64, i64* %_15
%_16 = icmp eq i64 %_13, %_14
br i1 %_16, label %else_9, label %end_if9
else_9:
; return 1
%_18 = alloca i64
store i64 1, i64* %_18
%_17 = load i64, i64* %_18
ret i64 %_17
br label %end_if9
end_if9:
; return 0
%_20 = alloca i64
store i64 0, i64* %_20
%_19 = load i64, i64* %_20
ret i64 %_19
}
```
trying to compile this with ``clang out.ll``
will throw this error:
```
warning: overriding the module target triple with x86_64-pc-windows-msvc19.36.32535 [-Woverride-module]
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: "C:\\Program Files\\LLVM\\bin\\clang.exe" -cc1 -triple x86_64-pc-windows-msvc19.36.32535 -emit-obj -mrelax-all -mincremental-linker-compatible -dumpdir a- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name out.ll -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -fdebug-compilation-dir=C:\\Users\\User\\Desktop\\compiler\\compiler2 -fcoverage-compilation-dir=C:\\Users\\User\\Desktop\\compiler\\compiler2 -resource-dir "C:\\Program Files\\LLVM\\lib\\clang\\18" -ferror-limit 19 -fmessage-length=209 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.36.32535 -fskip-odr-check-in-gmf -fdelayed-template-parsing -fcolor-diagnostics -faddrsig -o C:\\Users\\User\\AppData\\Local\\Temp\\out-5d0151.o -x ir out.ll
1. Code generation
2. Running pass 'Function Pass Manager' on module 'out.ll'.
3. Running pass 'X86 DAG->DAG Instruction Selection' on function '@main'
Exception Code: 0xC0000005
#0 0x00007ff731d5434f (C:\Program Files\LLVM\bin\clang.exe+0x277434f)
#1 0x00007ff731767344 (C:\Program Files\LLVM\bin\clang.exe+0x2187344)
#2 0x00007ff7316cc2ce (C:\Program Files\LLVM\bin\clang.exe+0x20ec2ce)
#3 0x00007ff7316b0673 (C:\Program Files\LLVM\bin\clang.exe+0x20d0673)
#4 0x00007ff7316af20b (C:\Program Files\LLVM\bin\clang.exe+0x20cf20b)
#5 0x00007ff7317f3616 (C:\Program Files\LLVM\bin\clang.exe+0x2213616)
#6 0x00007ff72f997699 (C:\Program Files\LLVM\bin\clang.exe+0x3b7699)
#7 0x00007ff731682efe (C:\Program Files\LLVM\bin\clang.exe+0x20a2efe)
#8 0x00007ff7316a3d43 (C:\Program Files\LLVM\bin\clang.exe+0x20c3d43)
#9 0x00007ff72f922091 (C:\Program Files\LLVM\bin\clang.exe+0x342091)
#10 0x00007ff72f921b5d (C:\Program Files\LLVM\bin\clang.exe+0x341b5d)
#11 0x00007ff72f91b9e9 (C:\Program Files\LLVM\bin\clang.exe+0x33b9e9)
#12 0x00007ff72fc92876 (C:\Program Files\LLVM\bin\clang.exe+0x6b2876)
#13 0x00007ff72fb8d8e1 (C:\Program Files\LLVM\bin\clang.exe+0x5ad8e1)
#14 0x00007ff72fb8d382 (C:\Program Files\LLVM\bin\clang.exe+0x5ad382)
#15 0x00007ff72fb8a0b4 (C:\Program Files\LLVM\bin\clang.exe+0x5aa0b4)
#16 0x00007ff72fb87c30 (C:\Program Files\LLVM\bin\clang.exe+0x5a7c30)
#17 0x00007ff72fb865fe (C:\Program Files\LLVM\bin\clang.exe+0x5a65fe)
#18 0x00007ff72f9c607c (C:\Program Files\LLVM\bin\clang.exe+0x3e607c)
#19 0x00007ff72f9c1cc3 (C:\Program Files\LLVM\bin\clang.exe+0x3e1cc3)
#20 0x00007ff731ae4050 (C:\Program Files\LLVM\bin\clang.exe+0x2504050)
#21 0x00007ffc7c207344 (C:\Windows\System32\KERNEL32.DLL+0x17344)
#22 0x00007ffc7cee26b1 (C:\Windows\SYSTEM32\ntdll.dll+0x526b1)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 18.1.4
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
clang: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
```
it seems to crash because the label ``else_9`` is defined 2 times
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs