diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index d724466a..6c5af40a 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -4571,7 +4571,8 @@ void CWriter::printIntrinsicDefinition(FunctionType *funT, unsigned Opcode, Out << " r;\n"; if (isa(retT)) { - for (i = 0; i < numParams; i++) { + char vectorSize = dyn_cast(retT)->getNumElements(); + for (i = 0; i < vectorSize; i++) { Out << " r.vector[" << (int)i << "] = " << OpName << "_devec("; for (char j = 0; j < numParams; j++) { Out << (char)('a' + j);