Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DPWBS-1149] fix(FrameLowering): skip debug instructions in processFu…
…nctionBeforeFrameFinalized This fixes a crash when building with debug info enabled when a debug instruction uses the stack.
- Loading branch information
1 parent
63e2661
commit 3a20f73
Showing
3 changed files
with
71 additions
and
0 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
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,64 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# RUN: llc -mtriple=tricore -run-pass=prologepilog -verify-machineinstrs %s -o - | FileCheck %s | ||
|
||
# Check that a DBG_VALUE instruction with a frame index operand does not cause | ||
# a crash before and during frame-index elimination. | ||
|
||
--- | | ||
; Function Attrs: noinline nounwind optnone | ||
define dso_local void @test_dbg_value_ignored({ double, double }* noalias sret %agg.result, { double, double }* %x) #0 !dbg !7 { | ||
entry: | ||
unreachable | ||
} | ||
|
||
attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="tc2xx" "target-features"="+tc161" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
attributes #1 = { nounwind readnone speculatable willreturn } | ||
attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-builtins" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="tc2xx" "target-features"="+tc161" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
attributes #3 = { nounwind } | ||
attributes #4 = { nobuiltin "no-builtins" } | ||
|
||
!llvm.dbg.cu = !{!0} | ||
!llvm.module.flags = !{!3, !4, !5} | ||
!llvm.ident = !{!6} | ||
|
||
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0 (ssh://git@bitbucket-server.software.htc:7999/toolchain/llvm-project.git 1d1bcd3eb2181697497b5c82dc130b85ca9ca9c0)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) | ||
!1 = !DIFile(filename: "/home/jenkins/workspace/toolchain/dinkum-libc/dinkum/source/csinhl.c", directory: "/home/dominik/workspace/playground") | ||
!2 = !{} | ||
!3 = !{i32 7, !"Dwarf Version", i32 4} | ||
!4 = !{i32 2, !"Debug Info Version", i32 3} | ||
!5 = !{i32 1, !"wchar_size", i32 4} | ||
!6 = !{!"clang version 11.0.0 (ssh://git@bitbucket-server.software.htc:7999/toolchain/llvm-project.git 1d1bcd3eb2181697497b5c82dc130b85ca9ca9c0)"} | ||
!7 = distinct !DISubprogram(name: "csinhl", scope: !8, file: !8, line: 6, type: !9, scopeLine: 7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) | ||
!8 = !DIFile(filename: "jenkins/workspace/toolchain/dinkum-libc/dinkum/source/xxcsinh.h", directory: "/home") | ||
!9 = !DISubroutineType(types: !10) | ||
!10 = !{!11, !11} | ||
!11 = !DIDerivedType(tag: DW_TAG_typedef, name: "_Lcomplex", file: !12, line: 89, baseType: !13) | ||
!12 = !DIFile(filename: "jenkins/workspace/toolchain/dinkum-libc/dinkum/include/c/complex.h", directory: "/home") | ||
!13 = !DIBasicType(name: "complex", size: 128, encoding: DW_ATE_complex_float) | ||
!14 = !DILocalVariable(name: "x", arg: 1, scope: !7, file: !8, line: 6, type: !11) | ||
!15 = !DILocation(line: 6, column: 30, scope: !7) | ||
|
||
... | ||
--- | ||
name: test_dbg_value_ignored | ||
alignment: 1 | ||
legalized: true | ||
regBankSelected: true | ||
selected: true | ||
tracksRegLiveness: true | ||
stack: | ||
- { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4, | ||
stack-id: default, callee-saved-register: '', callee-saved-restored: true, | ||
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } | ||
callSites: [] | ||
constants: [] | ||
machineFunctionInfo: {} | ||
body: | | ||
bb.1.entry: | ||
; CHECK-LABEL: name: test_dbg_value_ignored | ||
; CHECK: $a14 = frame-setup MOVAA_aa $a10 | ||
; CHECK: $a10 = frame-setup LEA_aac $a10, -8 | ||
; CHECK: frame-setup CFI_INSTRUCTION def_cfa $a14, 0 | ||
; CHECK: DBG_VALUE $a14, 0 | ||
DBG_VALUE %stack.0, 0, !14, !DIExpression(DW_OP_deref), debug-location !15 | ||
... |