[llvm-commits] [llvm] r65514 - /llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Bill Wendling isanbard at gmail.com
Wed Feb 25 23:34:22 PST 2009


Author: void
Date: Thu Feb 26 01:34:22 2009
New Revision: 65514

URL: http://llvm.org/viewvc/llvm-project?rev=65514&view=rev
Log:
Pull r65481 into Dib:

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.

Modified:
    llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=65514&r1=65513&r2=65514&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Thu Feb 26 01:34:22 2009
@@ -576,6 +576,7 @@
   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 @@
     }
 
     if (TLI.isBigEndian())
-      std::reverse(Parts, Parts + NumParts);
+      std::reverse(Parts, Parts + OrigNumParts);
 
     return;
   }





More information about the llvm-commits mailing list