-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
CodeGenWindowsPlatform: WindowsPlatform: WindowsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaredebug infoArea → compiler → IRGen: Debug information emissionArea → compiler → IRGen: Debug information emissiontransfer candidateThe issue may belong in another repositoryThe issue may belong in another repository
Description
Description
When building SourceKit-LSP with debug information using the CodeView format, we trigger an assertion in the assembler.
Reproduction
; RUN: %llc -filetype obj -o /dev/null %s
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-windows-msvc19.37.32825"
%TSi = type <{ i64 }>
define swifttailcc void @"$s12SourceKitLSP0aB6ServerC14workspaceTestsySay08LanguageD8Protocol19WorkspaceSymbolItemOGSgAE0iF7RequestVYaKFTY0_"() !dbg !5 {
entryresume.0:
br label %.from.63
.from.63: ; preds = %.from.63, %entryresume.0
%0 = phi i64 [ 0, %entryresume.0 ], [ %4, %.from.63 ]
%.location.isSystem = getelementptr %TSi, ptr null, i64 %0
%1 = load i64, ptr %.location.isSystem, align 8
%.location.line = getelementptr %TSi, ptr null, i64 %0
%2 = load i64, ptr %.location.line, align 8
call void @llvm.dbg.value(metadata ptr %.location.isSystem, metadata !9, metadata !DIExpression(DW_OP_deref, DW_OP_LLVM_fragment, 584, 1)), !dbg !22
call void @llvm.dbg.value(metadata ptr %.location.line, metadata !9, metadata !DIExpression(DW_OP_deref, DW_OP_LLVM_fragment, 585, 64)), !dbg !22
%3 = load volatile ptr, ptr null, align 8, !dbg !30
%4 = add i64 %0, 1
br label %.from.63
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare void @llvm.dbg.value(metadata, metadata, metadata) #0
; uselistorder directives
uselistorder ptr @llvm.dbg.value, { 1, 0 }
attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!0 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !1, producer: "Swift version 5.11-dev (LLVM 572a5a4fbafb69e, Swift ebbb9de104d5682)", isOptimized: true, flags: "-private-discriminator _A0745CB010D215CC0C4A68539F8BE5E9", runtimeVersion: 5, emissionKind: FullDebug, imports: !2, sysroot: "S:/Program Files/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk", sdk: "Windows.sdk")
!1 = !DIFile(filename: "S:\\SourceCache\\swift-project\\sourcekit-lsp\\Sources\\SourceKitLSP\\TestDiscovery.swift", directory: "S:\\b\14")
!2 = !{}
!3 = !{i32 2, !"CodeView", i32 1}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = distinct !DISubprogram(name: "workspaceTests", linkageName: "$s12SourceKitLSP0aB6ServerC14workspaceTestsySay08LanguageD8Protocol19WorkspaceSymbolItemOGSgAE0iF7RequestVYaKFTY0_", scope: !6, file: !1, line: 35, type: !7, scopeLine: 35, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, declaration: !8, retainedNodes: !2, thrownTypes: !2)
!6 = !DIModule(scope: null, name: "SourceKitLSP", includePath: "S:\\SourceCache\\swift-project\\sourcekit-lsp\\Sources\\SourceKitLSP")
!7 = !DISubroutineType(types: !2)
!8 = !DISubprogram(name: "workspaceTests", linkageName: "$s12SourceKitLSP0aB6ServerC14workspaceTestsySay08LanguageD8Protocol19WorkspaceSymbolItemOGSgAE0iF7RequestVYaKFTY0_", scope: !6, file: !1, line: 35, type: !7, scopeLine: 35, spFlags: DISPFlagOptimized, thrownTypes: !2)
!9 = !DILocalVariable(name: "$0", arg: 1, scope: !10, file: !1, line: 41, type: !18)
!10 = distinct !DISubprogram(linkageName: "$s12SourceKitLSP0aB6ServerC14workspaceTestsySay08LanguageD8Protocol19WorkspaceSymbolItemOGSgAE0iF7RequestVYaKFSb12IndexStoreDB0J10OccurrenceVXEfU0_", scope: !11, file: !1, line: 41, type: !17, scopeLine: 41, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2, thrownTypes: !13)
!11 = distinct !DISubprogram(name: "workspaceTests", linkageName: "$s12SourceKitLSP0aB6ServerC14workspaceTestsySay08LanguageD8Protocol19WorkspaceSymbolItemOGSgAE0iF7RequestVYaKF", scope: !6, file: !1, line: 35, type: !7, scopeLine: 35, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, declaration: !12, retainedNodes: !2, thrownTypes: !13)
!12 = !DISubprogram(name: "workspaceTests", linkageName: "$s12SourceKitLSP0aB6ServerC14workspaceTestsySay08LanguageD8Protocol19WorkspaceSymbolItemOGSgAE0iF7RequestVYaKF", scope: !6, file: !1, line: 35, type: !7, scopeLine: 35, spFlags: DISPFlagOptimized, thrownTypes: !13)
!13 = !{!14}
!14 = !DICompositeType(tag: DW_TAG_structure_type, name: "Error", scope: !16, file: !15, size: 64, elements: !2, runtimeLang: DW_LANG_Swift, identifier: "$ss5Error_pD")
!15 = !DIFile(filename: "S:\\Program Files\\Swift\\Platforms\\Windows.platform\DEveloper\\SDKs\\Windows.sdk\\usr\\lib\\swift\\windows\\Swift.swiftmodule\\x86_64-unknown-windows-msvc.swiftmodule", directory: "S:\\")
!16 = !DIModule(scope: null, name: "Swift", configMacros: "\22-D_CRT_SECURE_NO_WARNINGS\22 \22-D_MT\22 \22-D_DLL\22", includePath: "S:/Program Files/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk\\usr\\lib\\swift\\windows\\Swift.swiftmodule\\x86_64-unknown-windows-msvc.swiftmodule")
!17 = distinct !DISubroutineType(types: !2)
!18 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !19)
!19 = !DICompositeType(tag: DW_TAG_structure_type, name: "SymbolOccurrence", scope: !21, file: !20, size: 960, elements: !2, runtimeLang: DW_LANG_Swift, identifier: "$s12IndexStoreDB16SymbolOccurrenceVD")
!20 = !DIFile(filename: "13\\swift\\IndexStoreDB.swiftmodule", directory: "S:\\b")
!21 = !DIModule(scope: null, name: "IndexStoreDB", configMacros: "\22-D_CRT_SECURE_NO_WARNINGS\22 \22-D_MT\22 \22-D_DLL\22", includePath: "S:\\b\\13\\swift\\IndexStoreDB.swiftmodule")
!22 = !DILocation(line: 41, scope: !10, inlinedAt: !23)
!23 = distinct !DILocation(line: 0, scope: !24, inlinedAt: !28)
!24 = distinct !DISubprogram(name: "filter", linkageName: "$ss14_ArrayProtocolPsE6filterySay7ElementQzGSbAEKXEKFSay12IndexStoreDB16SymbolOccurrenceVG_Tg5", scope: !16, file: !25, type: !26, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, declaration: !27, thrownTypes: !2)
!25 = !DIFile(filename: "<compiler-generated>", directory: "")
!26 = distinct !DISubroutineType(types: !2)
!27 = !DISubprogram(name: "filter", linkageName: "$ss14_ArrayProtocolPsE6filterySay7ElementQzGSbAEKXEKFSay12IndexStoreDB16SymbolOccurrenceVG_Tg5", scope: !16, file: !25, type: !26, spFlags: DISPFlagLocalToUnit | DISPFlagOptimized, thrownTypes: !2)
!28 = distinct !DILocation(line: 41, scope: !29)
!29 = distinct !DILexicalBlock(scope: !5, file: !1, line: 36)
!30 = !DILocation(line: 24, scope: !31, inlinedAt: !34)
!31 = distinct !DILexicalBlock(scope: !32, file: !1, line: 24)
!32 = distinct !DISubprogram(name: "canBeTestDefinition.get", linkageName: "$s12IndexStoreDB16SymbolOccurrenceV12SourceKitLSPE19canBeTestDefinition33_A0745CB010D215CC0C4A68539F8BE5E9LLSbvg", scope: !6, file: !1, line: 23, type: !17, scopeLine: 23, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, declaration: !33, retainedNodes: !2)
!33 = !DISubprogram(name: "canBeTestDefinition.get", linkageName: "$s12IndexStoreDB16SymbolOccurrenceV12SourceKitLSPE19canBeTestDefinition33_A0745CB010D215CC0C4A68539F8BE5E9LLSbvg", scope: !6, file: !1, line: 23, type: !17, scopeLine: 23, spFlags: DISPFlagLocalToUnit | DISPFlagOptimized)
!34 = distinct !DILocation(line: 41, scope: !10, inlinedAt: !23)
Stack dump
0x00007FF757F9CFA5, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x177CFA5 byte(s), HandleAbort() + 0x5 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\lib\Support\Windows\Signals.inc, line 419 + 0x0 byte(s)
0x00007FFF1D92E5F5, C:\Windows\System32\ucrtbase.dll(0x00007FFF1D8B0000) + 0x7E5F5 byte(s), raise() + 0x1E5 byte(s)
0x00007FFF1D92F601, C:\Windows\System32\ucrtbase.dll(0x00007FFF1D8B0000) + 0x7F601 byte(s), abort() + 0x31 byte(s)
0x00007FFF1D93106A, C:\Windows\System32\ucrtbase.dll(0x00007FFF1D8B0000) + 0x8106A byte(s), _get_wpgmptr() + 0x199A byte(s)
0x00007FFF1D930F5D, C:\Windows\System32\ucrtbase.dll(0x00007FFF1D8B0000) + 0x80F5D byte(s), _get_wpgmptr() + 0x188D byte(s)
0x00007FFF1D9311F1, C:\Windows\System32\ucrtbase.dll(0x00007FFF1D8B0000) + 0x811F1 byte(s), _wassert() + 0x71 byte(s)
0x00007FF757A855B9, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x12655B9 byte(s), computeLabelDiff() + 0xF9 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\lib\MC\MCCodeView.cpp, line 461 + 0x24 byte(s)
0x00007FF757A86388, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x1266388 byte(s), llvm::CodeViewContext::encodeDefRange() + 0x108 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\lib\MC\MCCodeView.cpp, line 624 + 0xE byte(s)
0x00007FF757A68A34, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x1248A34 byte(s), llvm::MCAssembler::relaxFragment() + 0x4E4 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\lib\MC\MCAssembler.cpp, line 1193 + 0x24 byte(s)
0x00007FF757A67B42, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x1247B42 byte(s), llvm::MCAssembler::layout() + 0x2A2 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\lib\MC\MCAssembler.cpp, line 847 + 0x92 byte(s)
0x00007FF757A66916, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x1246916 byte(s), llvm::MCAssembler::Finish() + 0x26 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\lib\MC\MCAssembler.cpp, line 951 + 0x0 byte(s)
0x00007FF7573AE261, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0xB8E261 byte(s), llvm::AsmPrinter::doFinalization() + 0x17A1 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\lib\CodeGen\AsmPrinter\AsmPrinter.cpp, line 2422 + 0x0 byte(s)
0x00007FF7578BE4A6, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x109E4A6 byte(s), llvm::FPPassManager::doFinalization() + 0x86 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\lib\IR\LegacyPassManager.cpp, line 1499 + 0x56 byte(s)
0x00007FF7578C4422, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x10A4422 byte(s), `anonymous namespace'::MPPassManager::runOnModule() + 0x422 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\lib\IR\LegacyPassManager.cpp, line 1586 + 0x52 byte(s)
0x00007FF7578C3A47, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x10A3A47 byte(s), llvm::legacy::PassManager::run() + 0xE7 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\lib\IR\LegacyPassManager.cpp, line 1677 + 0xCF byte(s)
0x00007FF75687C808, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x5C808 byte(s), compileModule() + 0x1E78 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\tools\llc\llc.cpp, line 835 + 0x0 byte(s)
0x00007FF7568801E1, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x601E1 byte(s), main() + 0x531 byte(s), S:\SourceCache\swift-project\llvm-project\llvm\tools\llc\llc.cpp, line 472 + 0x11 byte(s)
0x00007FF758425268, S:\b\1\bin\llc.exe(0x00007FF756820000) + 0x1C05268 byte(s), __scrt_common_main_seh() + 0x10C byte(s), D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl, line 288 + 0x22 byte(s)
0x00007FFF1E78257D, C:\Windows\System32\KERNEL32.DLL(0x00007FFF1E770000) + 0x1257D byte(s), BaseThreadInitThunk() + 0x1D byte(s)
0x00007FFF204AAA58, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFF20450000) + 0x5AA58 byte(s), RtlUserThreadStart() + 0x28 byte(s)
Expected behavior
For the code to compile with debug information.
Environment
Swift version 5.11-dev (LLVM 572a5a4fbafb69e, Swift ebbb9de)
Target: x86_64-unknown-windows-msvc
Additional information
No response
Metadata
Metadata
Assignees
Labels
CodeGenWindowsPlatform: WindowsPlatform: WindowsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaredebug infoArea → compiler → IRGen: Debug information emissionArea → compiler → IRGen: Debug information emissiontransfer candidateThe issue may belong in another repositoryThe issue may belong in another repository