rpms/gcc/devel gcc4-gfortran-entry-character.patch, NONE, 1.1 gcc4-gfortran-pr13082-mixed.patch, NONE, 1.1 gcc4-gfortran-pr13082.patch, NONE, 1.1 gcc4-gfortran-pr18824.patch, NONE, 1.1 gcc4-libgfortran-pr20163.patch, NONE, 1.1 gcc4-ppc32-hwint32.patch, NONE, 1.1 gcc4-pr20490.patch, NONE, 1.1 gcc4-pr20739.patch, NONE, 1.1 gcc4-s390-pr20917.patch, NONE, 1.1 gcc4-struct-layout.patch, NONE, 1.1 .cvsignore, 1.82, 1.83 gcc4-pr20126.patch, 1.2, 1.3 gcc4.spec, 1.26, 1.27 sources, 1.83, 1.84

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Apr 12 23:02:28 UTC 2005


Update of /cvs/dist/rpms/gcc/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv22396

Modified Files:
	.cvsignore gcc4-pr20126.patch gcc4.spec sources 
Added Files:
	gcc4-gfortran-entry-character.patch 
	gcc4-gfortran-pr13082-mixed.patch gcc4-gfortran-pr13082.patch 
	gcc4-gfortran-pr18824.patch gcc4-libgfortran-pr20163.patch 
	gcc4-ppc32-hwint32.patch gcc4-pr20490.patch gcc4-pr20739.patch 
	gcc4-s390-pr20917.patch gcc4-struct-layout.patch 
Log Message:
4.0.0-0.42


gcc4-gfortran-entry-character.patch:
 fortran/trans-decl.c              |    4 +++-
 testsuite/gfortran.dg/entry_4.f90 |   20 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

--- NEW FILE gcc4-gfortran-entry-character.patch ---
2005-04-11  Jakub Jelinek  <jakub at redhat.com>

	* trans-decl.c (gfc_generate_function_code): Call
	gfc_conv_const_charlen on BT_CHARACTER result before copying it
	to alternate entry result symbols.

	* gfortran.dg/entry_4.f90: Add some more tests.

--- gcc/fortran/trans-decl.c.jj	2005-04-11 14:39:24.000000000 +0200
+++ gcc/fortran/trans-decl.c	2005-04-11 23:33:14.000000000 +0200
@@ -2331,8 +2331,10 @@ gfc_generate_function_code (gfc_namespac
 	  /* Copy length backend_decls to all entry point result
 	     symbols.  */
 	  gfc_entry_list *el;
-	  tree backend_decl = ns->proc_name->result->ts.cl->backend_decl;
+	  tree backend_decl;
 
+	  gfc_conv_const_charlen (ns->proc_name->ts.cl);
+	  backend_decl = ns->proc_name->result->ts.cl->backend_decl;
 	  for (el = ns->entries; el; el = el->next)
 	    el->sym->result->ts.cl->backend_decl = backend_decl;
 	}
--- gcc/testsuite/gfortran.dg/entry_4.f90.jj	2005-04-11 09:25:45.000000000 +0200
+++ gcc/testsuite/gfortran.dg/entry_4.f90	2005-04-11 23:46:07.000000000 +0200
@@ -14,8 +14,23 @@
 	e2 = str (i:j)
 	end function
 
+	character*5 function f3 ()
+	character e3*(*), e4*(*)
+	integer i
+	f3 = 'ABCDE'
+	return
+	entry e3 (i)
+	entry e4 (i)
+	if (i .gt. 0) then
+	  e3 = 'abcde'
+	else
+	  e4 = 'UVWXY'
+	endif
+	end function
+
 	program entrytest
 	character f1*16, e1*16, e2*16, str*16, ret*16
+	character f3*5, e3*5, e4*5
 	integer i, j
 	str = 'ABCDEFGHIJ'
 	i = 2
@@ -29,4 +44,9 @@
 	ret = e2 (str, i, j)
 	if ((i .ne. 3) .or. (j .ne. 4)) call abort ()
 	if (ret .ne. 'CD') call abort ()
+	if (f3 () .ne. 'ABCDE') call abort ()
+	if (e3 (1) .ne. 'abcde') call abort ()
+	if (e4 (1) .ne. 'abcde') call abort ()
+	if (e3 (0) .ne. 'UVWXY') call abort ()
+	if (e4 (0) .ne. 'UVWXY') call abort ()
 	end program

gcc4-gfortran-pr13082-mixed.patch:
 fortran/gfortran.h                                     |    3 
 fortran/resolve.c                                      |    9 --
 fortran/trans-decl.c                                   |   61 +++++++++++++++-
 fortran/trans-types.c                                  |   46 ++++++++++++
 testsuite/gfortran.fortran-torture/execute/entry_2.f90 |   64 +++++++++++++++++
 5 files changed, 173 insertions(+), 10 deletions(-)

--- NEW FILE gcc4-gfortran-pr13082-mixed.patch ---
2005-04-11  Jakub Jelinek  <jakub at redhat.com>

	PR fortran/13082
	* gfortran.h (symbol_attribute): Add mixed_entry_master bit.
	* resolve.c (resolve_entries): Set mixed_entry_master attribute if
	entry result types aren't the same.
	* trans-types.c (gfc_get_mixed_entry_union): New function.
	(gfc_get_function_type): Use it for mixed_entry_master functions.
	* trans-decl.c (build_entry_thunks): Create thunks for
	mixed_entry_master.
	(gfc_get_fake_result_decl): For mixed_entry_master entries or their
	results, return a COMPONENT_REF of the fake result.

--- gcc/fortran/gfortran.h.jj	2005-04-01 09:29:56.000000000 +0200
+++ gcc/fortran/gfortran.h	2005-04-11 11:31:48.000000000 +0200
@@ -431,6 +431,9 @@ typedef struct
   /* Set if this is the master function for a procedure with multiple
      entry points.  */
   unsigned entry_master:1;
+  /* Set if this is the master function for a function with multiple
+     entry points where characteristics of the entry points differ.  */
+  unsigned mixed_entry_master:1;
 
   /* Set if a function must always be referenced by an explicit interface.  */
   unsigned always_explicit:1;
--- gcc/fortran/resolve.c.jj	2005-04-11 09:36:24.000000000 +0200
+++ gcc/fortran/resolve.c	2005-04-11 11:36:35.000000000 +0200
@@ -380,12 +380,9 @@ resolve_entries (gfc_namespace * ns)
 	/* All result types the same.  */
 	proc->ts = ns->entries->sym->result->ts;
       else
-	{
-	  /* Otherwise the result will be passed through an union by
-	     reference.  */
-	  proc->ts.type = BT_UNKNOWN;
-	  gfc_internal_error ("TODO: Functions with alternate entry points with non-matching types");
-	}
+	/* Otherwise the result will be passed through an union by
+	   reference.  */
+	proc->attr.mixed_entry_master = 1;
     }
   proc->attr.access = ACCESS_PRIVATE;
   proc->attr.entry_master = 1;
--- gcc/fortran/trans-types.c.jj	2005-04-01 09:29:56.000000000 +0200
+++ gcc/fortran/trans-types.c	2005-04-11 12:29:53.000000000 +0200
@@ -1469,6 +1469,50 @@ gfc_return_by_reference (gfc_symbol * sy
   return 0;
 }
 
+static tree
+gfc_get_mixed_entry_union (gfc_namespace *ns)
+{
+  tree type;
+  tree decl;
+  tree fieldlist;
+  char name[GFC_MAX_SYMBOL_LEN + 1];
+  gfc_entry_list *el, *el2;
+
+  gcc_assert (ns->proc_name->attr.mixed_entry_master);
+  gcc_assert (memcmp (ns->proc_name->name, "master.", 7) == 0);
+
+  snprintf (name, GFC_MAX_SYMBOL_LEN, "munion.%s", ns->proc_name->name + 7);
+
+  /* Build the type node.  */
+  type = make_node (UNION_TYPE);
+
+  TYPE_NAME (type) = get_identifier (name);
+  fieldlist = NULL;
+
+  for (el = ns->entries; el; el = el->next)
+    {
+      /* Search for duplicates.  */
+      for (el2 = ns->entries; el2 != el; el2 = el2->next)
+	if (el2->sym->result == el->sym->result)
+	  break;
+
+      if (el == el2)
+	{
+	  decl = build_decl (FIELD_DECL,
+			     get_identifier (el->sym->result->name),
+			     gfc_sym_type (el->sym->result));
+	  DECL_CONTEXT (decl) = type;
+	  fieldlist = chainon (fieldlist, decl);
+	}
+    }
+
+  /* Finish off the type.  */
+  TYPE_FIELDS (type) = fieldlist;
+
+  gfc_finish_type (type);
+  return type;
+}
+
 tree
 gfc_get_function_type (gfc_symbol * sym)
 {
@@ -1571,6 +1615,8 @@ gfc_get_function_type (gfc_symbol * sym)
     type = integer_type_node;
   else if (!sym->attr.function || gfc_return_by_reference (sym))
     type = void_type_node;
+  else if (sym->attr.mixed_entry_master)
+    type = gfc_get_mixed_entry_union (sym->ns);
   else
     type = gfc_sym_type (sym);
 
--- gcc/fortran/trans-decl.c.jj	2005-04-11 09:25:58.000000000 +0200
+++ gcc/fortran/trans-decl.c	2005-04-11 14:39:24.000000000 +0200
@@ -1382,9 +1382,7 @@ build_entry_thunks (gfc_namespace * ns)
 
       if (thunk_sym->attr.function)
 	{
-	  if (ns->proc_name->ts.type == BT_UNKNOWN)
-	    gfc_internal_error ("TODO: Functions with alternate entry points with non-matching types");
-	  else if (gfc_return_by_reference (ns->proc_name))
+	  if (gfc_return_by_reference (ns->proc_name))
 	    {
 	      tree ref = DECL_ARGUMENTS (current_function_decl);
 	      args = tree_cons (NULL_TREE, ref, args);
@@ -1438,7 +1436,41 @@ build_entry_thunks (gfc_namespace * ns)
       args = chainon (args, nreverse (string_args));
       tmp = ns->proc_name->backend_decl;
       tmp = gfc_build_function_call (tmp, args);
-      if (TREE_TYPE (DECL_RESULT (current_function_decl)) != void_type_node)
+      if (ns->proc_name->attr.mixed_entry_master)
+	{
+	  tree union_decl, field;
+	  tree master_type = TREE_TYPE (ns->proc_name->backend_decl);
+
+	  union_decl = build_decl (VAR_DECL, get_identifier ("__result"),
+				   TREE_TYPE (master_type));
+	  DECL_ARTIFICIAL (union_decl) = 1;
+	  DECL_EXTERNAL (union_decl) = 0;
+	  TREE_PUBLIC (union_decl) = 0;
+	  TREE_USED (union_decl) = 1;
+	  layout_decl (union_decl, 0);
+	  pushdecl (union_decl);
+
+	  DECL_CONTEXT (union_decl) = current_function_decl;
+	  tmp = build2 (MODIFY_EXPR,
+			TREE_TYPE (union_decl),
+			union_decl, tmp);
+	  gfc_add_expr_to_block (&body, tmp);
+
+	  for (field = TYPE_FIELDS (TREE_TYPE (union_decl));
+	       field; field = TREE_CHAIN (field))
+	    if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)),
+		thunk_sym->result->name) == 0)
+	      break;
+	  gcc_assert (field != NULL_TREE);
+	  tmp = build3 (COMPONENT_REF, TREE_TYPE (field), union_decl, field,
+			NULL_TREE);
+	  tmp = build2 (MODIFY_EXPR,
+			TREE_TYPE (DECL_RESULT (current_function_decl)),
+			DECL_RESULT (current_function_decl), tmp);
+	  tmp = build1_v (RETURN_EXPR, tmp);
+	}
+      else if (TREE_TYPE (DECL_RESULT (current_function_decl))
+	       != void_type_node)
 	{
 	  tmp = build2 (MODIFY_EXPR,
 			TREE_TYPE (DECL_RESULT (current_function_decl)),
@@ -1522,6 +1554,27 @@ gfc_get_fake_result_decl (gfc_symbol * s
 
   char name[GFC_MAX_SYMBOL_LEN + 10];
 
+  if (current_function_namespace->proc_name->attr.mixed_entry_master
+      && sym != current_function_namespace->proc_name)
+    {
+      decl = gfc_get_fake_result_decl (current_function_namespace->proc_name);
+      if (decl)
+	{
+	  tree field;
+
+	  for (field = TYPE_FIELDS (TREE_TYPE (decl));
+	       field; field = TREE_CHAIN (field))
+	    if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)),
+		sym->name) == 0)
+	      break;
+
+	  gcc_assert (field != NULL_TREE);
+	  decl = build3 (COMPONENT_REF, TREE_TYPE (field), decl, field,
+			 NULL_TREE);
+	}
+      return decl;
+    }
+
   if (current_fake_result_decl != NULL_TREE)
     return current_fake_result_decl;
 
