summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
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
commit7d12ea0f62cfb86fcc66bc3dd6c87c036294999a (patch)
treed3ac24670b456ebdf05e963d2f5374fc079ffd5b /llvm/lib/CodeGen
parentdc3f50fbd95317f96d9ce0084b19bd331e3f8560 (diff)
downloadbcm5719-llvm-7d12ea0f62cfb86fcc66bc3dd6c87c036294999a.tar.gz
bcm5719-llvm-7d12ea0f62cfb86fcc66bc3dd6c87c036294999a.zip
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. llvm-svn: 65481
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 91fecc32251..3e8b753dcc6 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud