When rebuilding constant structs, make sure to honor the isPacked bit.
This fixes PR1491 and GlobalOpt/2007-06-04-PackedStruct.ll llvm-svn: 37423
This commit is contained in:
parent
084c20fcc0
commit
d7897d40b6
|
@ -1625,7 +1625,7 @@ static Constant *EvaluateStoreInto(Constant *Init, Constant *Val,
|
|||
Elts[Idx] = EvaluateStoreInto(Elts[Idx], Val, Addr, OpNo+1);
|
||||
|
||||
// Return the modified struct.
|
||||
return ConstantStruct::get(Elts);
|
||||
return ConstantStruct::get(&Elts[0], Elts.size(), STy->isPacked());
|
||||
} else {
|
||||
ConstantInt *CI = cast<ConstantInt>(Addr->getOperand(OpNo));
|
||||
const ArrayType *ATy = cast<ArrayType>(Init->getType());
|
||||
|
|
Loading…
Reference in New Issue