c-typeck.c (scalar_to_vector): New function.
authorArtjoms Sinkarovs <artyom.shinkaroff@gmail.com>
Wed, 10 Aug 2011 14:44:02 +0000 (14:44 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 10 Aug 2011 14:44:02 +0000 (14:44 +0000)
commit0e3a99ae913c732f015b0dcfecb85d3236cc142f
tree1a68ab24120fe0d7e02fe83b3b5e700f8d676001
parent0eb778344e8c1d4e9da37a098bceef7201283432
c-typeck.c (scalar_to_vector): New function.

2011-08-10  Artjoms Sinkarovs <artyom.shinakroff@gmail.com>

* 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.

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.

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.

From-SVN: r177622
12 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c-typeck.c
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/scal-to-vec1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/scal-to-vec2.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/scal-to-vec3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/scal-to-vec1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/scal-to-vec2.c [new file with mode: 0644]