Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -9325,6 +9325,9 @@ if (vType.isNull()) return vType; + if (!vType->isVectorType()) + return vType; + QualType LHSType = LHS.get()->getType(); // If AltiVec, the comparison results in a numeric type, i.e. Index: test/Sema/vector-cast.c =================================================================== --- test/Sema/vector-cast.c +++ test/Sema/vector-cast.c @@ -62,3 +62,8 @@ v = ptr; // expected-error-re {{assigning to 'short_sizeof_pointer' (vector of {{[0-9]+}} 'short' values) from incompatible type 'void *'}} ptr = v; // expected-error {{assigning to 'void *' from incompatible type 'short_sizeof_pointer'}} } + +typedef int vec __attribute__((vector_size(4))); +void f6(vec z, int y) { + y = y == z; +}