Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Clang failed to compile LLVM IR file to executable #51426

Open Quuxplusone opened 2 years ago

Quuxplusone commented 2 years ago
Bugzilla Link PR52459
Status NEW
Importance P normal
Reported by Ryan Moreno (t-ryanmoreno@microsoft.com)
Reported on 2021-11-09 17:27:14 -0800
Last modified on 2021-11-10 08:02:53 -0800
Version 11.0
Hardware PC Windows NT
CC htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
Run script:
# Crash reproducer for clang version 11.0.1
# Driver args: "--driver-mode=g++" "-g" "-O0" "qir_driver_simple.cpp"
"Development.ll" "-I" "./" "-L./" "-lMicrosoft.Quantum.Qir.Runtime" "-
lMicrosoft.Quantum.Qir.Qsharp.Core" "-lMicrosoft.Quantum.Qir.QSharp.Foundation"
"-o" "dev-driven.exe"
# Original command:  "C:\\Program Files\\LLVM\\bin\\clang++.exe" "-cc1" "-
triple" "x86_64-pc-windows-msvc19.29.30136" "-emit-obj" "-mrelax-all" "-
mincremental-linker-compatible" "-disable-free" "-disable-llvm-verifier" "-
discard-value-names" "-main-file-name" "Development.ll" "-mrelocation-model"
"pic" "-pic-level" "2" "-mframe-pointer=none" "-fmath-errno" "-fno-rounding-
math" "-mconstructor-aliases" "-munwind-tables" "-target-cpu" "x86-64" "-gno-
column-info" "-gcodeview" "-debug-info-kind=limited" "-resource-dir"
"C:\\Program Files\\LLVM\\lib\\clang\\11.0.1" "-O0" "-fdebug-compilation-dir"
"C:\\Users\\t-ryanmoreno\\source\\repos\\MorenoRyan2021\\Testing" "-ferror-
limit" "19" "-fmessage-length=204" "-fno-use-cxa-atexit" "-fms-extensions" "-
fms-compatibility" "-fms-compatibility-version=19.29.30136" "-fdelayed-template-
parsing" "-fcolor-diagnostics" "-faddrsig" "-o" "C:\\Users\\T-
RYAN~1\\AppData\\Local\\Temp\\Development-6641d6.o" "-x" "ir" "Development.ll"
 "C:\\Program Files\\LLVM\\bin\\clang++.exe" "-cc1" "-triple" "x86_64-pc-windows-msvc19.29.30136" "-emit-obj" "-mrelax-all" "-mincremental-linker-compatible" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "Development.ll" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=none" "-fmath-errno" "-fno-rounding-math" "-mconstructor-aliases" "-munwind-tables" "-target-cpu" "x86-64" "-gno-column-info" "-gcodeview" "-debug-info-kind=limited" "-O0" "-ferror-limit" "19" "-fmessage-length=204" "-fno-use-cxa-atexit" "-fms-extensions" "-fms-compatibility" "-fms-compatibility-version=19.29.30136" "-fdelayed-template-parsing" "-fcolor-diagnostics" "-faddrsig" "-x" "ir" "qir_driver_simple-2cc965.cpp"

Stack dump:
0.      Program arguments: C:\Program Files\LLVM\bin\clang++.exe -cc1 -triple
x86_64-pc-windows-msvc19.29.30136 -emit-obj -mrelax-all -mincremental-linker-
compatible -disable-free -disable-llvm-verifier -discard-value-names -main-file-
name Development.ll -mrelocation-model pic -pic-level 2 -mframe-pointer=none -
fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-
cpu x86-64 -gno-column-info -gcodeview -debug-info-kind=limited -resource-dir
C:\Program Files\LLVM\lib\clang\11.0.1 -O0 -fdebug-compilation-dir C:\Users\t-
ryanmoreno\source\repos\MorenoRyan2021\Testing -ferror-limit 19 -fmessage-
length=204 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-
compatibility-version=19.29.30136 -fdelayed-template-parsing -fcolor-
diagnostics -faddrsig -o C:\Users\T-RYAN~1\AppData\Local\Temp\Development-
6641d6.o -x ir Development.ll
1.      Code generation
2.      Running pass 'Function Pass Manager' on module 'Development.ll'.
3.      Running pass 'X86 Assembly Printer' on function
'@Microsoft__Quantum__Qir__Development__MainFunc__body'
 #0 0x00007ff7b52e5d82 C:\Program Files\LLVM\bin\clang++.exe 0x22d5d82 C:\Program Files\LLVM\bin\clang++.exe 0x22d71d2
 #1 0x00007ff7b52e5d82 C:\Program Files\LLVM\bin\clang++.exe 0x229739a C:\Program Files\LLVM\bin\clang++.exe 0x228cfba
 #2 0x00007ff7b52e5d82 C:\Program Files\LLVM\bin\clang++.exe 0x227f393 C:\Program Files\LLVM\bin\clang++.exe 0xbfde4c
 #3 0x00007ff7b52e5d82 C:\Program Files\LLVM\bin\clang++.exe 0x1163e5d C:\Program Files\LLVM\bin\clang++.exe 0x136bf89
 #4 0x00007ff7b52e5d82 C:\Program Files\LLVM\bin\clang++.exe 0x1371a23 C:\Program Files\LLVM\bin\clang++.exe 0x136c570
 #5 0x00007ff7b52e5d82 C:\Program Files\LLVM\bin\clang++.exe 0x1b5e4ad C:\Program Files\LLVM\bin\clang++.exe 0x3b3c39f
 #6 0x00007ff7b52e5d82 C:\Program Files\LLVM\bin\clang++.exe 0x206b572 C:\Program Files\LLVM\bin\clang++.exe 0x203245c
 #7 0x00007ff7b52e5d82 C:\Program Files\LLVM\bin\clang++.exe 0x20d1248 C:\Program Files\LLVM\bin\clang++.exe 0x6be8
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
clang++: note: diagnostic msg:
Quuxplusone commented 2 years ago

This seems to be occurring because of a DILocalVariable declaration that doesn't have a type (and creating a DILocalVariable without a type argument is supported by the Native LLVM API so this should work fine). When I commented out that line and any references to it, there were no errors in compilation.