summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff')
-rw-r--r--contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff79
1 files changed, 79 insertions, 0 deletions
diff --git a/contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff b/contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff
new file mode 100644
index 0000000..a046858
--- /dev/null
+++ b/contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff
@@ -0,0 +1,79 @@
+This patch applies a workaround for an ARM EABI issue, where clang would
+sometimes incorrectly align the stack in a leaf function that uses TLS.
+
+Introduced here: http://svn.freebsd.org/changeset/base/252503
+
+Index: test/CodeGen/Thumb2/large-stack.ll
+===================================================================
+--- test/CodeGen/Thumb2/large-stack.ll
++++ test/CodeGen/Thumb2/large-stack.ll
+@@ -13,7 +13,7 @@ define void @test1() {
+ define void @test2() {
+ ; DARWIN-LABEL: test2:
+ ; DARWIN: sub.w sp, sp, #4160
+-; DARWIN: sub sp, #8
++; DARWIN: sub sp, #12
+ ; LINUX-LABEL: test2:
+ ; LINUX: sub.w sp, sp, #4160
+ ; LINUX: sub sp, #8
+Index: test/CodeGen/ARM/2009-10-30.ll
+===================================================================
+--- test/CodeGen/ARM/2009-10-30.ll
++++ test/CodeGen/ARM/2009-10-30.ll
+@@ -4,9 +4,10 @@
+
+ define void @f(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, ...) {
+ entry:
+-;CHECK: sub sp, sp, #4
+-;CHECK: add r{{[0-9]+}}, sp, #8
+-;CHECK: str r{{[0-9]+}}, [sp], #4
++;CHECK: sub sp, sp, #8
++;CHECK: add r{{[0-9]+}}, sp, #12
++;CHECK: str r{{[0-9]+}}, [sp, #4]
++;CHECK: add sp, sp, #8
+ ;CHECK: bx lr
+ %ap = alloca i8*, align 4
+ %ap1 = bitcast i8** %ap to i8*
+Index: test/CodeGen/ARM/vargs_align.ll
+===================================================================
+--- test/CodeGen/ARM/vargs_align.ll
++++ test/CodeGen/ARM/vargs_align.ll
+@@ -15,8 +15,8 @@ entry:
+ return: ; preds = %entry
+ %retval2 = load i32* %retval ; <i32> [#uses=1]
+ ret i32 %retval2
+-; EABI: add sp, sp, #12
+ ; EABI: add sp, sp, #16
++; EABI: add sp, sp, #16
++; OABI: add sp, sp, #16
+ ; OABI: add sp, sp, #12
+-; OABI: add sp, sp, #12
+ }
+Index: test/CodeGen/ARM/prefetch-thumb.ll
+===================================================================
+--- test/CodeGen/ARM/prefetch-thumb.ll
++++ test/CodeGen/ARM/prefetch-thumb.ll
+@@ -10,8 +10,8 @@ entry:
+ ;ARM: pld [sp, #50]
+
+ ;THUMB2: t6:
+-;THUMB2: pld [sp]
+-;THUMB2: pld [sp, #50]
++;THUMB2: pld [sp, #4]
++;THUMB2: pld [sp, #54]
+
+ %red = alloca [100 x i8], align 1
+ %0 = getelementptr inbounds [100 x i8]* %red, i32 0, i32 0
+Index: lib/Target/ARM/ARMFrameLowering.h
+===================================================================
+--- lib/Target/ARM/ARMFrameLowering.h
++++ lib/Target/ARM/ARMFrameLowering.h
+@@ -27,7 +27,7 @@ class ARMFrameLowering : public TargetFrameLowerin
+
+ public:
+ explicit ARMFrameLowering(const ARMSubtarget &sti)
+- : TargetFrameLowering(StackGrowsDown, sti.getStackAlignment(), 0, 4),
++ : TargetFrameLowering(StackGrowsDown, sti.getStackAlignment(), 0, 8),
+ STI(sti) {
+ }
+
OpenPOWER on IntegriCloud