forked from swiftlang/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an offset underflow bug in DwarfExpression when describing small …
…values with subregisters DwarfExpression::addMachineReg() knows how to build a larger register that isn't expressible in DWARF by combining multiple subregisters. However, if the entire value fits into just one subregister, it would still emit the other subregisters, leading to all sorts of inconsistencies down the line. This patch fixes that by moving an already existing(!) check whether the subregister's offset is before the end of the value to the right place. rdar://problem/57294211 Differential Revision: https://reviews.llvm.org/D70508
- Loading branch information
1 parent
1f43959
commit 5da385f
Showing
3 changed files
with
47 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# RUN: llc -start-before=livedebugvalues -filetype=obj -o - %s | \ | ||
# RUN: llvm-dwarfdump -debug-info - | FileCheck %s | ||
# | ||
# In this test the first DBG_VALUE is 32 bits large and sits in 128-bit register Q8, | ||
# which has to be decomposed into two 64-bit register D16, D17. | ||
# This test ensures that the unused D17 is suppressed in the output. | ||
# | ||
# CHECK: .debug_info contents: | ||
# CHECK: DW_TAG_formal_parameter | ||
# CHECK-NEXT: DW_AT_location | ||
# CHECK-NEXT: DW_OP_regx D16, DW_OP_piece 0x4, DW_OP_regx D15, DW_OP_bit_piece 0x20 0x20 | ||
# CHECK-NEXT: DW_AT_name {{.*}}"boundingRect" | ||
--- | | ||
target triple = "thumbv7k-apple-watchos" | ||
define swiftcc void @f() !dbg !5 { | ||
ret void | ||
} | ||
!llvm.module.flags = !{!0} | ||
!llvm.dbg.cu = !{!2} | ||
!0 = !{i32 2, !"Debug Info Version", i32 3} | ||
!2 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !3, | ||
isOptimized: true, runtimeVersion: 5, emissionKind: FullDebug, enums: !4, globals: !4, imports: !4) | ||
!3 = !DIFile(filename: "t.swift", directory: "/") | ||
!4 = !{} | ||
!5 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 388, type: !9, scopeLine: 388, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !4) | ||
!9 = !DISubroutineType(types: !4) | ||
!10 = !DILocation(line: 0, scope: !5) | ||
!12 = !DILocalVariable(name: "boundingRect", arg: 1, scope: !5, file: !3, line: 388, type: !13) | ||
!13 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !14) | ||
!14 = !DICompositeType(tag: DW_TAG_structure_type, name: "CGRect", scope: !5, file: !3, line: 46, size: 128, elements: !4, runtimeLang: DW_LANG_Swift, identifier: "$sSo6CGRectVD") | ||
name: 'f' | ||
body: | | ||
bb.0: | ||
DBG_VALUE $s31, $noreg, !12, !DIExpression(DW_OP_LLVM_fragment, 32, 32), debug-location !10 | ||
DBG_VALUE $q8, $noreg, !12, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !10 | ||
renamable $r0 = t2ADDri $r6, 144, 14, $noreg, $noreg, debug-location !10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters