This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[3.3-e500-branch] more vector array initializer patches


Committed.

Gaby, this is the other patch that also needs to go into 3.3 if you
approve.

2004-01-29  Aldy Hernandez  <aldyh@redhat.com>

	Backport:

	2004-01-17  Fred Fish  <fnf@intrinsity.com>

        PR c++/11895
        * cp/decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
        except don't call array_type_nelts() with a VECTOR_TYPE.

Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.965.2.35.2.4
diff -c -p -r1.965.2.35.2.4 decl.c
*** cp/decl.c	29 Jan 2004 19:55:25 -0000	1.965.2.35.2.4
--- cp/decl.c	29 Jan 2004 20:51:40 -0000
*************** reshape_init (tree type, tree *initp)
*** 8344,8357 ****
  		}
  	    }
  	}
!       else if (TREE_CODE (type) == ARRAY_TYPE)
  	{
  	  tree index;
  	  tree max_index;
  
  	  /* If the bound of the array is known, take no more initializers
  	     than are allowed.  */
! 	  max_index = (TYPE_DOMAIN (type) 
  		       ? array_type_nelts (type) : NULL_TREE);
  	  /* Loop through the array elements, gathering initializers.  */
  	  for (index = size_zero_node;
--- 8344,8357 ----
  		}
  	    }
  	}
!       else if ((TREE_CODE (type) == ARRAY_TYPE)|| (TREE_CODE (type) == VECTOR_TYPE))
  	{
  	  tree index;
  	  tree max_index;
  
  	  /* If the bound of the array is known, take no more initializers
  	     than are allowed.  */
! 	  max_index = ((TYPE_DOMAIN (type) && (TREE_CODE (type) == ARRAY_TYPE))
  		       ? array_type_nelts (type) : NULL_TREE);
  	  /* Loop through the array elements, gathering initializers.  */
  	  for (index = size_zero_node;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]