https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68062

--- Comment #8 from Ulrich Weigand <uweigand at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #7)
> I think there was some inconsistencies in C vs. C++ FEs in this area (but as
> usual I don't remember exactly but I remember Uli complaining about it again
> at the Caulrdon).
> 
> I believe it was sort-of automatic integer promotion rules should apply if
> they don't change vector sizes (thus, the sign promotion parts should apply).
> 
> That's not "ignoring" signs but doing the appropriate (view-)conversions.

Actually, the C vs. C++ FE inconsistency was about binary operators (+, -,
...), not comparisons.

For both binary and relational operators, the various applicable standards
(AltiVec + extensions, System z vector extensions, OpenCL) all agree that if
the two operands differ in signedness, the operation is not valid and should
result in an error.  However, GCC has never done this, but has always accepted
these combinations (both C and C++).  (At some point, we might want to change
this, but then we have to care that we don't break "vector bool" handling for
those platforms that support it.)

The difference between C and C++ comes in when determining what to use as the
*result type* of a binary operator whose operands differ in signedness.  This
does not apply to comparisons since those have a result type different from the
input types in any case.

Reply via email to