From c8e4f0e96e4039c7ea360edb11ab376afdf8bb8d Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Tue, 25 Feb 2003 17:06:41 +0000 Subject: 003-02-20 Aldy Hernandez * doc/tm.texi: Document Rename TARGET_VECTOR_TYPES_COMPATIBLE to TARGET_VECTOR_OPAQUE_P. Document accordingly. * testsuite/gcc.dg/20030218-1.c: Check that initialization of opaque types fail. * c-typeck.c (comptypes): Change call to vector_types_compatible to vector_opaque_p. (convert_for_assignment): Call vector_opaque_p instead of vector_types_compatible. (really_start_incremental_init): Disallow initialization of opaque types. * target-def.h: Remove TARGET_VECTOR_TYPES_COMPATIBLE. Define TARGET_VECTOR_OPAQUE_P. (TARGET_INITIALIZER): Same. * target.h (struct gcc_target): Remove vector_types_compatible. Add vector_opaque_p. * config/rs6000/rs6000.c (rs6000_spe_vector_types_compatible): Remove. (is_ev64_opaque_type): Check for TARGET_SPE and make sure type is a vector type. Change return type to bool. (TARGET_VECTOR_TYPES_COMPATIBLE): Remove. (TARGET_VECTOR_OPAQUE_P): Define. * cp/parser.c (cp_parser_init_declarator): Call vector_opaque_p target hook. Include target.h. (cp_parser_init_declarator): Fix typo in function comments. From-SVN: r63411 --- gcc/testsuite/gcc.dg/20030218-1.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'gcc/testsuite') diff --git a/gcc/testsuite/gcc.dg/20030218-1.c b/gcc/testsuite/gcc.dg/20030218-1.c index 665b6ab..e41152c 100644 --- a/gcc/testsuite/gcc.dg/20030218-1.c +++ b/gcc/testsuite/gcc.dg/20030218-1.c @@ -3,15 +3,24 @@ /* Test vectors that can interconvert without a cast. */ -int vint __attribute__((mode(V2SI))); +typedef int __attribute__((mode(V2SI))) __ev64_opaque__; + +__ev64_opaque__ opp; +int vint __attribute__((mode(V2SI))); int vshort __attribute__((mode(V4HI))); int vfloat __attribute__((mode(V2SF))); int main (void) { - vint = vfloat; - vshort = vint; + __ev64_opaque__ george = { 1, 2 }; /* { dg-error "opaque vector types cannot be initialized" } */ + + opp = vfloat; + vshort = opp; vfloat = vshort; /* { dg-error "incompatible types in assignment" } */ + + /* Just because this is a V2SI, it doesn't make it an opaque. */ + vint = vshort; /* { dg-error "incompatible types in assignment" } */ + return 0; } -- cgit v1.1