[llvm-commits] [llvm] r65481 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Evan Cheng echeng at apple.com
Wed Feb 25 21:57:27 PST 2009


Dale, thanks a lot for tracking this down!

Evan

On Feb 25, 2009, at 2:39 PM, Dale Johannesen wrote:

> Author: johannes
> Date: Wed Feb 25 16:39:13 2009
> New Revision: 65481
>
> URL: http://llvm.org/viewvc/llvm-project?rev=65481&view=rev
> Log:
> 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/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=65481&r1=65480&r2=65481&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp  
> (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Wed  
> Feb 25 16:39:13 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;
>   }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list