Index: llvm/lib/IR/Operator.cpp =================================================================== --- llvm/lib/IR/Operator.cpp +++ llvm/lib/IR/Operator.cpp @@ -38,7 +38,7 @@ Align Result = Align(llvm::Value::MaximumAlignment); for (gep_type_iterator GTI = gep_type_begin(this), GTE = gep_type_end(this); GTI != GTE; ++GTI) { - int64_t Offset = 1; + uint64_t Offset; ConstantInt *OpC = dyn_cast(GTI.getOperand()); if (StructType *STy = GTI.getStructTypeOrNull()) { @@ -48,7 +48,7 @@ assert(GTI.isSequential() && "should be sequencial"); /// If the index isn't know we take 1 because it is the index that will /// give the worse alignment of the offset. - int64_t ElemCount = 1; + uint64_t ElemCount = 1; if (OpC) ElemCount = OpC->getZExtValue(); Offset = DL.getTypeAllocSize(GTI.getIndexedType()) * ElemCount;