Fix Regression/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll
authorChris Lattner <sabre@nondot.org>
Tue, 24 Jan 2006 19:36:27 +0000 (19:36 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 24 Jan 2006 19:36:27 +0000 (19:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25587 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/ScalarReplAggregates.cpp

index be82c38c4a2e8eb2e8aee38c99217fd696c3c106..001f3a57328798082f38b2acafb71ce793f34db7 100644 (file)
@@ -554,9 +554,7 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) {
       // Convert the stored type to the actual type, shift it left to insert
       // then 'or' into place.
       Value *SV = SI->getOperand(0);
-      if (SV->getType() == NewAI->getType()->getElementType()) {
-        assert(Offset == 0 && "Store out of bounds!");
-      } else {
+      if (SV->getType() != NewAI->getType()->getElementType() || Offset != 0) {
         Value *Old = new LoadInst(NewAI, NewAI->getName()+".in", SI);
         // If SV is signed, convert it to unsigned, so that the next cast zero
         // extends the value.