diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-04-24 18:45:59 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-04-24 18:45:59 +0000 |
commit | 83092adef9bb1e3d31cb4ae5baa1ae8d36778f93 (patch) | |
tree | cc443d2a58cf44164c641acb6cfa2e2c077fe9f0 /test/CodeGen/SPARC | |
parent | 6f76a43cea4bb2d26d8c5c5054462197a33e085d (diff) |
Don't emit CFI instructions at the end of a function
When functions are terminated by unreachable instructions, the last
instruction might trigger a CFI instruction to be generated. However,
emitting it would be be illegal since the function (and thus the FDE
the CFI is in) has already ended with the previous instruction.
Darwin's dwarfdump --verify --eh-frame complains about this and the
specification supports this.
Relevant bits from the DWARF 5 standard (6.4 Call Frame Information):
"[The] address_range [field in an FDE]: The number of bytes of
program instructions described by this entry."
"Row creation instructions: [...]
The new location value is always greater than the current one."
The first quotation implies that a CFI cannot describe a target
address outside of the enclosing FDE's range.
rdar://problem/26244988
Differential Revision: https://reviews.llvm.org/D32246
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301219 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SPARC')
-rw-r--r-- | test/CodeGen/SPARC/empty-functions.ll | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/test/CodeGen/SPARC/empty-functions.ll b/test/CodeGen/SPARC/empty-functions.ll index 1f8c5e3a312..974df232033 100644 --- a/test/CodeGen/SPARC/empty-functions.ll +++ b/test/CodeGen/SPARC/empty-functions.ll @@ -14,19 +14,11 @@ entry: ; LINUX-NO-FP-NEXT: .size func, .L{{.*}}-func ; LINUX-NO-FP-NEXT: .cfi_endproc -; A cfi directive can point to the end of a function. It (and in fact the -; entire body) could be optimized out because of the unreachable, but we -; don't do it right now. +; A cfi directive cannot point to the end of a function. ; LINUX-FP: func: ; LINUX-FP-NEXT: .cfi_startproc ; LINUX-FP-NEXT: {{^}}! ; LINUX-FP-NEXT: save %sp, -96, %sp ; LINUX-FP-NEXT: {{^}}.L{{.*}}:{{$}} -; LINUX-FP-NEXT: .cfi_def_cfa_register %fp -; LINUX-FP-NEXT: {{^}}.L{{.*}}:{{$}} -; LINUX-FP-NEXT: .cfi_window_save -; LINUX-FP-NEXT: {{^}}.L{{.*}}:{{$}} -; LINUX-FP-NEXT: .cfi_register 15, 31 -; LINUX-FP-NEXT: {{^}}.L{{.*}}:{{$}} ; LINUX-FP-NEXT: .size func, .Lfunc_end0-func ; LINUX-FP-NEXT: .cfi_endproc |