--- gcc/testsuite/gfortran.fortran-torture/execute/entry_2.f90.jj	2005-04-11 13:59:08.000000000 +0200
+++ gcc/testsuite/gfortran.fortran-torture/execute/entry_2.f90	2005-04-11 14:41:50.000000000 +0200
@@ -0,0 +1,64 @@
+! Test alternate entry points for functions when the result types
+! of all entry points don't match
+
+	integer function f1 (a)
+	integer a, b
+	double precision e1
+	f1 = 15 + a
+	return
+	entry e1 (b)
+	e1 = 42 + b
+	end function
+	complex function f2 (a)
+	integer a
+	logical e2
+	entry e2 (a)
+	if (a .gt. 0) then
+	  e2 = a .lt. 46
+	else
+	  f2 = 45
+	endif
+	end function
+	function f3 (a) result (r)
+	integer a, b
+	real r
+	logical s
+	complex c
+	r = 15 + a
+	return
+	entry e3 (b) result (s)
+	s = b .eq. 42
+	return
+	entry g3 (b) result (c)
+	c = b + 11
+	end function
+	function f4 (a) result (r)
+	logical r
+	integer a, s
+	double precision t
+	entry e4 (a) result (s)
+	entry g4 (a) result (t)
+	r = a .lt. 0
+	if (a .eq. 0) s = 16 + a
+	if (a .gt. 0) t = 17 + a
+	end function
+
+	program entrytest
+	integer f1, e4
+	real f3
+	double precision e1, g4
+	logical e2, e3, f4
+	complex f2, g3
+	if (f1 (6) .ne. 21) call abort ()
+	if (e1 (7) .ne. 49) call abort ()
+	if (f2 (0) .ne. 45) call abort ()
+	if (.not. e2 (45)) call abort ()
+	if (e2 (46)) call abort ()
+	if (f3 (17) .ne. 32) call abort ()
+	if (.not. e3 (42)) call abort ()
+	if (e3 (41)) call abort ()
+	if (g3 (12) .ne. 23) call abort ()
+	if (.not. f4 (-5)) call abort ()
+	if (e4 (0) .ne. 16) call abort ()
+	if (g4 (2) .ne. 19) call abort ()
+	end

gcc4-gfortran-pr13082.patch:
 fortran/decl.c                    |    5 +-
 fortran/resolve.c                 |   17 ++++++++-
 fortran/trans-decl.c              |   70 ++++++++++++++++++++++++++++++++++----
 fortran/trans-expr.c              |   49 +++++++++++++++++++++-----
 fortran/trans.h                   |    3 +
 testsuite/gfortran.dg/entry_3.f90 |   57 ++++++++++++++++++++++++++++++
 testsuite/gfortran.dg/entry_4.f90 |   32 +++++++++++++++++
 7 files changed, 214 insertions(+), 19 deletions(-)

--- NEW FILE gcc4-gfortran-pr13082.patch ---
2005-04-08  Jakub Jelinek  <jakub at redhat.com>

	PR fortran/13082
	* trans.h (current_function_namespace): Declare.
	* trans-expr.c (gfc_conv_variable): Handle return values in functions
	with alternate entry points.
	* resolve.c (resolve_entries): Set result of entry master.
	If all entries have the same type, set entry master's type
	to that common type.
	* decl.c (gfc_match_entry): Set entry->result properly for
	function ENTRY.
	* trans-decl.c (current_function_namespace): New global variable.
	(build_entry_thunks): Save, set and restore
	current_function_namespace.  Handle return values in entry
	thunks if all entries have the same type.  Clear BT_CHARACTER's
	ts.cl->backend_decl, so that it is not shared between multiple
	contexts.
	(gfc_get_fake_result_decl): Use DECL_ARGUMENTS from
	current_function_decl instead of sym->backend_decl.  Skip over
	entry master's entry id argument.
	(gfc_generate_function_code): Save, set and restore
	current_function_namespace.  For entry master returning
	CHARACTER, copy ts.cl->backend_decl to all entry result syms.

	* gfortran.dg/entry_3.f90: New test.
	* gfortran.dg/entry_4.f90: New test.

--- gcc/fortran/trans.h.jj	2005-04-08 13:03:56.000000000 +0200
+++ gcc/fortran/trans.h	2005-04-08 16:18:55.000000000 +0200
@@ -419,6 +419,9 @@ void gfc_get_backend_locus (locus *);
 extern GTY(()) tree gfc_static_ctors;
 void gfc_generate_constructors (void);
 
+/* The namespace of the current function.  */
+extern gfc_namespace *current_function_namespace;
+
 /* Generate a runtime error check.  */
 void gfc_trans_runtime_check (tree, tree, stmtblock_t *);
 
--- gcc/fortran/trans-expr.c.jj	2005-04-08 13:03:56.000000000 +0200
+++ gcc/fortran/trans-expr.c	2005-04-08 16:18:55.000000000 +0200
@@ -308,11 +308,48 @@ gfc_conv_variable (gfc_se * se, gfc_expr
     }
   else
     {
+      tree se_expr = NULL_TREE;
+
       se->expr = gfc_get_symbol_decl (sym);
 
+      /* Special case for assigning the return value of a function.
+	 Self recursive functions must have an explicit return value.  */
+      if (se->expr == current_function_decl && sym->attr.function
+	  && (sym->result == sym))
+	se_expr = gfc_get_fake_result_decl (sym);
+
+      /* Similarly for alternate entry points.  */
+      else if (sym->attr.function && sym->attr.entry
+	       && (sym->result == sym) && current_function_namespace)
+	{
+	  gfc_entry_list *el = NULL;
+
+	  for (el = current_function_namespace->entries; el; el = el->next)
+	    if (sym == el->sym)
+	      {
+		se_expr = gfc_get_fake_result_decl (sym);
+		break;
+	      }
+	}
+
+      else if (sym->attr.result && current_function_namespace
+	       && current_function_namespace->proc_name->attr.entry_master)
+	{
+	  if (current_function_namespace->proc_name->ts.type == BT_UNKNOWN)
+	    {
+	      /* TODO: Handle non-matching returns.  */
+	      gfc_internal_error ("TODO: Functions with alternate entry points with non-matching types");
+	    }
+	  else
+	    se_expr = gfc_get_fake_result_decl (sym);
+	}
+
+      if (se_expr)
+	se->expr = se_expr;
+
       /* Procedure actual arguments.  */
-      if (sym->attr.flavor == FL_PROCEDURE
-	  && se->expr != current_function_decl)
+      else if (sym->attr.flavor == FL_PROCEDURE
+	       && se->expr != current_function_decl)
 	{
 	  gcc_assert (se->want_pointer);
 	  if (!sym->attr.dummy)
@@ -323,14 +360,6 @@ gfc_conv_variable (gfc_se * se, gfc_expr
 	  return;
 	}
 
-      /* Special case for assigning the return value of a function.
-         Self recursive functions must have an explicit return value.  */
-      if (se->expr == current_function_decl && sym->attr.function
-	  && (sym->result == sym))
-	{
-	  se->expr = gfc_get_fake_result_decl (sym);
-	}
-
       /* Dereference scalar dummy variables.  */
       if (sym->attr.dummy
 	  && sym->ts.type != BT_CHARACTER
--- gcc/fortran/resolve.c.jj	2005-04-08 13:03:56.000000000 +0200
+++ gcc/fortran/resolve.c	2005-04-08 16:18:55.000000000 +0200
@@ -370,7 +370,22 @@ resolve_entries (gfc_namespace * ns)
   else
     {
       gfc_add_function (&proc->attr, proc->name, NULL);
-      gfc_internal_error ("TODO: Functions with alternate entry points");
+      proc->result = proc;
+      for (el = ns->entries->next; el; el = el->next)
+	if (! gfc_compare_types (&el->sym->result->ts,
+				 &ns->entries->sym->result->ts))
+	  break;
+
+      if (el == NULL)
+	/* All result types the same.  */
+	proc->ts = ns->entries->sym->result->ts;
+      else
+	{
+	  /* Otherwise the result will be passed through an union by
+	     reference.  */
+	  proc->ts.type = BT_UNKNOWN;
+	  gfc_internal_error ("TODO: Functions with alternate entry points with non-matching types");
+	}
     }
   proc->attr.access = ACCESS_PRIVATE;
   proc->attr.entry_master = 1;
--- gcc/fortran/decl.c.jj	2005-04-08 13:03:56.000000000 +0200
+++ gcc/fortran/decl.c	2005-04-08 16:18:55.000000000 +0200
@@ -2407,8 +2407,7 @@ gfc_match_entry (void)
 	      || gfc_add_function (&entry->attr, entry->name, NULL) == FAILURE)
 	    return MATCH_ERROR;
 
-	  entry->result = proc->result;
-
+	  entry->result = entry;
 	}
       else
 	{
@@ -2423,6 +2422,8 @@ gfc_match_entry (void)
 	      || gfc_add_function (&entry->attr, result->name,
 				   NULL) == FAILURE)
 	    return MATCH_ERROR;
+
+	  entry->result = result;
 	}
 
       if (proc->attr.recursive && result == NULL)
--- gcc/fortran/trans-decl.c.jj	2005-04-08 13:03:56.000000000 +0200
+++ gcc/fortran/trans-decl.c	2005-04-08 16:18:55.000000000 +0200
@@ -65,6 +65,11 @@ static GTY(()) tree saved_parent_functio
 static gfc_namespace *module_namespace;
 
 
+/* The namespace of the current function.  */
+
+gfc_namespace *current_function_namespace;
+
+
 /* List of static constructor functions.  */
 
 tree gfc_static_ctors;
@@ -1348,10 +1353,14 @@ build_entry_thunks (gfc_namespace * ns)
   tree string_args;
   tree tmp;
   locus old_loc;
+  gfc_namespace *old_ns;
 
   /* This should always be a toplevel function.  */
   gcc_assert (current_function_decl == NULL_TREE);
 
+  old_ns = current_function_namespace;
+  current_function_namespace = ns;
+
   gfc_get_backend_locus (&old_loc);
   for (el = ns->entries; el; el = el->next)
     {
@@ -1371,10 +1380,20 @@ build_entry_thunks (gfc_namespace * ns)
       args = tree_cons (NULL_TREE, tmp, NULL_TREE);
       string_args = NULL_TREE;
 
-      /* TODO: Pass return by reference parameters.  */
-      if (ns->proc_name->attr.function)
-	gfc_todo_error ("Functons with multiple entry points");
-      
+      if (thunk_sym->attr.function)
+	{
+	  if (ns->proc_name->ts.type == BT_UNKNOWN)
+	    gfc_internal_error ("TODO: Functions with alternate entry points with non-matching types");
+	  else if (gfc_return_by_reference (ns->proc_name))
+	    {
+	      tree ref = DECL_ARGUMENTS (current_function_decl);
+	      args = tree_cons (NULL_TREE, ref, args);
+	      if (ns->proc_name->ts.type == BT_CHARACTER)
+		args = tree_cons (NULL_TREE, TREE_CHAIN (ref),
+				  args);
+	    }
+	}
+
       for (formal = ns->proc_name->formal; formal; formal = formal->next)
 	{
 	  /* We don't have a clever way of identifying arguments, so resort to
@@ -1415,7 +1434,17 @@ build_entry_thunks (gfc_namespace * ns)
       args = chainon (args, nreverse (string_args));
       tmp = ns->proc_name->backend_decl;
       tmp = gfc_build_function_call (tmp, args);
-      /* TODO: function return value.  */
+      if (thunk_sym->attr.function)
+	{
+	  if (TREE_TYPE (DECL_RESULT (current_function_decl))
+	      != void_type_node)
+	    {
+	      tmp = build2 (MODIFY_EXPR,
+			    TREE_TYPE (DECL_RESULT (current_function_decl)),
+			    DECL_RESULT (current_function_decl), tmp);
+	      tmp = build1_v (RETURN_EXPR, tmp);
+	    }
+	}
       gfc_add_expr_to_block (&body, tmp);
 
       /* Finish off this function and send it for code generation.  */
@@ -1449,9 +1478,19 @@ build_entry_thunks (gfc_namespace * ns)
 	  if (formal->sym->ts.type == BT_CHARACTER)
 	    formal->sym->ts.cl->backend_decl = NULL_TREE;
 	}
+
+      if (thunk_sym->attr.function)
+	{
+	  if (thunk_sym->ts.type == BT_CHARACTER)
+	    thunk_sym->ts.cl->backend_decl = NULL_TREE;
+	  if (thunk_sym->result->ts.type == BT_CHARACTER)
+	    thunk_sym->result->ts.cl->backend_decl = NULL_TREE;
+	}
     }
 
   gfc_set_backend_locus (&old_loc);
