diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2003-08-10 15:17:35 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2003-08-10 15:17:35 +0000 |
commit | bae39a73bedabd843cbd6adfe195fa2327ca89ea (patch) | |
tree | 67b720a7e8175bfc9f4532ab4ae4379f6b57648f /gcc | |
parent | bf12d54dac71bbf2194ebdab932fed9b180c3ce3 (diff) | |
download | gcc-bae39a73bedabd843cbd6adfe195fa2327ca89ea.zip gcc-bae39a73bedabd843cbd6adfe195fa2327ca89ea.tar.gz gcc-bae39a73bedabd843cbd6adfe195fa2327ca89ea.tar.bz2 |
c-typeck.c (digest_init): Add conversion for VECTOR_TYPEs.
* c-typeck.c (digest_init): Add conversion for VECTOR_TYPEs.
testsuite:
* gcc.dg/spe1.c: New test.
From-SVN: r70296
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c-typeck.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/spe1.c | 14 |
4 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d2d0a6..e94265e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2003-08-10 Nathan Sidwell <nathan@codesourcery.com> + + * c-typeck.c (digest_init): Add conversion for VECTOR_TYPEs. + 2003-08-10 Richard Sandiford <rsandifo@redhat.com> * config/mips/mips.c (mips_no_mips16_string): Remove. diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 922cda8..7d29b19 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4018,6 +4018,11 @@ digest_init (tree type, tree init, int require_constant) { if (code == POINTER_TYPE) inside_init = default_function_array_conversion (inside_init); + + if (code == VECTOR_TYPE) + /* Although the types are compatible, we may require a + conversion. */ + inside_init = convert (type, inside_init); if (require_constant && !flag_isoc99 && TREE_CODE (inside_init) == COMPOUND_LITERAL_EXPR) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index efdfe31..0c82d52 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,7 @@ 2003-08-10 Nathan Sidwell <nathan@codesourcery.com> + * gcc.dg/spe1.c: New test. + PR c++/11670 * g++.dg/expr/cast2.C: New test. diff --git a/gcc/testsuite/gcc.dg/spe1.c b/gcc/testsuite/gcc.dg/spe1.c new file mode 100644 index 0000000..9ce56e0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/spe1.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target powerpc-*-eabi* } } */ +/* { dg-options "-mcpu=8540 -mabi=spe -O0" } */ + +/* (Test with -O0 so we don't optimize any of them away). */ + + +typedef float __attribute__((vector_size(8))) __ev64_fs__; + +static __ev64_opaque__ Foo (void); + +void Bar () +{ + __ev64_fs__ fs = Foo (); +} |