Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.406
diff -u -r1.406 tree.c
--- tree.c	28 Jul 2004 23:44:48 -0000	1.406
+++ tree.c	5 Aug 2004 14:54:21 -0000
@@ -3072,11 +3072,13 @@
     {
     case VOID_TYPE:
     case COMPLEX_TYPE:
-    case VECTOR_TYPE:
     case POINTER_TYPE:
     case REFERENCE_TYPE:
       return 1;
 
+    case VECTOR_TYPE:
+      return TYPE_VECTOR_SUBPARTS (a->type) == TYPE_VECTOR_SUBPARTS (b->type);
+
     case ENUMERAL_TYPE:
       if (TYPE_VALUES (a->type) != TYPE_VALUES (b->type)
 	  && !(TYPE_VALUES (a->type)
@@ -5174,9 +5176,12 @@
 {
   tree t = make_node (VECTOR_TYPE);
 
-  TREE_TYPE (t) = innertype;
+  TREE_TYPE (t) = TYPE_MAIN_VARIANT (innertype);
   TYPE_VECTOR_SUBPARTS (t) = nunits;
   TYPE_MODE (t) = mode;
+  TYPE_READONLY (t) = TYPE_READONLY (innertype);
+  TYPE_VOLATILE (t) = TYPE_VOLATILE (innertype);
+
   layout_type (t);
 
   {
@@ -5195,6 +5200,16 @@
     TYPE_UID (rt) = TYPE_UID (t);
   }
 
+  /* Build our main variant, based on the main variant of the inner type.  */
+  if (TYPE_MAIN_VARIANT (innertype) != innertype)
+    {
+      tree innertype_main_variant = TYPE_MAIN_VARIANT (innertype);
+      unsigned int hash = TYPE_HASH (innertype_main_variant);
+      TYPE_MAIN_VARIANT (t)
+        = type_hash_canon (hash, make_vector_type (innertype_main_variant,
+						   nunits, mode));
+    }
+
   return t;
 }
 
Index: cp/call.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/call.c,v
retrieving revision 1.498
diff -p -u -r1.498 call.c
--- cp/call.c	5 Aug 2004 05:51:53 -0000	1.498
+++ cp/call.c	5 Aug 2004 07:42:58 -0000
@@ -663,11 +663,6 @@ standard_conversion (tree to, tree from,
   if ((tcode == POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (to))
       && expr && null_ptr_cst_p (expr))
     conv = build_conv (ck_std, to, conv);
-  else if (tcode == POINTER_TYPE && fcode == POINTER_TYPE
-	   && TREE_CODE (TREE_TYPE (to)) == VECTOR_TYPE
-	   && TREE_CODE (TREE_TYPE (from)) == VECTOR_TYPE
-	   && vector_types_convertible_p (TREE_TYPE (to), TREE_TYPE (from)))
-    conv = build_conv (ck_std, to, conv);
   else if ((tcode == INTEGER_TYPE && fcode == POINTER_TYPE)
 	   || (tcode == POINTER_TYPE && fcode == INTEGER_TYPE))
     {
Index: cp/typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
retrieving revision 1.566
diff -p -u -r1.566 typeck.c
--- cp/typeck.c	2 Aug 2004 01:58:50 -0000	1.566
+++ cp/typeck.c	5 Aug 2004 07:42:59 -0000
@@ -6148,6 +6148,10 @@ ptr_reasonably_similar (tree to, tree fr
 			COMPARE_BASE | COMPARE_DERIVED))
 	continue;
 
+      if (TREE_CODE (to) == VECTOR_TYPE
+	  && vector_types_convertible_p (to, from))
+	return 1;
+
       if (TREE_CODE (to) == INTEGER_TYPE
 	  && TYPE_PRECISION (to) == TYPE_PRECISION (from))
 	return 1;
