Index: trunk/src/gcc/configure
===================================================================
--- trunk/src/gcc/configure	(revision 1598)
+++ trunk/src/gcc/configure	(revision 1600)
@@ -90,5 +90,5 @@
 target_makefile_frag=
 undefs=NOUNDEFS
-version="$Revision: 1.49 $"
+version="$Revision: 1.49.4.1 $"
 x11=default
 bindir='${exec_prefix}/bin'
@@ -698,5 +698,5 @@
 	# Perform the same cleanup as the trap handler, minus the "exit 1" of course,
 	# and reset the trap handler.
-	trap 0
+	trap '' 0
 	rm -rf Makefile* ${tmpdir}
 	# Execute the final clean-up actions
@@ -1598,5 +1598,5 @@
 # and reset the trap handler.
 rm -rf ${tmpdir}
-trap 0
+trap '' 0
 
 exit 0
Index: trunk/src/gcc/gcc/cp/decl.c
===================================================================
--- trunk/src/gcc/gcc/cp/decl.c	(revision 1598)
+++ trunk/src/gcc/gcc/cp/decl.c	(revision 1600)
@@ -148,4 +148,5 @@
 static void expand_static_init (tree, tree);
 static tree next_initializable_field (tree);
+static bool reshape_init_array (tree, tree, tree *, tree);
 static tree reshape_init (tree, tree *);
 
@@ -8227,4 +8228,58 @@
 }
 
+/* Subroutine of reshape_init. Reshape the constructor for an array. INITP
+   is the pointer to the old constructor list (to the CONSTRUCTOR_ELTS of
+   the CONSTRUCTOR we are processing), while NEW_INIT is the CONSTRUCTOR we
+   are building.
+   ELT_TYPE is the element type of the array. MAX_INDEX is an INTEGER_CST
+   representing the size of the array minus one (the maximum index), or
+   NULL_TREE if the array was declared without specifying the size.  */
+
+static bool
+reshape_init_array (tree elt_type, tree max_index,
+		    tree *initp, tree new_init)
+{
+  bool sized_array_p = (max_index != NULL_TREE);
+  HOST_WIDE_INT max_index_cst = 0;
+  HOST_WIDE_INT index;
+
+  if (sized_array_p)
+    /* HWI is either 32bit or 64bit, so it must be enough to represent the
+	array size.  */
+    max_index_cst = tree_low_cst (max_index, 1);
+
+  /* Loop until there are no more initializers.  */
+  for (index = 0;
+       *initp && (!sized_array_p || index <= max_index_cst);
+       ++index)
+    {
+      tree element_init;
+      tree designated_index;
+
+      element_init = reshape_init (elt_type, initp);
+      if (element_init == error_mark_node)
+	return false;
+      TREE_CHAIN (element_init) = CONSTRUCTOR_ELTS (new_init);
+      CONSTRUCTOR_ELTS (new_init) = element_init;
+      designated_index = TREE_PURPOSE (element_init);
+      if (designated_index)
+	{
+	  if (TREE_CODE (designated_index) != INTEGER_CST)
+	    abort ();
+	  if (sized_array_p
+	      && tree_int_cst_lt (max_index, designated_index))
+	    {
+	      error ("Designated initializer `%E' larger than array "
+		      "size", designated_index);
+	      TREE_PURPOSE (element_init) = NULL_TREE;
+	    }
+	  else
+	    index = tree_low_cst (designated_index, 1);
+	}
+    }
+
+  return true;
+}
+
 /* Undo the brace-elision allowed by [dcl.init.aggr] in a
    brace-enclosed aggregate initializer.
@@ -8402,5 +8457,4 @@
       else if ((TREE_CODE (type) == ARRAY_TYPE)|| (TREE_CODE (type) == VECTOR_TYPE))
 	{
-	  tree index;
 	  tree max_index;
 
@@ -8409,19 +8463,7 @@
 	  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;
-	       *initp && (!max_index || !tree_int_cst_lt (max_index, index));
-	       index = size_binop (PLUS_EXPR, index, size_one_node))
-	    {
-	      tree element_init;
-
-	      element_init = reshape_init (TREE_TYPE (type), initp);
-              if (element_init == error_mark_node)
-                return error_mark_node;
-	      TREE_CHAIN (element_init) = CONSTRUCTOR_ELTS (new_init);
-	      CONSTRUCTOR_ELTS (new_init) = element_init;
-	      if (TREE_PURPOSE (element_init))
-		index = convert (sizetype, TREE_PURPOSE (element_init));
-	    }
+	  if (!reshape_init_array (TREE_TYPE (type), max_index,
+				   initp, new_init))
+	    return error_mark_node;
 	}
       else
Index: trunk/src/gcc/gcc/cp/error.c
===================================================================
--- trunk/src/gcc/gcc/cp/error.c	(revision 1598)
+++ trunk/src/gcc/gcc/cp/error.c	(revision 1600)
@@ -423,4 +423,5 @@
       {
 	tree args = TYPE_TI_ARGS (t);
+	dump_qualifiers (t, after);
 	print_tree_identifier (scratch_buffer, TYPE_IDENTIFIER (t));
 	print_template_argument_list_start (scratch_buffer);
Index: trunk/src/gcc/gcc/cp/semantics.c
===================================================================
--- trunk/src/gcc/gcc/cp/semantics.c	(revision 1598)
+++ trunk/src/gcc/gcc/cp/semantics.c	(revision 1600)
@@ -2458,5 +2458,26 @@
 	   && CLEANUP_DECL (*tp) == nrv)
     CLEANUP_EH_ONLY (*tp) = 1;
-
+  /* Replace the DECL_STMT for the NRV with an initialization of the
+     RESULT_DECL, if needed.  */
+  else if (TREE_CODE (*tp) == DECL_STMT
+	   && DECL_STMT_DECL (*tp) == nrv)
+    {
+      tree init;
+      if (DECL_INITIAL (nrv)
+	  && DECL_INITIAL (nrv) != error_mark_node)
+	{
+	  init = build (INIT_EXPR, void_type_node,
+			DECL_RESULT (current_function_decl),
+			DECL_INITIAL (nrv));
+	  DECL_INITIAL (nrv) = error_mark_node;
+	}
+      else
+	init = NULL_TREE;
+      init = build_stmt (EXPR_STMT, init);
+      TREE_CHAIN (init) = TREE_CHAIN (*tp);
+      STMT_LINENO (init) = STMT_LINENO (*tp);
+      *tp = init;
+    }
+ 
   /* Keep iterating.  */
   return NULL_TREE;
