Index: lib/CodeGen/TargetInfo.cpp =================================================================== --- lib/CodeGen/TargetInfo.cpp +++ lib/CodeGen/TargetInfo.cpp @@ -2859,7 +2859,7 @@ ABIArgInfo X86_64ABIInfo::getIndirectReturnResult(QualType Ty) const { // If this is a scalar LLVM value then assume LLVM will pass it in the right // place naturally. - if (!isAggregateTypeForABI(Ty)) { + if (!isAggregateTypeForABI(Ty) && !IsIllegalVectorType(Ty)) { // Treat an enum type as its underlying type. if (const EnumType *EnumTy = Ty->getAs()) Ty = EnumTy->getDecl()->getIntegerType(); Index: test/CodeGen/x86_64-arguments.c =================================================================== --- test/CodeGen/x86_64-arguments.c +++ test/CodeGen/x86_64-arguments.c @@ -545,3 +545,13 @@ // AVX: @f65(<8 x float> %{{[^,)]+}}) void f65(struct t65 a0) { } + +// SSE-LABEL: @f66(<32 x i8>* noalias sret %{{[^,)]+}}) +// AVX: <32 x i8> @f66() +typedef char v66 __attribute__((vector_size (32))) ; +v66 f66() +{ + v66 y = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f', + '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; + return y; +}