diff options
| author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2019-07-17 20:46:19 +0000 |
|---|---|---|
| committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2019-07-17 20:46:19 +0000 |
| commit | 9f2b290addfc4d9f514790b47773b141682b0db5 (patch) | |
| tree | 9707d7fdcf11359e28d37c19ea777ee485804e5a /llvm/test/CodeGen/ARM/stack-guard-reassign.ll | |
| parent | 39fc2843e4eb07370d55f0a7a0db34d4bd6c9d5f (diff) | |
| download | bcm5719-llvm-9f2b290addfc4d9f514790b47773b141682b0db5.tar.gz bcm5719-llvm-9f2b290addfc4d9f514790b47773b141682b0db5.zip | |
[PEI] Don't re-allocate a pre-allocated stack protector slot
The LocalStackSlotPass pre-allocates a stack protector and makes sure
that it comes before the local variables on the stack.
We need to make sure that later during PEI we don't re-allocate a new
stack protector slot. If that happens, the new stack protector slot will
end up being **after** the local variables that it should be protecting.
Therefore, we would have two slots assigned for two different stack
protectors, one at the top of the stack, and one at the bottom. Since
PEI will overwrite the assigned slot for the stack protector, the load
that is used to compare the value of the stack protector will use the
slot assigned by PEI, which is wrong.
For this, we need to check if the object is pre-allocated, and re-use
that pre-allocated slot.
Differential Revision: https://reviews.llvm.org/D64757
llvm-svn: 366371
Diffstat (limited to 'llvm/test/CodeGen/ARM/stack-guard-reassign.ll')
| -rw-r--r-- | llvm/test/CodeGen/ARM/stack-guard-reassign.ll | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/CodeGen/ARM/stack-guard-reassign.ll b/llvm/test/CodeGen/ARM/stack-guard-reassign.ll index ae3d91361e2..2ce1d1588a4 100644 --- a/llvm/test/CodeGen/ARM/stack-guard-reassign.ll +++ b/llvm/test/CodeGen/ARM/stack-guard-reassign.ll @@ -3,12 +3,12 @@ ; Verify that the offset assigned to the stack protector is at the top of the ; frame, covering the locals. ; CHECK-LABEL: fn: -; CHECK: sub sp, sp, #40 +; CHECK: sub sp, sp, #32 ; CHECK-NEXT: sub sp, sp, #65536 -; CHECK-NEXT: add r1, sp, #28 +; CHECK-NEXT: add lr, sp, #65536 +; CHECK-NEXT: add r1, lr, #28 ; CHECK-NEXT: ldr r2, .LCPI0_0 ; CHECK-NEXT: ldr r3, [r2] ; CHECK-NEXT: str r3, [r1] -; CHECK-NEXT: str r0, [sp, #32] ; CHECK: .LCPI0_0: ; CHECK-NEXT: .long __stack_chk_guard |

