Mark Shinwell <[EMAIL PROTECTED]> writes:

> Here, the compiler is not complaining about an attempt to implicitly
> convert a vector of four 16-bit quantities to a vector of eight
> 8-bit quantities.
> 
> This lack of type safety is unsettling, and I wonder if it should be fixed
> with a patch along the lines of the (not yet fully tested) one below.  Does
> that sound reasonable?  It seems right to try to fix the generic code here,
> even though the testcase in hand is target-specific.  If this approach
> is unreasonable, I guess some target-specific hooks will be needed.

I personally think it is a good idea to require an explicit cast.
This comes up with C++ overloaded functions as well.  In the backend I
wrote for a vector processor, I added a command line option.


Paolo Bonzini <[EMAIL PROTECTED]> writes:

> I'm almost sure this is a regression, and older versions of GCC
> implemented exactly what you propose.

It's been this way at least since 4.0.


I believe that the problem with changing this unconditionally is that
the Altivec programming guidelines specify the rules which gcc
currently follows: you are permitted to assign one vector variable to
another, without an explicit cast, when the vectors are the same size.
So please check the Altivec programming manual.

Ian

Reply via email to