aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-02-25 22:39:13 +0000
committerDale Johannesen <dalej@apple.com>2009-02-25 22:39:13 +0000
commit8a36f509cd0fd4c503c8564000f77713e1676c56 (patch)
tree3d0ef1d003ac7702dffa3b6f28e96077e359c976
parent053372dc3c25c5442b7349c612104e15c41233e8 (diff)
downloadexternal_llvm-8a36f509cd0fd4c503c8564000f77713e1676c56.zip
external_llvm-8a36f509cd0fd4c503c8564000f77713e1676c56.tar.gz
external_llvm-8a36f509cd0fd4c503c8564000f77713e1676c56.tar.bz2
Fix big-endian codegen bug. We're splitting up
overly long ints, e.g. i96, into pieces at PHIs and the nodes that feed into them; however big-endian reverses the order of the pieces (for some reason), and wasn't doing it the same way on both sides, so the pieces didn't match and runtime failures ensued. Fixes 188.ammp and sqlite3 on ppc32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65481 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 91fecc3..3e8b753 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -576,6 +576,7 @@ static void getCopyToParts(SelectionDAG &DAG, DebugLoc dl, SDValue Val,
MVT PtrVT = TLI.getPointerTy();
MVT ValueVT = Val.getValueType();
unsigned PartBits = PartVT.getSizeInBits();
+ unsigned OrigNumParts = NumParts;
assert(TLI.isTypeLegal(PartVT) && "Copying to an illegal type!");
if (!NumParts)
@@ -673,7 +674,7 @@ static void getCopyToParts(SelectionDAG &DAG, DebugLoc dl, SDValue Val,
}
if (TLI.isBigEndian())
- std::reverse(Parts, Parts + NumParts);
+ std::reverse(Parts, Parts + OrigNumParts);
return;
}