summaryrefslogtreecommitdiff
path: root/devel/llvm32/files/patch-svn-r175057
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2013-10-18 22:06:39 +0000
committerBrooks Davis <brooks@FreeBSD.org>2013-10-18 22:06:39 +0000
commit2c6611d8cf774a8ee754852446eae436bb3257d3 (patch)
treea3288d0e5a1c0c79ef902867cd7518f713a9b34c /devel/llvm32/files/patch-svn-r175057
parent- Update to 0.4.2 (diff)
Add llvm32 and clang32 ports modeled on the llvm33 and clang33 ports.
These ports install binaries with "32" suffixes and most data lives in ${PREFIX}/llvm32 so there are no conflicts. NOTE: devel/llvm and lang/clang will shortly be removed in favor of these ports.
Diffstat (limited to 'devel/llvm32/files/patch-svn-r175057')
-rw-r--r--devel/llvm32/files/patch-svn-r17505755
1 files changed, 55 insertions, 0 deletions
diff --git a/devel/llvm32/files/patch-svn-r175057 b/devel/llvm32/files/patch-svn-r175057
new file mode 100644
index 000000000000..a1b6baaf228a
--- /dev/null
+++ b/devel/llvm32/files/patch-svn-r175057
@@ -0,0 +1,55 @@
+$FreeBSD$
+------------------------------------------------------------------------
+r175057 | d0k | 2013-02-13 13:40:35 +0000 (Wed, 13 Feb 2013) | 8 lines
+
+X86: Disable generation of rep;movsl when %esi is used as a base pointer.
+
+This happens when there is both stack realignment and a dynamic alloca in the
+function. If we overwrite %esi (rep;movsl uses fixed registers) we'll lose the
+base pointer and the next register spill will write into oblivion.
+
+Fixes PR15249 and unbreaks firefox on i386/freebsd. Mozilla uses dynamic allocas
+and freebsd a 4 byte stack alignment.
+------------------------------------------------------------------------
+Index: lib/Target/X86/X86SelectionDAGInfo.cpp
+===================================================================
+--- lib/Target/X86/X86SelectionDAGInfo.cpp (revision 175056)
++++ lib/Target/X86/X86SelectionDAGInfo.cpp (revision 175057)
+@@ -202,6 +202,14 @@
+ SrcPtrInfo.getAddrSpace() >= 256)
+ return SDValue();
+
++ // ESI might be used as a base pointer, in that case we can't simply overwrite
++ // the register. Fall back to generic code.
++ const X86RegisterInfo *TRI =
++ static_cast<const X86RegisterInfo *>(DAG.getTarget().getRegisterInfo());
++ if (TRI->hasBasePointer(DAG.getMachineFunction()) &&
++ TRI->getBaseRegister() == X86::ESI)
++ return SDValue();
++
+ MVT AVT;
+ if (Align & 1)
+ AVT = MVT::i8;
+Index: test/CodeGen/X86/stack-align-memcpy.ll
+===================================================================
+--- test/CodeGen/X86/stack-align-memcpy.ll (revision 0)
++++ test/CodeGen/X86/stack-align-memcpy.ll (revision 175057)
+@@ -0,0 +1,18 @@
++; RUN: llc < %s -force-align-stack -mtriple i386-apple-darwin -mcpu=i486 | FileCheck %s
++
++%struct.foo = type { [88 x i8] }
++
++; PR15249
++; We can't use rep;movsl here because it clobbers the base pointer in %esi.
++define void @test1(%struct.foo* nocapture %x, i32 %y) nounwind {
++ %dynalloc = alloca i8, i32 %y, align 1
++ call void @bar(i8* %dynalloc, %struct.foo* align 4 byval %x)
++ ret void
++
++; CHECK: test1:
++; CHECK: andl $-16, %esp
++; CHECK: movl %esp, %esi
++; CHECK-NOT: rep;movsl
++}
++
++declare void @bar(i8* nocapture, %struct.foo* align 4 byval) nounwind