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
This commit is contained in:
parent
bf12d54dac
commit
bae39a73be
4 changed files with 25 additions and 0 deletions
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
14
gcc/testsuite/gcc.dg/spe1.c
Normal file
14
gcc/testsuite/gcc.dg/spe1.c
Normal file
|
@ -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 ();
|
||||
}
|
Loading…
Add table
Reference in a new issue