bruno added a comment.

In http://reviews.llvm.org/D21700#470103, @rnk wrote:

> After writing r266366, we discovered that GCC accepts none of the code in 
> that test case, so we should consider turning -flax-vector-conversions off by 
> default.


Makes sense, specially given the non obvious semantics; users shouldn't rely on 
this behavior by default without the knowledge of what's actually going on.


================
Comment at: test/Sema/vector-cast.c:65
@@ -59,1 +64,3 @@
+  d = f2;
+  d = d + f2;
 }
----------------
rnk wrote:
> Why should we allow this conversion? I don't see how <2 x float> and double 
> should be convertible. I'm not sure why we allow `f2 += d` above, but I think 
> of it as "widening" the type from scalar to vector.
> 
> Would it be OK for your if we tightened our lax vector conversion checks to 
> just allow conversion from `<1 x T>` to `T`? The test case in the summary 
> seems like pretty reasonable code, even if GCC rejects.
I misread the testcase, `<2 x float>` and `double` shouldn't be convertible 
indeed. Thanks for the catch.

Allowing conversions from `<1 x T>` to `T` is enough for us, it also sounds 
more correct. 


http://reviews.llvm.org/D21700



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to