This is a patch that was approved a long time ago here:
http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01833.html
but was never submitted.

2011-08-09  Artjoms Sinkarovs <artyom.shinakr...@gmail.com>

 /gcc
 * c-typeck.c (scalar_to_vector): New function. Try scalar to
vector conversion.
 (stv_conv): New enum for scalar_to_vector return type.
 (build_binary_op): Adjust.
 * doc/extend.texi: Description of scalar to vector expansion.

 /gcc/c-family
 * c-common.c (unsafe_conversion_p): New function. Check if it is unsafe to
 convert an expression to the type.
 (conversion_warning): Adjust, use unsafe_conversion_p.
 * c-common.h (unsafe_conversion_p): New function declaration.

 /gcc/testsuite
 * gcc.c-torture/execute/scal-to-vec1.c: New test.
 * gcc.c-torture/execute/scal-to-vec2.c: New test.
 * gcc.c-torture/execute/scal-to-vec3.c: New test.
 * gcc.dg/scal-to-vec1.c: New test.
 * gcc.dg/scal-to-vec2.c: New test.

bootstrapped and tested on x86_64_unknown-linux



Thanks,
Artem.

Reply via email to