+
+  current_function_namespace = old_ns;
 }
 
 
@@ -1499,7 +1538,10 @@ gfc_get_fake_result_decl (gfc_symbol * s
 
   if (gfc_return_by_reference (sym))
     {
-      decl = DECL_ARGUMENTS (sym->backend_decl);
+      decl = DECL_ARGUMENTS (current_function_decl);
+
+      if (current_function_namespace->proc_name->attr.entry_master)
+	decl = TREE_CHAIN (decl);
 
       TREE_USED (decl) = 1;
       if (sym->as)
@@ -2176,6 +2218,7 @@ gfc_generate_function_code (gfc_namespac
   stmtblock_t body;
   tree result;
   gfc_symbol *sym;
+  gfc_namespace *old_ns;
 
   sym = ns->proc_name;
 
@@ -2197,6 +2240,9 @@ gfc_generate_function_code (gfc_namespac
       saved_function_decls = NULL_TREE;
     }
 
+  old_ns = current_function_namespace;
+  current_function_namespace = ns;
+
   trans_function_start (sym);
 
   /* Will be created as needed.  */
@@ -2226,6 +2272,17 @@ gfc_generate_function_code (gfc_namespac
 
   if (ns->entries)
     {
+      if (ns->proc_name->ts.type == BT_CHARACTER)
+	{
+	  /* Copy length backend_decls to all entry point result
+	     symbols.  */
+	  gfc_entry_list *el;
+	  tree backend_decl = ns->proc_name->result->ts.cl->backend_decl;
+
+	  for (el = ns->entries; el; el = el->next)
+	    el->sym->result->ts.cl->backend_decl = backend_decl;
+	}
+
       /* Jump to the correct entry point.  */
       tmp = gfc_trans_entry_master_switch (ns->entries);
       gfc_add_expr_to_block (&body, tmp);
@@ -2305,6 +2362,7 @@ gfc_generate_function_code (gfc_namespac
       saved_function_decls = saved_parent_function_decls;
     }
   current_function_decl = old_context;
+  current_function_namespace = old_ns;
 
   if (decl_function_context (fndecl))
     /* Register this function with cgraph just far enough to get it
--- gcc/testsuite/gfortran.dg/entry_3.f90.jj	2005-04-08 13:24:01.000000000 +0200
+++ gcc/testsuite/gfortran.dg/entry_3.f90	2005-04-08 13:25:00.000000000 +0200
@@ -0,0 +1,57 @@
+! { dg-do run }
+! Test alternate entry points for functions when the result types
+! of all entry points match
+
+	function f1 (a)
+	integer a, b, f1, e1
+	f1 = 15 + a
+	return
+	entry e1 (b)
+	e1 = 42 + b
+	end function
+	function f2 ()
+	real f2, e2
+	entry e2 ()
+	e2 = 45
+	end function
+	function f3 ()
+	double precision a, b, f3, e3
+	entry e3 ()
+	f3 = 47
+	end function
+	function f4 (a) result (r)
+	double precision a, b, r, s
+	r = 15 + a
+	return
+	entry e4 (b) result (s)
+	s = 42 + b
+	end function
+	function f5 () result (r)
+	integer r, s
+	entry e5 () result (s)
+	r = 45
+	end function
+	function f6 () result (r)
+	real r, s
+	entry e6 () result (s)
+	s = 47
+	end function
+
+	program entrytest
+	integer f1, e1, f5, e5
+	real f2, e2, f6, e6
+	double precision f3, e3, f4, e4, d
+	if (f1 (6) .ne. 21) call abort ()
+	if (e1 (7) .ne. 49) call abort ()
+	if (f2 () .ne. 45) call abort ()
+	if (e2 () .ne. 45) call abort ()
+	if (f3 () .ne. 47) call abort ()
+	if (e3 () .ne. 47) call abort ()
+	d = 17
+	if (f4 (d) .ne. 32) call abort ()
+	if (e4 (d) .ne. 59) call abort ()
+	if (f5 () .ne. 45) call abort ()
+	if (e5 () .ne. 45) call abort ()
+	if (f6 () .ne. 47) call abort ()
+	if (e6 () .ne. 47) call abort ()
+	end
--- gcc/testsuite/gfortran.dg/entry_4.f90.jj	2005-04-08 15:42:58.000000000 +0200
+++ gcc/testsuite/gfortran.dg/entry_4.f90	2005-04-08 15:55:50.000000000 +0200
@@ -0,0 +1,32 @@
+! { dg-do run }
+! Test alternate entry points for functions when the result types
+! of all entry points match
+
+	character*(*) function f1 (str, i, j)
+	character str*(*), e1*(*), e2*(*)
+	integer i, j
+	f1 = str (i:j)
+	return
+	entry e1 (str, i, j)
+	i = i + 1
+	entry e2 (str, i, j)
+	j = j - 1
+	e2 = str (i:j)
+	end function
+
+	program entrytest
+	character f1*16, e1*16, e2*16, str*16, ret*16
+	integer i, j
+	str = 'ABCDEFGHIJ'
+	i = 2
+	j = 6
+	ret = f1 (str, i, j)
+	if ((i .ne. 2) .or. (j .ne. 6)) call abort ()
+	if (ret .ne. 'BCDEF') call abort ()
+	ret = e1 (str, i, j)
+	if ((i .ne. 3) .or. (j .ne. 5)) call abort ()
+	if (ret .ne. 'CDE') call abort ()
+	ret = e2 (str, i, j)
+	if ((i .ne. 3) .or. (j .ne. 4)) call abort ()
+	if (ret .ne. 'CD') call abort ()
+	end program

gcc4-gfortran-pr18824.patch:
 fortran/trans-decl.c                                   |   29 ++++++------
 testsuite/gfortran.fortran-torture/execute/entry_1.f90 |   40 +++++++++++++++++
 2 files changed, 55 insertions(+), 14 deletions(-)

--- NEW FILE gcc4-gfortran-pr18824.patch ---
2005-04-08  Jakub Jelinek  <jakub at redhat.com>

	PR fortran/18824
	* trans-decl.c (build_entry_thunks): Ignore alternate return dummy
	arguments.  Return whatever entry master returned whenever its
	DECL_RESULT has non-void type.

	* gfortran.fortran-torture/execute/entry_1.f90: New test.

--- gcc/fortran/trans-decl.c	2005-04-08 16:18:55.000000000 +0200
+++ gcc/fortran/trans-decl.c	2005-04-08 21:44:42.000000000 +0200
@@ -1396,6 +1396,10 @@ build_entry_thunks (gfc_namespace * ns)
 
       for (formal = ns->proc_name->formal; formal; formal = formal->next)
 	{
+	  /* Ignore alternate returns.  */
+	  if (formal->sym == NULL)
+	    continue;
+
 	  /* We don't have a clever way of identifying arguments, so resort to
 	     a brute-force search.  */
 	  for (thunk_formal = thunk_sym->formal;
@@ -1434,16 +1438,12 @@ build_entry_thunks (gfc_namespace * ns)
       args = chainon (args, nreverse (string_args));
       tmp = ns->proc_name->backend_decl;
       tmp = gfc_build_function_call (tmp, args);
-      if (thunk_sym->attr.function)
+      if (TREE_TYPE (DECL_RESULT (current_function_decl)) != void_type_node)
 	{
-	  if (TREE_TYPE (DECL_RESULT (current_function_decl))
-	      != void_type_node)
-	    {
-	      tmp = build2 (MODIFY_EXPR,
-			    TREE_TYPE (DECL_RESULT (current_function_decl)),
-			    DECL_RESULT (current_function_decl), tmp);
-	      tmp = build1_v (RETURN_EXPR, tmp);
-	    }
+	  tmp = build2 (MODIFY_EXPR,
+			TREE_TYPE (DECL_RESULT (current_function_decl)),
+			DECL_RESULT (current_function_decl), tmp);
+	  tmp = build1_v (RETURN_EXPR, tmp);
 	}
       gfc_add_expr_to_block (&body, tmp);
 
@@ -1473,11 +1473,12 @@ build_entry_thunks (gfc_namespace * ns)
 	 points and the master function.  Clear them so that they are
 	 recreated for each function.  */
       for (formal = thunk_sym->formal; formal; formal = formal->next)
-	{
-	  formal->sym->backend_decl = NULL_TREE;
-	  if (formal->sym->ts.type == BT_CHARACTER)
-	    formal->sym->ts.cl->backend_decl = NULL_TREE;
-	}
+	if (formal->sym != NULL)  /* Ignore alternate returns.  */
+	  {
+	    formal->sym->backend_decl = NULL_TREE;
+	    if (formal->sym->ts.type == BT_CHARACTER)
+	      formal->sym->ts.cl->backend_decl = NULL_TREE;
+	  }
 
       if (thunk_sym->attr.function)
 	{
--- gcc/testsuite/gfortran.fortran-torture/execute/entry_1.f90.jj	2005-04-08 22:05:55.000000000 +0200
+++ gcc/testsuite/gfortran.fortran-torture/execute/entry_1.f90	2005-04-08 22:10:15.000000000 +0200
@@ -0,0 +1,40 @@
+	subroutine f1 (n, *, i)
+	integer n, i
+	if (i .ne. 42) call abort ()
+	entry e1 (n, *)
+	if (n .eq. 1) return 1
+	if (n .eq. 2) return
+	return
+	entry e2 (n, i, *, *, *)
+	if (i .ne. 46) call abort ()
+	if (n .ge. 4) return
+	return n
+	entry e3 (n, i)
+	if ((i .ne. 48) .or. (n .ne. 61)) call abort ()
+	end subroutine
+
+	program alt_return
+	implicit none
+
+	call f1 (1, *10, 42)
+20	continue
+	call abort ()
+10	continue
+	call f1 (2, *20, 42)
+	call f1 (3, *20, 42)
+	call e1 (2, *20)
+	call e1 (1, *30)
+	call abort ()
+30	continue
+	call e2 (1, 46, *40, *20, *20)
+	call abort ()
+40	continue
+	call e2 (2, 46, *20, *50, *20)
+	call abort ()
+50	continue
+	call e2 (3, 46, *20, *20, *60)
+	call abort ()
+60	continue
+	call e2 (4, 46, *20, *20, *20)
+	call e3 (61, 48)
+	end program

gcc4-libgfortran-pr20163.patch:
 gcc/testsuite/gfortran.dg/open-options-blanks.f |    7 +++++++
 libgfortran/runtime/string.c                    |   14 ++++----------
 2 files changed, 11 insertions(+), 10 deletions(-)

--- NEW FILE gcc4-libgfortran-pr20163.patch ---
2005-04-09  Thomas Koenig  <Thomas.Koenig at online.de>

	PR libfortran/20163
	* runtime/string.c (compare0): Use fstrlen() to 
	strip trailing blanks from option string.

	* gfortran.dg/open-options-blanks.f:  New test.

--- libgfortran/runtime/string.c	12 Jan 2005 21:27:31 -0000	1.4
+++ libgfortran/runtime/string.c	9 Apr 2005 19:37:14 -0000	1.5
@@ -41,17 +41,11 @@ static int
 compare0 (const char *s1, int s1_len, const char *s2)
 {
   int i;
+  int len;
 
-  if (strncasecmp (s1, s2, s1_len) != 0)
-    return 0;
-
-  /* The rest of s1 needs to be blanks for equality.  */
-
-  for (i = strlen (s2); i < s1_len; i++)
-    if (s1[i] != ' ')
-      return 0;
-
-  return 1;
+  /* Strip trailing blanks from the Fortran string.  */
+  len = fstrlen(s1, s1_len);
+  return strncasecmp(s1,s2,len) == 0;
 }
 
 
--- gcc/testsuite/gfortran.dg/open-options-blanks.f	1 Jan 1970 00:00:00 -0000
+++ gcc/testsuite/gfortran.dg/open-options-blanks.f	9 Apr 2005 19:40:48 -0000	1.1
@@ -0,0 +1,7 @@
+! { dg-do run }
+! PR 20163, first half:  Trailing blanks on an option to
+!                        open used to cause an error
+      CHARACTER*8 ST
+      ST = 'SCRATCH '
+      OPEN(UNIT=10,STATUS=ST)
+      END

gcc4-ppc32-hwint32.patch:
 config.gcc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

--- NEW FILE gcc4-ppc32-hwint32.patch ---
--- gcc/config.gcc	2005-04-03 10:33:20.000000000 +0200
+++ gcc/config.gcc	2005-04-13 00:41:26.000000000 +0200
@@ -288,7 +288,10 @@ mips*-*-*)
 powerpc*-*-*)
 	cpu_type=rs6000
 	extra_headers="ppc-asm.h altivec.h spe.h"
-	need_64bit_hwint=yes
+	case ${target} in
+	powerpc-*-linux*) ;;
+	*) need_64bit_hwint=yes ;;
+	esac
 	case x$with_cpu in
 	    xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345]|xrs64a)
 		cpu_is_64bit=yes

gcc4-pr20490.patch:
 testsuite/gcc.dg/tree-ssa/pr20490.c |   20 ++++++++++++++++++++
 tree-ssa-pre.c                      |   25 +++++++++++++++++++++----
 2 files changed, 41 insertions(+), 4 deletions(-)

--- NEW FILE gcc4-pr20490.patch ---
2005-03-16  Daniel Berlin  <dberlin at dberlin.org>

        Fix PR tree-optimization/20490

        * tree-ssa-pre.c (create_expression_by_pieces): Use
        force_gimple_operand on result of fold.

--- gcc/tree-ssa-pre.c	2005/03/12 14:07:53	2.70
+++ gcc/tree-ssa-pre.c	2005/03/16 16:20:09	2.71
@@ -1317,16 +1317,25 @@
     case tcc_binary:
       {
 	tree_stmt_iterator tsi;
+	tree forced_stmts;
 	tree genop1, genop2;
 	tree temp;
+	tree folded;
 	tree op1 = TREE_OPERAND (expr, 0);
 	tree op2 = TREE_OPERAND (expr, 1);
 	genop1 = find_or_generate_expression (block, op1, stmts);
 	genop2 = find_or_generate_expression (block, op2, stmts);
 	temp = create_tmp_var (TREE_TYPE (expr), "pretmp");
 	add_referenced_tmp_var (temp);
-	newexpr = fold (build (TREE_CODE (expr), TREE_TYPE (expr), 
-			       genop1, genop2));
+	
+	folded = fold (build (TREE_CODE (expr), TREE_TYPE (expr), 
+			      genop1, genop2));
+	newexpr = force_gimple_operand (folded, &forced_stmts, false, NULL);
+	if (forced_stmts)
+	  {
+	    tsi = tsi_last (stmts);
+	    tsi_link_after (&tsi, forced_stmts, TSI_CONTINUE_LINKING);
+	  }
 	newexpr = build (MODIFY_EXPR, TREE_TYPE (expr),
 			 temp, newexpr);
 	NECESSARY (newexpr) = 0;
@@ -1341,14 +1350,22 @@
     case tcc_unary:
       {
 	tree_stmt_iterator tsi;
+	tree forced_stmts;
 	tree genop1;
 	tree temp;
+	tree folded;
 	tree op1 = TREE_OPERAND (expr, 0);
 	genop1 = find_or_generate_expression (block, op1, stmts);
 	temp = create_tmp_var (TREE_TYPE (expr), "pretmp");
 	add_referenced_tmp_var (temp);
-	newexpr = fold (build (TREE_CODE (expr), TREE_TYPE (expr), 
-			       genop1));
+	folded = fold (build (TREE_CODE (expr), TREE_TYPE (expr), 
+			      genop1));
+	newexpr = force_gimple_operand (folded, &forced_stmts, false, NULL);
+	if (forced_stmts)
+	  {
+	    tsi = tsi_last (stmts);
+	    tsi_link_after (&tsi, forced_stmts, TSI_CONTINUE_LINKING);
+	  }
 	newexpr = build (MODIFY_EXPR, TREE_TYPE (expr),
 			 temp, newexpr);
 	name = make_ssa_name (temp, newexpr);
--- gcc/testsuite/gcc.dg/tree-ssa/pr20490.c	2005-04-07 15:51:53.775361896 +0200
+++ gcc/testsuite/gcc.dg/tree-ssa/pr20490.c	2005-03-16 17:22:45.000000000 +0100
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-pre" } */
+static int  a;
+static int  b;
+
+typedef int gint;
+
+int blah ()
+{
+	gint x = a;
+	gint y = b;
+
+	x *= (x < 0) ? -1 : 0;
+	y *= (y < 0) ? -1 : 0;
+
+	return (y * x);
+
+}
+
+

gcc4-pr20739.patch:
 gimplify.c                          |    9 ++++++---
 testsuite/gcc.dg/tree-ssa/pr20739.c |   24 ++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 3 deletions(-)

--- NEW FILE gcc4-pr20739.patch ---
2005-04-04  Alexandre Oliva  <aoliva at redhat.com>

	PR middle-end/20739
	* gimplify.c (gimplify_addr_expr): Compensate for removal of
	e.g. cv-qualification conversions.

	* gcc.dg/tree-ssa/pr20739.c: New test.

--- gcc/gimplify.c 1 Apr 2005 03:42:41 -0000 2.122
+++ gcc/gimplify.c 4 Apr 2005 11:28:04 -0000
@@ -3229,6 +3232,9 @@ gimplify_addr_expr (tree *expr_p, tree *
 	 builtins like __builtin_va_end).  */
       /* Caution: the silent array decomposition semantics we allow for
 	 ADDR_EXPR means we can't always discard the pair.  */
+      /* Gimplification of the ADDR_EXPR operand may drop
+	 cv-qualification conversions, so make sure we add them if
+	 needed.  */
       {
 	tree op00 = TREE_OPERAND (op0, 0);
 	tree t_expr = TREE_TYPE (expr);
@@ -3238,9 +3244,9 @@ gimplify_addr_expr (tree *expr_p, tree *
 	  {
 #ifdef ENABLE_CHECKING
 	    tree t_op0 = TREE_TYPE (op0);
-	    gcc_assert (TREE_CODE (t_op0) == ARRAY_TYPE
-			&& POINTER_TYPE_P (t_expr)
-			&& cpt_same_type (TREE_TYPE (t_op0),
+	    gcc_assert (POINTER_TYPE_P (t_expr)
+			&& cpt_same_type (TREE_CODE (t_op0) == ARRAY_TYPE
+					  ? TREE_TYPE (t_op0) : t_op0,
 					  TREE_TYPE (t_expr))
 			&& POINTER_TYPE_P (t_op00)
 			&& cpt_same_type (t_op0, TREE_TYPE (t_op00)));
--- gcc/testsuite/gcc.dg/tree-ssa/pr20739.c	1 Jan 1970 00:00:00 -0000
+++ gcc/testsuite/gcc.dg/tree-ssa/pr20739.c 4 Apr 2005 11:28:20 -0000
@@ -0,0 +1,24 @@
+/* PR middle-end/20739 */
+
+/* dg-do compile */
+/* dg-options "-O" */
+
+/* We used to fail to compile this because gimplification dropped the
+   conversion that added the const qualifier to the sub-expression
+   involving baz, and then immediately noticed and reported its
+   absence.  */
+
+typedef struct 
+{ 
+    char chars[5]; 
+} 
+baz_t; 
+ 
+extern baz_t * baz; 
+ 
+extern void foo (baz_t); 
+int 
+bar (const baz_t * ls) 
+{ 
+    foo (ls == 0 ? *(&baz[0]) : *ls); 
+}

gcc4-s390-pr20917.patch:
 config/s390/s390.md           |    6 +++---
 testsuite/gcc.dg/20050409-1.c |   18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 3 deletions(-)

--- NEW FILE gcc4-s390-pr20917.patch ---
2005-04-12  Ulrich Weigand  <uweigand at de.ibm.com>

	PR middle-end/20917
	* config/s390/s390.md ("*set_tp"): Use SET in pattern.
	("set_tp_64", "set_tp_31"): Adapt expanded pattern.

	* gcc.dg/20050409-1.c: New test.

--- gcc/config/s390/s390.md.jj	2005-03-11 13:07:09.000000000 +0100
+++ gcc/config/s390/s390.md	2005-04-12 22:48:55.000000000 +0200
@@ -7780,18 +7780,18 @@
 
 (define_expand "set_tp_64"
   [(set (reg:DI 36) (match_operand:DI 0 "nonimmediate_operand" ""))
-   (unspec_volatile [(reg:DI 36)] UNSPECV_SET_TP)]
+   (set (reg:DI 36) (unspec_volatile:DI [(reg:DI 36)] UNSPECV_SET_TP))]
   "TARGET_64BIT"
   "")
 
 (define_expand "set_tp_31"
   [(set (reg:SI 36) (match_operand:SI 0 "nonimmediate_operand" ""))
-   (unspec_volatile [(reg:SI 36)] UNSPECV_SET_TP)]
+   (set (reg:SI 36) (unspec_volatile:SI [(reg:SI 36)] UNSPECV_SET_TP))]
   "!TARGET_64BIT"
   "")
 
 (define_insn "*set_tp"
-  [(unspec_volatile [(reg 36)] UNSPECV_SET_TP)]
+  [(set (reg 36) (unspec_volatile [(reg 36)] UNSPECV_SET_TP))]
   ""
   ""
   [(set_attr "type" "none")
--- gcc/testsuite/gcc.dg/20050409-1.c.jj	2005-04-12 22:48:55.000000000 +0200
+++ gcc/testsuite/gcc.dg/20050409-1.c	2005-04-12 22:48:55.000000000 +0200
@@ -0,0 +1,18 @@
+/* This used to ICE due to a regmove problem on s390.  */
+
+/* { dg-do compile { target s390*-*-* } } */
+/* { dg-options "-O2" } */
+
+
+extern void abort (void);
+extern void **alloc (void);
+
+void *test (void)
+{
+  void **p = alloc ();
+  if (!p) abort ();
+
+  __builtin_set_thread_pointer (p);
+  return *p;
+}
+

gcc4-struct-layout.patch:
 g++.dg/compat/struct-layout-1.h          |  155 +++++++++++++++++++++++
 g++.dg/compat/struct-layout-1_generate.c |  109 +++++++++++++++-
 gcc.dg/compat/struct-layout-1.h          |  205 +++++++++++++++++++++++++++++++
 gcc.dg/compat/struct-layout-1_generate.c |  186 ++++++++++++++++++++++++++--
 4 files changed, 641 insertions(+), 14 deletions(-)

--- NEW FILE gcc4-struct-layout.patch ---
2005-04-12  Jakub Jelinek  <jakub at redhat.com>

	* gcc.dg/compat/struct-layout-1_generate.c: In arrays avoid types
	where sizeof (type) < __alignof__ (type).
	* gcc.dg/compat/struct-layout-1.h: Likewise.
	* g++.dg/compat/struct-layout-1_generate.c: Likewise.
	* g++.dg/compat/struct-layout-1.h: Likewise.
	
--- gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c.jj	2004-11-07 12:36:41.000000000 +0100
+++ gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c	2005-04-11 17:47:45.000000000 +0200
@@ -1,5 +1,5 @@
 /* Structure layout test generator.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
    Contributed by Jakub Jelinek <jakub at redhat.com>.
 
 This file is part of GCC.
@@ -459,6 +459,149 @@ struct types complex_attrib_types[] = {
 { "Tal16cldouble", TYPE_CFLOAT, 0, 0 }
 #define NCATYPES2 (sizeof (complex_attrib_types) / sizeof (complex_attrib_types[0]))
 };
+struct types attrib_array_types[] = {
+{ "Talx1char", TYPE_UINT, 127, 'C' },
+{ "Talx1schar", TYPE_INT, 127, 'C' },
+{ "Talx1uchar", TYPE_UINT, 255, 'C' },
+{ "Talx1short", TYPE_INT, 32767, 'S' },
+{ "Talx1ushort", TYPE_UINT, 65535, 'S' },
+{ "Talx1int", TYPE_INT, 2147483647, 'I' },
+{ "Talx1uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Talx1long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Talx1ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx1llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx1ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Talx1bool", TYPE_UINT, 1, 'B' },
+{ "Talx1ptr", TYPE_PTR, 0, 0 },
+{ "Talx1cptr", TYPE_PTR, 0, 0 },
+{ "Talx1iptr", TYPE_PTR, 0, 0 },
+{ "Talx1float", TYPE_FLOAT, 0, 0 },
+{ "Talx1double", TYPE_FLOAT, 0, 0 },
+{ "Talx1ldouble", TYPE_FLOAT, 0, 0 },
+{ "Talx1E0", TYPE_UENUM, 0, ' ' },
+{ "Talx1E1", TYPE_UENUM, 1, ' ' },
+{ "Talx1E2", TYPE_SENUM, 3, ' ' },
+{ "Talx1E3", TYPE_SENUM, 127, ' ' },
+{ "Talx1E4", TYPE_UENUM, 255, ' ' },
+{ "Talx1E5", TYPE_SENUM, 32767, ' ' },
+{ "Talx1E6", TYPE_UENUM, 65535, ' ' },
+{ "Talx1E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Talx1E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Talx1E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Talx2short", TYPE_INT, 32767, 'S' },
+{ "Talx2ushort", TYPE_UINT, 65535, 'S' },
+{ "Talx2int", TYPE_INT, 2147483647, 'I' },
+{ "Talx2uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Talx2long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Talx2ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx2llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx2ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Talx2ptr", TYPE_PTR, 0, 0 },
+{ "Talx2cptr", TYPE_PTR, 0, 0 },
+{ "Talx2iptr", TYPE_PTR, 0, 0 },
+{ "Talx2float", TYPE_FLOAT, 0, 0 },
+{ "Talx2double", TYPE_FLOAT, 0, 0 },
+{ "Talx2ldouble", TYPE_FLOAT, 0, 0 },
+{ "Talx2E0", TYPE_UENUM, 0, ' ' },
+{ "Talx2E1", TYPE_UENUM, 1, ' ' },
+{ "Talx2E2", TYPE_SENUM, 3, ' ' },
+{ "Talx2E3", TYPE_SENUM, 127, ' ' },
+{ "Talx2E4", TYPE_UENUM, 255, ' ' },
+{ "Talx2E5", TYPE_SENUM, 32767, ' ' },
+{ "Talx2E6", TYPE_UENUM, 65535, ' ' },
+{ "Talx2E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Talx2E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Talx2E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Talx4int", TYPE_INT, 2147483647, 'I' },
+{ "Talx4uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Talx4long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Talx4ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx4llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx4ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Talx4ptr", TYPE_PTR, 0, 0 },
+{ "Talx4cptr", TYPE_PTR, 0, 0 },
+{ "Talx4iptr", TYPE_PTR, 0, 0 },
+{ "Talx4float", TYPE_FLOAT, 0, 0 },
+{ "Talx4double", TYPE_FLOAT, 0, 0 },
+{ "Talx4ldouble", TYPE_FLOAT, 0, 0 },
+{ "Talx4E0", TYPE_UENUM, 0, ' ' },
+{ "Talx4E1", TYPE_UENUM, 1, ' ' },
+{ "Talx4E2", TYPE_SENUM, 3, ' ' },
+{ "Talx4E3", TYPE_SENUM, 127, ' ' },
+{ "Talx4E4", TYPE_UENUM, 255, ' ' },
+{ "Talx4E5", TYPE_SENUM, 32767, ' ' },
+{ "Talx4E6", TYPE_UENUM, 65535, ' ' },
+{ "Talx4E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Talx4E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Talx4E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Taly8long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Taly8ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx8llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx8ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Taly8ptr", TYPE_PTR, 0, 0 },
+{ "Taly8cptr", TYPE_PTR, 0, 0 },
+{ "Taly8iptr", TYPE_PTR, 0, 0 },
+{ "Talx8double", TYPE_FLOAT, 0, 0 },
+{ "Talx8ldouble", TYPE_FLOAT, 0, 0 }
+#define NAATYPES2 (sizeof (attrib_array_types) / sizeof (attrib_array_types[0]))
+};
+struct types complex_attrib_array_types[] = {
+{ "Talx1cchar", TYPE_CUINT, 127, 0 },
+{ "Talx1cschar", TYPE_CINT, 127, 0 },
+{ "Talx1cuchar", TYPE_CUINT, 255, 0 },
+{ "Talx1cshort", TYPE_CINT, 32767, 0 },
+{ "Talx1cushort", TYPE_CUINT, 65535, 0 },
+{ "Talx1cint", TYPE_CINT, 2147483647, 0 },
+{ "Talx1cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Talx1clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx1culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx1cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx1cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx1cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Talx1cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx1cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx2cchar", TYPE_CUINT, 127, 0 },
+{ "Talx2cschar", TYPE_CINT, 127, 0 },
+{ "Talx2cuchar", TYPE_CUINT, 255, 0 },
+{ "Talx2cshort", TYPE_CINT, 32767, 0 },
+{ "Talx2cushort", TYPE_CUINT, 65535, 0 },
+{ "Talx2cint", TYPE_CINT, 2147483647, 0 },
+{ "Talx2cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Talx2clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx2culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx2cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx2cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx2cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Talx2cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx2cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx4cshort", TYPE_CINT, 32767, 0 },
+{ "Talx4cushort", TYPE_CUINT, 65535, 0 },
+{ "Talx4cint", TYPE_CINT, 2147483647, 0 },
+{ "Talx4cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Talx4clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx4culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx4cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx4cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx4cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Talx4cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx4cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx8cint", TYPE_CINT, 2147483647, 0 },
+{ "Talx8cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Talx8clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx8culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx8cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx8cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx8cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Talx8cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx8cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Taly16clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Taly16culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx16cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx16cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx16cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx16cldouble", TYPE_CFLOAT, 0, 0 }
+#define NCAATYPES2 (sizeof (complex_attrib_array_types) / sizeof (complex_attrib_array_types[0]))
+};
 
 struct types bitfld_types[NTYPES2];
 int n_bitfld_types;
@@ -1153,7 +1296,7 @@ singles (enum FEATURE features)
 }
 
 void
-choose_type (enum FEATURE features, struct entry *e, int r)
+choose_type (enum FEATURE features, struct entry *e, int r, int in_array)
 {
   int i;
 
@@ -1164,9 +1307,18 @@ choose_type (enum FEATURE features, stru
     i += NVTYPES2;
   if ((r & 3) == 0)
     {
-      i += NATYPES2;
-      if (features & FEATURE_COMPLEX)
-        i += NCATYPES2;
+      if (in_array)
+	{
+	  i += NAATYPES2;
+	  if (features & FEATURE_COMPLEX)
+	    i += NCAATYPES2;
+	}
+      else
+	{
+	  i += NATYPES2;
+	  if (features & FEATURE_COMPLEX)
+	    i += NCATYPES2;
+	}
     }
   r >>= 2;
   r %= i;
@@ -1185,18 +1337,30 @@ choose_type (enum FEATURE features, stru
 	e->type = &vector_types[r];
       r -= NVTYPES2;
     }
-  if (e->type == NULL)
+  if (e->type == NULL && !in_array)
     {
       if (r < NATYPES2)
 	e->type = &attrib_types[r];
       r -= NATYPES2;
     }
-  if (e->type == NULL && (features & FEATURE_COMPLEX))
+  if (e->type == NULL && !in_array && (features & FEATURE_COMPLEX))
     {
       if (r < NCATYPES2)
 	e->type = &complex_attrib_types[r];
       r -= NCATYPES2;
     }
+  if (e->type == NULL && in_array)
+    {
+      if (r < NAATYPES2)
+	e->type = &attrib_array_types[r];
+      r -= NAATYPES2;
+    }
+  if (e->type == NULL && in_array && (features & FEATURE_COMPLEX))
+    {
+      if (r < NCAATYPES2)
+	e->type = &complex_attrib_array_types[r];
+      r -= NCAATYPES2;
+    }
   if (e->type == NULL)
     abort ();
 }
@@ -1243,7 +1407,7 @@ generate_fields (enum FEATURE features, 
 	  break;
 	case 4:
 	  e[n].etype = ETYPE_TYPE;
-	  choose_type (features, &e[n], r);
+	  choose_type (features, &e[n], r, 0);
 	  break;
 	case 5:
 	  e[n].etype = ETYPE_ARRAY;
@@ -1252,7 +1416,7 @@ generate_fields (enum FEATURE features, 
 	  if (i)
 	    e[n].type = &base_types[r % NTYPES1];
 	  else
-	    choose_type (features, &e[n], r);
+	    choose_type (features, &e[n], r, 1);
 	  r = generate_random ();
 	  if ((features & FEATURE_ZEROARRAY) && (r & 3) == 0)
 	    {
@@ -1425,6 +1589,10 @@ generate_fields (enum FEATURE features, 
 		   && e[n].type < &attrib_types[NATYPES2])
 		  || (e[n].type >= &complex_attrib_types[0]
 		      && e[n].type < &complex_attrib_types[NCATYPES2])
+		  || (e[n].type >= &attrib_array_types[0]
+		      && e[n].type < &attrib_array_types[NAATYPES2])
+		  || (e[n].type >= &complex_attrib_array_types[0]
+		      && e[n].type < &complex_attrib_array_types[NAATYPES2])
 		  || (e[n].type >= &aligned_bitfld_types[0]
 		      && e[n].type < &aligned_bitfld_types[n_aligned_bitfld_types])))
 	    e[n].attrib = NULL;
--- gcc/testsuite/gcc.dg/compat/struct-layout-1.h.jj	2004-10-16 09:02:45.000000000 +0200
+++ gcc/testsuite/gcc.dg/compat/struct-layout-1.h	2005-04-11 17:48:37.000000000 +0200
@@ -101,6 +101,64 @@ extern int fn5 (void), fn6 (void), fn7 (
 #define atpaal8		__attribute__((packed, aligned (8)))
 #define atpaal16	__attribute__((packed, aligned (16)))
 
+#if UCHAR_MAX == 255 && USHORT_MAX == 65535 && UINT_MAX == 4294967295U \
+    && ULLONG_MAX == 18446744073709551615ULL
+/* For ILP32 and LP64 targets, assume float is at least 32-bit
+   and double plus long double at least 64-bit.  */
+# define atalx1		atal1
+# define atalx2		atal2
+# define atalx4		atal4
+# define atalx8		atal8
+# define atalx16	atal16
+# define atalx1pa	atal1pa
+# define atalx2pa	atal2pa
+# define atalx4pa	atal4pa
+# define atalx8pa	atal8pa
+# define atalx16pa	atal16pa
+# define atpaalx1	atpaal1
+# define atpaalx2	atpaal2
+# define atpaalx4	atpaal4
+# define atpaalx8	atpaal8
+# define atpaalx16	atpaal16
+# if ULONG_MAX > 4294967295UL
+#  define ataly8	atal8
+#  define ataly8pa	atal8pa
+#  define atpaaly8	atpaal8
+#  define ataly16	atal16
+#  define ataly16pa	atal16pa
+#  define atpaaly16	atpaal16
+# else
+#  define ataly8
+#  define ataly8pa
+#  define atpaaly8
+#  define ataly16
+#  define ataly16pa
+#  define atpaaly16
+# endif
+#else
+# define atalx1
+# define atalx2
+# define atalx4
+# define atalx8
+# define atalx16
+# define atalx1pa
+# define atalx2pa
+# define atalx4pa
+# define atalx8pa
+# define atalx16pa
+# define atpaalx1
+# define atpaalx2
+# define atpaalx4
+# define atpaalx8
+# define atpaalx16
+# define ataly8
+# define ataly8pa
+# define atpaaly8
+# define ataly16
+# define ataly16pa
+# define atpaaly16
+#endif
+
 #define atQI		__attribute__((mode (QI)))
 #define atHI		__attribute__((mode (HI)))
 #define atSI		__attribute__((mode (SI)))
@@ -427,6 +485,153 @@ typedef enum E9 Tal16E9 atal16;
 typedef void *Tal16ptr atal16;
 typedef char *Tal16cptr atal16;
 typedef int *Tal16iptr atal16;
+typedef char Talx1char atalx1;
+typedef signed char Talx1schar atalx1;
+typedef unsigned char Talx1uchar atalx1;
+typedef short int Talx1short atalx1;
+typedef unsigned short int Talx1ushort atalx1;
+typedef int Talx1int atalx1;
+typedef unsigned int Talx1uint atalx1;
+typedef long int Talx1long atalx1;
+typedef unsigned long int Talx1ulong atalx1;
+typedef long long int Talx1llong atalx1;
+typedef unsigned long long int Talx1ullong atalx1;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex char Talx1cchar atalx1;
+typedef _Complex signed char Talx1cschar atalx1;
+typedef _Complex unsigned char Talx1cuchar atalx1;
+typedef _Complex short int Talx1cshort atalx1;
+typedef _Complex unsigned short int Talx1cushort atalx1;
+typedef _Complex int Talx1cint atalx1;
+typedef _Complex unsigned int Talx1cuint atalx1;
+typedef _Complex long int Talx1clong atalx1;
+typedef _Complex unsigned long int Talx1culong atalx1;
+typedef _Complex long long int Talx1cllong atalx1;
+typedef _Complex unsigned long long int Talx1cullong atalx1;
+#endif
+typedef float Talx1float atalx1;
+typedef double Talx1double atalx1;
+typedef long double Talx1ldouble atalx1;
+typedef _Complex float Talx1cfloat atalx1;
+typedef _Complex double Talx1cdouble atalx1;
+typedef _Complex long double Talx1cldouble atalx1;
+typedef bool Talx1bool atalx1;
+typedef enum E0 Talx1E0 atalx1;
+typedef enum E1 Talx1E1 atalx1;
+typedef enum E2 Talx1E2 atalx1;
+typedef enum E3 Talx1E3 atalx1;
+typedef enum E4 Talx1E4 atalx1;
+typedef enum E5 Talx1E5 atalx1;
+typedef enum E6 Talx1E6 atalx1;
+typedef enum E7 Talx1E7 atalx1;
+typedef enum E8 Talx1E8 atalx1;
+typedef enum E9 Talx1E9 atalx1;
+typedef void *Talx1ptr atalx1;
+typedef char *Talx1cptr atalx1;
+typedef int *Talx1iptr atalx1;
+typedef short int Talx2short atalx2;
+typedef unsigned short int Talx2ushort atalx2;
+typedef int Talx2int atalx2;
+typedef unsigned int Talx2uint atalx2;
+typedef long int Talx2long atalx2;
+typedef unsigned long int Talx2ulong atalx2;
+typedef long long int Talx2llong atalx2;
+typedef unsigned long long int Talx2ullong atalx2;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex char Talx2cchar atalx2;
+typedef _Complex signed char Talx2cschar atalx2;
+typedef _Complex unsigned char Talx2cuchar atalx2;
+typedef _Complex short int Talx2cshort atalx2;
+typedef _Complex unsigned short int Talx2cushort atalx2;
+typedef _Complex int Talx2cint atalx2;
+typedef _Complex unsigned int Talx2cuint atalx2;
+typedef _Complex long int Talx2clong atalx2;
+typedef _Complex unsigned long int Talx2culong atalx2;
+typedef _Complex long long int Talx2cllong atalx2;
+typedef _Complex unsigned long long int Talx2cullong atalx2;
+#endif
+typedef float Talx2float atalx2;
+typedef double Talx2double atalx2;
+typedef long double Talx2ldouble atalx2;
+typedef _Complex float Talx2cfloat atalx2;
+typedef _Complex double Talx2cdouble atalx2;
+typedef _Complex long double Talx2cldouble atalx2;
+typedef enum E0 Talx2E0 atalx2;
+typedef enum E1 Talx2E1 atalx2;
+typedef enum E2 Talx2E2 atalx2;
+typedef enum E3 Talx2E3 atalx2;
+typedef enum E4 Talx2E4 atalx2;
+typedef enum E5 Talx2E5 atalx2;
+typedef enum E6 Talx2E6 atalx2;
+typedef enum E7 Talx2E7 atalx2;
+typedef enum E8 Talx2E8 atalx2;
+typedef enum E9 Talx2E9 atalx2;
+typedef void *Talx2ptr atalx2;
+typedef char *Talx2cptr atalx2;
+typedef int *Talx2iptr atalx2;
+typedef int Talx4int atalx4;
+typedef unsigned int Talx4uint atalx4;
+typedef long int Talx4long atalx4;
+typedef unsigned long int Talx4ulong atalx4;
+typedef long long int Talx4llong atalx4;
+typedef unsigned long long int Talx4ullong atalx4;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex short int Talx4cshort atalx4;
+typedef _Complex unsigned short int Talx4cushort atalx4;
+typedef _Complex int Talx4cint atalx4;
+typedef _Complex unsigned int Talx4cuint atalx4;
+typedef _Complex long int Talx4clong atalx4;
+typedef _Complex unsigned long int Talx4culong atalx4;
+typedef _Complex long long int Talx4cllong atalx4;
+typedef _Complex unsigned long long int Talx4cullong atalx4;
+#endif
+typedef float Talx4float atalx4;
+typedef double Talx4double atalx4;
+typedef long double Talx4ldouble atalx4;
+typedef _Complex float Talx4cfloat atalx4;
+typedef _Complex double Talx4cdouble atalx4;
+typedef _Complex long double Talx4cldouble atalx4;
+typedef enum E0 Talx4E0 atalx4;
+typedef enum E1 Talx4E1 atalx4;
+typedef enum E2 Talx4E2 atalx4;
+typedef enum E3 Talx4E3 atalx4;
+typedef enum E4 Talx4E4 atalx4;
+typedef enum E5 Talx4E5 atalx4;
+typedef enum E6 Talx4E6 atalx4;
+typedef enum E7 Talx4E7 atalx4;
+typedef enum E8 Talx4E8 atalx4;
+typedef enum E9 Talx4E9 atalx4;
+typedef void *Talx4ptr atalx4;
+typedef char *Talx4cptr atalx4;
+typedef int *Talx4iptr atalx4;
+typedef long int Taly8long ataly8;
+typedef unsigned long int Taly8ulong ataly8;
+typedef long long int Talx8llong atalx8;
+typedef unsigned long long int Talx8ullong atalx8;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex int Talx8cint atalx8;
+typedef _Complex unsigned int Talx8cuint atalx8;
+typedef _Complex long int Talx8clong atalx8;
+typedef _Complex unsigned long int Talx8culong atalx8;
+typedef _Complex long long int Talx8cllong atalx8;
+typedef _Complex unsigned long long int Talx8cullong atalx8;
+#endif
+typedef double Talx8double atalx8;
+typedef long double Talx8ldouble atalx8;
+typedef _Complex float Talx8cfloat atalx8;
+typedef _Complex double Talx8cdouble atalx8;
+typedef _Complex long double Talx8cldouble atalx8;
+typedef void *Taly8ptr ataly8;
+typedef char *Taly8cptr ataly8;
+typedef int *Taly8iptr ataly8;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex long int Taly16clong ataly16;
+typedef _Complex unsigned long int Taly16culong ataly16;
+typedef _Complex long long int Talx16cllong atalx16;
+typedef _Complex unsigned long long int Talx16cullong atalx16;
+#endif
+typedef _Complex double Talx16cdouble atalx16;
+typedef _Complex long double Talx16cldouble atalx16;
 typedef int (*Tfnptr) (void);
 
 /* Bitfield macros.  In C, it is invalid to use numbers larger
--- gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c.jj	2004-11-07 12:36:41.000000000 +0100
+++ gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c	2005-04-11 17:47:45.000000000 +0200
@@ -391,6 +391,92 @@ struct entry
   struct types *type;
   const char *attrib;
 };
+struct types attrib_array_types[] = {
+{ "Talx1char", TYPE_UINT, 127, 'C' },
+{ "Talx1schar", TYPE_INT, 127, 'C' },
+{ "Talx1uchar", TYPE_UINT, 255, 'C' },
+{ "Talx1short", TYPE_INT, 32767, 'S' },
+{ "Talx1ushort", TYPE_UINT, 65535, 'S' },
+{ "Talx1int", TYPE_INT, 2147483647, 'I' },
+{ "Talx1uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Talx1long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Talx1ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx1llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx1ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Talx1bool", TYPE_UINT, 1, 'B' },
+{ "Talx1ptr", TYPE_PTR, 0, 0 },
+{ "Talx1cptr", TYPE_PTR, 0, 0 },
+{ "Talx1iptr", TYPE_PTR, 0, 0 },
+{ "Talx1float", TYPE_FLOAT, 0, 0 },
+{ "Talx1double", TYPE_FLOAT, 0, 0 },
+{ "Talx1ldouble", TYPE_FLOAT, 0, 0 },
+{ "Talx1E0", TYPE_UENUM, 0, ' ' },
+{ "Talx1E1", TYPE_UENUM, 1, ' ' },
+{ "Talx1E2", TYPE_SENUM, 3, ' ' },
+{ "Talx1E3", TYPE_SENUM, 127, ' ' },
+{ "Talx1E4", TYPE_UENUM, 255, ' ' },
+{ "Talx1E5", TYPE_SENUM, 32767, ' ' },
+{ "Talx1E6", TYPE_UENUM, 65535, ' ' },
+{ "Talx1E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Talx1E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Talx1E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Talx2short", TYPE_INT, 32767, 'S' },
+{ "Talx2ushort", TYPE_UINT, 65535, 'S' },
+{ "Talx2int", TYPE_INT, 2147483647, 'I' },
+{ "Talx2uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Talx2long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Talx2ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx2llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx2ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Talx2ptr", TYPE_PTR, 0, 0 },
+{ "Talx2cptr", TYPE_PTR, 0, 0 },
+{ "Talx2iptr", TYPE_PTR, 0, 0 },
+{ "Talx2float", TYPE_FLOAT, 0, 0 },
+{ "Talx2double", TYPE_FLOAT, 0, 0 },
+{ "Talx2ldouble", TYPE_FLOAT, 0, 0 },
+{ "Talx2E0", TYPE_UENUM, 0, ' ' },
+{ "Talx2E1", TYPE_UENUM, 1, ' ' },
+{ "Talx2E2", TYPE_SENUM, 3, ' ' },
+{ "Talx2E3", TYPE_SENUM, 127, ' ' },
+{ "Talx2E4", TYPE_UENUM, 255, ' ' },
+{ "Talx2E5", TYPE_SENUM, 32767, ' ' },
+{ "Talx2E6", TYPE_UENUM, 65535, ' ' },
+{ "Talx2E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Talx2E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Talx2E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Talx4int", TYPE_INT, 2147483647, 'I' },
+{ "Talx4uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Talx4long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Talx4ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx4llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx4ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Talx4ptr", TYPE_PTR, 0, 0 },
+{ "Talx4cptr", TYPE_PTR, 0, 0 },
+{ "Talx4iptr", TYPE_PTR, 0, 0 },
+{ "Talx4float", TYPE_FLOAT, 0, 0 },
+{ "Talx4double", TYPE_FLOAT, 0, 0 },
+{ "Talx4ldouble", TYPE_FLOAT, 0, 0 },
+{ "Talx4E0", TYPE_UENUM, 0, ' ' },
+{ "Talx4E1", TYPE_UENUM, 1, ' ' },
+{ "Talx4E2", TYPE_SENUM, 3, ' ' },
+{ "Talx4E3", TYPE_SENUM, 127, ' ' },
+{ "Talx4E4", TYPE_UENUM, 255, ' ' },
+{ "Talx4E5", TYPE_SENUM, 32767, ' ' },
+{ "Talx4E6", TYPE_UENUM, 65535, ' ' },
+{ "Talx4E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Talx4E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Talx4E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Taly8long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Taly8ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx8llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx8ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Taly8ptr", TYPE_PTR, 0, 0 },
+{ "Taly8cptr", TYPE_PTR, 0, 0 },
+{ "Taly8iptr", TYPE_PTR, 0, 0 },
+{ "Talx8double", TYPE_FLOAT, 0, 0 },
+{ "Talx8ldouble", TYPE_FLOAT, 0, 0 }
+#define NAATYPES2 (sizeof (attrib_array_types) / sizeof (attrib_array_types[0]))
+};
 
 static int idx, limidx, output_one;
 static const char *destdir;
@@ -937,7 +1023,7 @@ singles (enum FEATURE features)
 }
 
 void
-choose_type (enum FEATURE features, struct entry *e, int r)
+choose_type (enum FEATURE features, struct entry *e, int r, int in_array)
 {
   int i;
 
@@ -945,7 +1031,12 @@ choose_type (enum FEATURE features, stru
   if (features & FEATURE_VECTOR)
     i += NVTYPES2;
   if ((r & 3) == 0)
-    i += NATYPES2;
+    {
+      if (in_array)
+	i += NAATYPES2;
+      else
+	i += NATYPES2;
+    }
   r >>= 2;
   r %= i;
   if (r < NTYPES2 - NTYPES1)
@@ -957,12 +1048,18 @@ choose_type (enum FEATURE features, stru
 	e->type = &vector_types[r];
       r -= NVTYPES2;
     }
-  if (e->type == NULL)
+  if (e->type == NULL && !in_array)
     {
       if (r < NATYPES2)
 	e->type = &attrib_types[r];
       r -= NATYPES2;
     }
+  if (e->type == NULL && in_array)
+    {
+      if (r < NAATYPES2)
+	e->type = &attrib_array_types[r];
+      r -= NAATYPES2;
+    }
   if (e->type == NULL)
     abort ();
 }
@@ -1009,7 +1106,7 @@ generate_fields (enum FEATURE features, 
 	  break;
 	case 4:
 	  e[n].etype = ETYPE_TYPE;
-	  choose_type (features, &e[n], r);
+	  choose_type (features, &e[n], r, 0);
 	  break;
 	case 5:
 	  e[n].etype = ETYPE_ARRAY;
@@ -1018,7 +1115,7 @@ generate_fields (enum FEATURE features, 
 	  if (i)
 	    e[n].type = &base_types[r % NTYPES1];
 	  else
-	    choose_type (features, &e[n], r);
+	    choose_type (features, &e[n], r, 1);
 	  r = generate_random ();
 	  if ((features & FEATURE_ZEROARRAY) && (r & 3) == 0)
 	    {
@@ -1192,6 +1289,8 @@ generate_fields (enum FEATURE features, 
 	      && strcmp (e[n].attrib, "atpa") == 0
 	      && ((e[n].type >= &attrib_types[0]
 		   && e[n].type < &attrib_types[NATYPES2])
+		  || (e[n].type >= &attrib_array_types[0]
+		      && e[n].type < &attrib_array_types[NAATYPES2])
 		  || (e[n].type >= &aligned_bitfld_types[0]
 		      && e[n].type < &aligned_bitfld_types[n_aligned_bitfld_types])))
 	    e[n].attrib = NULL;
--- gcc/testsuite/g++.dg/compat/struct-layout-1.h.jj	2004-10-16 09:02:45.000000000 +0200
+++ gcc/testsuite/g++.dg/compat/struct-layout-1.h	2005-04-11 17:48:37.000000000 +0200
@@ -101,6 +101,64 @@ extern int fn5 (void), fn6 (void), fn7 (
 #define atpaal8		__attribute__((packed, aligned (8)))
 #define atpaal16	__attribute__((packed, aligned (16)))
 
+#if UCHAR_MAX == 255 && USHORT_MAX == 65535 && UINT_MAX == 4294967295U \
+    && ULLONG_MAX == 18446744073709551615ULL
+/* For ILP32 and LP64 targets, assume float is at least 32-bit
+   and double plus long double at least 64-bit.  */
+# define atalx1		atal1
+# define atalx2		atal2
+# define atalx4		atal4
+# define atalx8		atal8
+# define atalx16	atal16
+# define atalx1pa	atal1pa
+# define atalx2pa	atal2pa
+# define atalx4pa	atal4pa
+# define atalx8pa	atal8pa
+# define atalx16pa	atal16pa
+# define atpaalx1	atpaal1
+# define atpaalx2	atpaal2
+# define atpaalx4	atpaal4
+# define atpaalx8	atpaal8
+# define atpaalx16	atpaal16
+# if ULONG_MAX > 4294967295UL
+#  define ataly8	atal8
+#  define ataly8pa	atal8pa
+#  define atpaaly8	atpaal8
+#  define ataly16	atal16
+#  define ataly16pa	atal16pa
+#  define atpaaly16	atpaal16
+# else
+#  define ataly8
+#  define ataly8pa
+#  define atpaaly8
+#  define ataly16
+#  define ataly16pa
+#  define atpaaly16
+# endif
+#else
+# define atalx1
+# define atalx2
+# define atalx4
+# define atalx8
+# define atalx16
+# define atalx1pa
+# define atalx2pa
+# define atalx4pa
+# define atalx8pa
+# define atalx16pa
+# define atpaalx1
+# define atpaalx2
+# define atpaalx4
+# define atpaalx8
+# define atpaalx16
+# define ataly8
+# define ataly8pa
+# define atpaaly8
+# define ataly16
+# define ataly16pa
+# define atpaaly16
+#endif
+
 #define atQI		__attribute__((mode (QI)))
 #define atHI		__attribute__((mode (HI)))
 #define atSI		__attribute__((mode (SI)))
@@ -336,6 +394,103 @@ typedef enum E9 Tal16E9 atal16;
 typedef void *Tal16ptr atal16;
 typedef char *Tal16cptr atal16;
 typedef int *Tal16iptr atal16;
+typedef char Talx1char atalx1;
+typedef signed char Talx1schar atalx1;
+typedef unsigned char Talx1uchar atalx1;
+typedef short int Talx1short atalx1;
+typedef unsigned short int Talx1ushort atalx1;
+typedef int Talx1int atalx1;
+typedef unsigned int Talx1uint atalx1;
+typedef long int Talx1long atalx1;
+typedef unsigned long int Talx1ulong atalx1;
+typedef long long int Talx1llong atalx1;
+typedef unsigned long long int Talx1ullong atalx1;
+typedef float Talx1float atalx1;
+typedef double Talx1double atalx1;
+typedef long double Talx1ldouble atalx1;
+typedef _Complex float Talx1cfloat atalx1;
+typedef _Complex double Talx1cdouble atalx1;
+typedef _Complex long double Talx1cldouble atalx1;
+typedef bool Talx1bool atalx1;
+typedef enum E0 Talx1E0 atalx1;
+typedef enum E1 Talx1E1 atalx1;
+typedef enum E2 Talx1E2 atalx1;
+typedef enum E3 Talx1E3 atalx1;
+typedef enum E4 Talx1E4 atalx1;
+typedef enum E5 Talx1E5 atalx1;
+typedef enum E6 Talx1E6 atalx1;
+typedef enum E7 Talx1E7 atalx1;
+typedef enum E8 Talx1E8 atalx1;
+typedef enum E9 Talx1E9 atalx1;
+typedef void *Talx1ptr atalx1;
+typedef char *Talx1cptr atalx1;
+typedef int *Talx1iptr atalx1;
+typedef short int Talx2short atalx2;
+typedef unsigned short int Talx2ushort atalx2;
+typedef int Talx2int atalx2;
+typedef unsigned int Talx2uint atalx2;
+typedef long int Talx2long atalx2;
+typedef unsigned long int Talx2ulong atalx2;
+typedef long long int Talx2llong atalx2;
+typedef unsigned long long int Talx2ullong atalx2;
+typedef float Talx2float atalx2;
+typedef double Talx2double atalx2;
+typedef long double Talx2ldouble atalx2;
+typedef _Complex float Talx2cfloat atalx2;
+typedef _Complex double Talx2cdouble atalx2;
+typedef _Complex long double Talx2cldouble atalx2;
+typedef enum E0 Talx2E0 atalx2;
+typedef enum E1 Talx2E1 atalx2;
+typedef enum E2 Talx2E2 atalx2;
+typedef enum E3 Talx2E3 atalx2;
+typedef enum E4 Talx2E4 atalx2;
+typedef enum E5 Talx2E5 atalx2;
+typedef enum E6 Talx2E6 atalx2;
+typedef enum E7 Talx2E7 atalx2;
+typedef enum E8 Talx2E8 atalx2;
+typedef enum E9 Talx2E9 atalx2;
+typedef void *Talx2ptr atalx2;
+typedef char *Talx2cptr atalx2;
+typedef int *Talx2iptr atalx2;
+typedef int Talx4int atalx4;
+typedef unsigned int Talx4uint atalx4;
+typedef long int Talx4long atalx4;
+typedef unsigned long int Talx4ulong atalx4;
+typedef long long int Talx4llong atalx4;
+typedef unsigned long long int Talx4ullong atalx4;
+typedef float Talx4float atalx4;
+typedef double Talx4double atalx4;
+typedef long double Talx4ldouble atalx4;
+typedef _Complex float Talx4cfloat atalx4;
+typedef _Complex double Talx4cdouble atalx4;
+typedef _Complex long double Talx4cldouble atalx4;
+typedef enum E0 Talx4E0 atalx4;
+typedef enum E1 Talx4E1 atalx4;
+typedef enum E2 Talx4E2 atalx4;
+typedef enum E3 Talx4E3 atalx4;
+typedef enum E4 Talx4E4 atalx4;
+typedef enum E5 Talx4E5 atalx4;
+typedef enum E6 Talx4E6 atalx4;
+typedef enum E7 Talx4E7 atalx4;
+typedef enum E8 Talx4E8 atalx4;
+typedef enum E9 Talx4E9 atalx4;
+typedef void *Talx4ptr atalx4;
+typedef char *Talx4cptr atalx4;
+typedef int *Talx4iptr atalx4;
+typedef long int Taly8long ataly8;
+typedef unsigned long int Taly8ulong ataly8;
+typedef long long int Talx8llong atalx8;
+typedef unsigned long long int Talx8ullong atalx8;
+typedef double Talx8double atalx8;
+typedef long double Talx8ldouble atalx8;
+typedef _Complex float Talx8cfloat atalx8;
+typedef _Complex double Talx8cdouble atalx8;
+typedef _Complex long double Talx8cldouble atalx8;
+typedef void *Taly8ptr ataly8;
+typedef char *Taly8cptr ataly8;
+typedef int *Taly8iptr ataly8;
+typedef _Complex double Talx16cdouble atalx16;
+typedef _Complex long double Talx16cldouble atalx16;
 typedef int (*Tfnptr) (void);
 
 #define T(n, fields, ops) TX(n, struct, , fields, ({ ops });)


Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/.cvsignore,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -r1.82 -r1.83
--- .cvsignore	6 Apr 2005 08:12:18 -0000	1.82
+++ .cvsignore	12 Apr 2005 23:02:26 -0000	1.83
@@ -1 +1 @@
-gcc-4.0.0-20050406.tar.bz2
+gcc-4.0.0-20050412.tar.bz2

gcc4-pr20126.patch:
 loop.c                     |   17 ++++++++++++---
 testsuite/gcc.dg/pr20126.c |   50 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+), 3 deletions(-)

Index: gcc4-pr20126.patch
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/gcc4-pr20126.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- gcc4-pr20126.patch	11 Mar 2005 14:06:49 -0000	1.2
+++ gcc4-pr20126.patch	12 Apr 2005 23:02:26 -0000	1.3
@@ -1,4 +1,5 @@
-2005-03-10  Alexandre Oliva  <aoliva at redhat.com>
+2005-04-12  Alexandre Oliva  <aoliva at redhat.com>
+	    Roger Sayle  <roger at eyesopen.com>
 
 	PR target/20126
 	* loop.c (loop_givs_rescan): If replacement of DEST_ADDR failed,
@@ -10,9 +11,9 @@
 
 	* gcc.dg/pr20126.c: New.
 
---- gcc/loop.c 17 Jan 2005 08:46:15 -0000 1.522
-+++ gcc/loop.c 10 Mar 2005 11:23:59 -0000
-@@ -5470,9 +5470,31 @@ loop_givs_rescan (struct loop *loop, str
+--- gcc/loop.c.jj	2005-04-03 10:33:24.000000000 +0200
++++ gcc/loop.c	2005-04-12 23:22:06.000000000 +0200
+@@ -5478,9 +5478,20 @@ loop_givs_rescan (struct loop *loop, str
  	mark_reg_pointer (v->new_reg, 0);
  
        if (v->giv_type == DEST_ADDR)
@@ -22,77 +23,20 @@
 +	{
 +	  /* Store reduced reg as the address in the memref where we found
 +	     this giv.  */
-+	  if (validate_change_maybe_volatile (v->insn, v->location,
-+					      v->new_reg))
-+	    /* Yay, it worked!  */;
-+	  /* Not replaceable; emit an insn to set the original
-+	     giv reg from the reduced giv.  */
-+	  else if (REG_P (*v->location))
-+	    loop_insn_emit_before (loop, 0, v->insn,
-+				   gen_move_insn (*v->location,
-+						  v->new_reg));
-+	  else
++	  if (!validate_change (v->insn, v->location, v->new_reg, 0))
 +	    {
-+	      /* If it wasn't a reg, create a pseudo and use that.  */
-+	      rtx reg, seq;
-+	      start_sequence ();
-+	      reg = force_reg (v->mode, *v->location);
-+	      seq = get_insns ();
-+	      end_sequence ();
-+	      loop_insn_emit_before (loop, 0, v->insn, seq);
-+	      gcc_assert (validate_change_maybe_volatile (v->insn, v->location,
-+							  reg));
++	      if (loop_dump_stream)
++		fprintf (loop_dump_stream,
++			 "unable to reduce iv to register in insn %d\n",
++			 INSN_UID (v->insn));
++	      bl->all_reduced = 0;
++	      v->ignore = 1;
++	      continue;
 +	    }
 +	}
        else if (v->replaceable)
  	{
  	  reg_map[REGNO (v->dest_reg)] = v->new_reg;
---- gcc/recog.c 7 Mar 2005 13:52:08 -0000 1.221
-+++ gcc/recog.c 10 Mar 2005 11:24:01 -0000
-@@ -235,6 +235,33 @@ validate_change (rtx object, rtx *loc, r
-     return apply_change_group ();
- }
- 
-+/* Same as validate_change, but doesn't support groups, and it accepts
-+   volatile mems if they're already present in the original insn.
-+
-+   ??? Should this search for new volatile MEMs and reject them?  */
-+
-+int
-+validate_change_maybe_volatile (rtx object, rtx *loc, rtx new)
-+{
-+  int result;
-+
-+  if (validate_change (object, loc, new, 0))
-+    return 1;
-+
-+  if (volatile_ok || ! insn_invalid_p (object))
-+    return 0;
-+
-+  volatile_ok = 1;
-+
-+  gcc_assert (! insn_invalid_p (object));
-+
-+  result = validate_change (object, loc, new, 0);
-+
-+  volatile_ok = 0;
-+
-+  return result;
-+}
-+
- /* This subroutine of apply_change_group verifies whether the changes to INSN
-    were valid; i.e. whether INSN can still be recognized.  */
- 
---- gcc/recog.h 7 Mar 2005 13:52:09 -0000 1.55
-+++ gcc/recog.h 10 Mar 2005 11:24:01 -0000
-@@ -74,6 +74,7 @@ extern void init_recog_no_volatile (void
- extern int check_asm_operands (rtx);
- extern int asm_operand_ok (rtx, const char *);
- extern int validate_change (rtx, rtx *, rtx, int);
-+extern int validate_change_maybe_volatile (rtx, rtx *, rtx);
- extern int insn_invalid_p (rtx);
- extern void confirm_change_group (void);
- extern int apply_change_group (void);
 --- gcc/testsuite/gcc.dg/pr20126.c	1 Jan 1970 00:00:00 -0000
 +++ gcc/testsuite/gcc.dg/pr20126.c 10 Mar 2005 11:24:16 -0000
 @@ -0,0 +1,50 @@
@@ -133,7 +77,7 @@
 +    {
 +      const char *t = e + 1;
 +      if (__builtin_memcmp (e, f, h) == 0)
-+        return 1;
++	return 1;
 +      e = t;
 +    }
 +  return 0;


Index: gcc4.spec
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/gcc4.spec,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- gcc4.spec	6 Apr 2005 08:12:18 -0000	1.26
+++ gcc4.spec	12 Apr 2005 23:02:26 -0000	1.27
@@ -1,6 +1,6 @@
-%define DATE 20050406
+%define DATE 20050412
 %define gcc_version 4.0.0
-%define gcc_release 0.41
+%define gcc_release 0.42
 %define _unpackaged_files_terminate_build 0
 %define multilib_64_archs sparc64 ppc64 s390x x86_64
 %ifarch %{ix86} alpha ia64 x86_64 s390
@@ -80,6 +80,16 @@
 Patch8: gcc4-pr20249.patch
 Patch9: gcc4-g++-struct-layout.patch
 Patch10: gcc4-pr16104-test.patch
+Patch11: gcc4-gfortran-pr13082.patch
+Patch12: gcc4-gfortran-pr18824.patch
+Patch13: gcc4-gfortran-pr13082-mixed.patch
+Patch14: gcc4-gfortran-entry-character.patch
+Patch15: gcc4-libgfortran-pr20163.patch
+Patch16: gcc4-pr20490.patch
+Patch17: gcc4-pr20739.patch
+Patch18: gcc4-s390-pr20917.patch
+Patch19: gcc4-struct-layout.patch
+Patch20: gcc4-ppc32-hwint32.patch
 
 %define _gnu %{nil}
 %ifarch sparc
@@ -399,6 +409,16 @@
 %patch8 -p0 -b .pr20249~
 %patch9 -p0 -b .g++-struct-layout~
 %patch10 -p0 -b .pr16104-test~
+%patch11 -p0 -b .gfortran-pr13082~
+%patch12 -p0 -b .gfortran-pr18824~
+%patch13 -p0 -b .gfortran-pr13082-mixed~
+%patch14 -p0 -b .gfortran-entry-character~
+%patch15 -p0 -b .libgfortran-pr20163~
+%patch16 -p0 -b .pr20490~
+%patch17 -p0 -b .pr20739~
+%patch18 -p0 -b .s390-pr20917~
+%patch19 -p0 -b .struct-layout~
+%patch20 -p0 -b .ppc32-hwint32~
 
 perl -pi -e 's/4\.0\.0/4.0.0/' gcc/version.c
 perl -pi -e 's/"%{gcc_version}"/"%{gcc_version} \(release\)"/' gcc/version.c
@@ -468,6 +488,7 @@
 	--disable-libgcj \
 %else
 	--enable-java-awt=gtk \
+	--with-java-home=%{_prefix}/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre \
 %endif
 %ifarch sparc
 	--host=%{gcc_target_platform} --build=%{gcc_target_platform} --target=%{gcc_target_platform} --with-cpu=v7
@@ -867,6 +888,15 @@
 rm -f $FULLEPATH/install-tools/{mkheaders,fixincl}
 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/{32,64}/libiberty.a
 
+%if %{build_java}
+mkdir -p $RPM_BUILD_ROOT%{_prefix}/share/java/gcj-endorsed \
+	 $RPM_BUILD_ROOT%{_prefix}/%{_lib}/gcj-%{version}/classmap.db.d
+chmod 755 $RPM_BUILD_ROOT%{_prefix}/share/java/gcj-endorsed \
+	  $RPM_BUILD_ROOT%{_prefix}/%{_lib}/gcj-%{version} \
+	  $RPM_BUILD_ROOT%{_prefix}/%{_lib}/gcj-%{version}/classmap.db.d
+touch $RPM_BUILD_ROOT%{_prefix}/%{_lib}/gcj-%{version}/classmap.db
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -1200,12 +1230,10 @@
 %{_prefix}/bin/gcjh
 %{_prefix}/bin/jcf-dump
 %{_prefix}/bin/jv-scan
-%{_prefix}/bin/gcj-dbtool
 %{_mandir}/man1/gcj.1*
 %{_mandir}/man1/gcjh.1*
 %{_mandir}/man1/jcf-dump.1*
 %{_mandir}/man1/jv-scan.1*
-%{_mandir}/man1/gcj-dbtool.1*
 %{_infodir}/gcj*
 %dir %{_prefix}/libexec/gcc
 %dir %{_prefix}/libexec/gcc/%{gcc_target_platform}
@@ -1222,12 +1250,14 @@
 %{_prefix}/bin/grepjar
 %{_prefix}/bin/grmic
 %{_prefix}/bin/grmiregistry
+%{_prefix}/bin/gcj-dbtool
 %{_mandir}/man1/fastjar.1*
 %{_mandir}/man1/grepjar.1*
 %{_mandir}/man1/jv-convert.1*
 %{_mandir}/man1/gij.1*
 %{_mandir}/man1/grmic.1*
 %{_mandir}/man1/grmiregistry.1*
+%{_mandir}/man1/gcj-dbtool.1*
 %{_infodir}/fastjar*
 %{_prefix}/%{_lib}/libgcj.so.*
 %{_prefix}/%{_lib}/lib-gnu-java-awt-peer-gtk.so.*
@@ -1237,6 +1267,9 @@
 %{_prefix}/share/java/[^s]*
 %{_prefix}/lib/security
 %{_prefix}/lib/logging.properties
+%dir %{_prefix}/%{_lib}/gcj-%{version}
+%dir %{_prefix}/%{_lib}/gcj-%{version}/classmap.db.d
+%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) %{_prefix}/%{_lib}/gcj-%{version}/classmap.db
 
 %files -n libgcj-devel
 %defattr(-,root,root)
@@ -1378,6 +1411,28 @@
 %endif
 
 %changelog
+* Wed Apr 13 2005 Jakub Jelinek  <jakub at redhat.com> 4.0.0-0.42
+- update from CVS
+  - PRs ada/18659, ada/18819, c++/20145, c++/20212, c++/20905, fortran/15959,
+	fortran/17229, fortran/20713, libfortran/20766, libstdc++/20806,
+	libstdc++/20909, middle-end/20648, target/17245, target/20093,
+	target/20795
+- changed struct-layout-1 testsuites to avoid types where
+  sizeof (type) < __alignof__ (type) in arrays
+- add support for Fortran ENTRY in FUNCTIONS and SUBROUTINES with alternate
+  returns (PRs fortran/13082, fortran/18824, #153715)
+- fix PR libfortran/20163 (Thomas Koenig)
+- fix PR tree-optimization/20490 (Daniel Berlin)
+- fix PR middle-end/20739 (Alexandre Oliva)
+- fix PR middle-end/20917 (Ulrich Weigand)
+- configure with
+  --with-java-home=%{_prefix}/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
+- include empty %{_prefix}/share/java/gcj-endorsed and
+  %{_prefix}/%{_lib}/gcj-%{version}/classmap.db.d directories and
+  %%ghost %{_prefix}/%{_lib}/gcj-%{version}/classmap.db
+- move gcj-dbtool program from gcc-java to libgcj subpackage
+- build gcc-ppc32 and gcc-c++-ppc32 with 32-bit HOST_WIDE_INT
+
 * Wed Apr  6 2005 Jakub Jelinek  <jakub at redhat.com> 4.0.0-0.41
 - update from CVS
   - PRs c++/19312, c++/20734, libgcj/20750, middle-end/19225, target/20342,


Index: sources
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/sources,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- sources	6 Apr 2005 08:12:18 -0000	1.83
+++ sources	12 Apr 2005 23:02:26 -0000	1.84
@@ -1 +1 @@
-6b205368b124568380925d4c22a8cb01  gcc-4.0.0-20050406.tar.bz2
+5fa018fafb0366db98c5a87f042a0d5a  gcc-4.0.0-20050412.tar.bz2




More information about the fedora-cvs-commits mailing list