Index: trunk/src/gcc/gcc/doc/invoke.texi
===================================================================
--- trunk/src/gcc/gcc/doc/invoke.texi	(revision 1598)
+++ trunk/src/gcc/gcc/doc/invoke.texi	(revision 1600)
@@ -348,5 +348,6 @@
 -mno-impure-text  -mno-stack-bias  -mno-unaligned-doubles @gol
 -msoft-float  -msoft-quad-float  -msparclite  -mstack-bias @gol
--msupersparc  -munaligned-doubles  -mv8}
+-msupersparc  -munaligned-doubles  -mv8
+-threads -pthreads}
 
 @emph{ARM Options}
@@ -3901,6 +3902,5 @@
 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
 
-@item -fbranch-probabilities
-@itemx -fno-guess-branch-probability
+@item -fno-guess-branch-probability
 @opindex fno-guess-branch-probability
 Do not guess branch probabilities using a randomized model.
@@ -5960,4 +5960,22 @@
 when making stack frame references.
 Otherwise, assume no such offset is present.
+@end table
+
+These switches are supported in addition to the above on Solaris:
+
+@table @gcctabopt
+@item -threads
+@opindex threads
+Add support for multithreading using the Solaris threads library.  This
+option sets flags for both the preprocessor and linker.  This option does
+not affect the thread safety of object code produced by the compiler or
+that of libraries supplied with it.
+
+@item -pthreads
+@opindex pthreads
+Add support for multithreading using the POSIX threads library.  This
+option sets flags for both the preprocessor and linker.  This option does
+not affect the thread safety of object code produced  by the compiler or
+that of libraries supplied with it.
 @end table
 
