rpms/gcc/devel gcc4-bz154684.patch, NONE, 1.1 gcc4-bz157308.patch, NONE, 1.1 gcc4-pr19005-test.patch, NONE, 1.1 gcc4-pr21610.patch, NONE, 1.1 .cvsignore, 1.89, 1.90 gcc4-fortran-pr15080.patch, 1.2, 1.3 gcc4.spec, 1.38, 1.39 sources, 1.91, 1.92 gcc4-fold-indirect-ref.patch, 1.1, NONE gcc4-htab-expand.patch, 1.1, NONE gcc4-spec23-test.patch, 1.1, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon May 16 23:06:35 UTC 2005


Author: jakub

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

Modified Files:
	.cvsignore gcc4-fortran-pr15080.patch gcc4.spec sources 
Added Files:
	gcc4-bz154684.patch gcc4-bz157308.patch 
	gcc4-pr19005-test.patch gcc4-pr21610.patch 
Removed Files:
	gcc4-fold-indirect-ref.patch gcc4-htab-expand.patch 
	gcc4-spec23-test.patch 
Log Message:
4.0.0-6


gcc4-bz154684.patch:
 gcconfig.h |    1 +
 1 files changed, 1 insertion(+)

--- NEW FILE gcc4-bz154684.patch ---
2005-05-13  Andrew Haley  <aph at redhat.com>

	* include/private/gcconfig.h (HBLKSIZE): Define to 4096 on
	powerpc64-linux.

--- boehm-gc/include/private/gcconfig.h	2005-05-06 12:44:28.000000000 +0200
+++ boehm-gc/include/private/gcconfig.h	2005-05-13 16:09:28.000000000 +0200
@@ -722,6 +722,7 @@
 #     if (defined (powerpc64) || defined(__powerpc64__))
 #       define ALIGNMENT 8
 #       define CPP_WORDSZ 64
+#       define HBLKSIZE 4096
 #     else
 #       define ALIGNMENT 4
 #     endif

gcc4-bz157308.patch:
 varasm.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

--- NEW FILE gcc4-bz157308.patch ---
2005-05-16  Jakub Jelinek  <jakub at redhat.com>

	* varasm.c (struct constant_descriptor_tree): Add hash field.
	(const_desc_hash): Just return hash field.
	(const_desc_eq): If hash values are different, return 0 immediately.
	(output_constant_def): Compute hash field of temporary key, use
	htab_find_slot_with_hash instead of htab_find_slot.  Set hash in
	newly built constant descriptor.
	(lookup_constant_def): Compute hash field of temporary key, use
	htab_find_with_hash instead of htab_find.

--- gcc/varasm.c.jj	2005-05-16 09:44:33.000000000 +0200
+++ gcc/varasm.c	2005-05-16 15:38:36.000000000 +0200
@@ -2366,6 +2366,11 @@ struct constant_descriptor_tree GTY(())
 
   /* The value of the constant.  */
   tree value;
+
+  /* Hash of value.  Computing the hash from value each time
+     hashfn is called can't work properly, as that means recursive
+     use of the hash table during hash table expansion.  */
+  hashval_t hash;
 };
 
 static GTY((param_is (struct constant_descriptor_tree)))
@@ -2379,7 +2384,7 @@ static void maybe_output_constant_def_co
 static hashval_t
 const_desc_hash (const void *ptr)
 {
-  return const_hash_1 (((struct constant_descriptor_tree *)ptr)->value);
+  return ((struct constant_descriptor_tree *)ptr)->hash;
 }
 
 static hashval_t
@@ -2479,8 +2484,11 @@ const_hash_1 (const tree exp)
 static int
 const_desc_eq (const void *p1, const void *p2)
 {
-  return compare_constant (((struct constant_descriptor_tree *)p1)->value,
-			   ((struct constant_descriptor_tree *)p2)->value);
+  const struct constant_descriptor_tree *c1 = p1;
+  const struct constant_descriptor_tree *c2 = p2;
+  if (c1->hash != c2->hash)
+    return 0;
+  return compare_constant (c1->value, c2->value);
 }
 
 /* Compare t1 and t2, and return 1 only if they are known to result in
@@ -2750,12 +2758,14 @@ output_constant_def (tree exp, int defer
   /* Look up EXP in the table of constant descriptors.  If we didn't find
      it, create a new one.  */
   key.value = exp;
-  loc = htab_find_slot (const_desc_htab, &key, INSERT);
+  key.hash = const_hash_1 (exp);
+  loc = htab_find_slot_with_hash (const_desc_htab, &key, key.hash, INSERT);
 
   desc = *loc;
   if (desc == 0)
     {
       desc = build_constant_desc (exp);
+      desc->hash = key.hash;
       *loc = desc;
     }
 
@@ -2858,7 +2868,8 @@ lookup_constant_def (tree exp)
   struct constant_descriptor_tree key;
 
   key.value = exp;
-  desc = htab_find (const_desc_htab, &key);
+  key.hash = const_hash_1 (exp);
+  desc = htab_find_with_hash (const_desc_htab, &key, key.hash);
 
   return (desc ? desc->rtl : NULL_RTX);
 }

gcc4-pr19005-test.patch:
 pr19005.c |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+)

--- NEW FILE gcc4-pr19005-test.patch ---
2005-05-13  Jakub Jelinek  <jakub at redhat.com>

	PR target/19005
	* gcc.c-torture/execute/pr19005.c: New test.

--- gcc/testsuite/gcc.c-torture/execute/pr19005.c.jj	2005-04-07 15:51:53.775361896 +0200
+++ gcc/testsuite/gcc.c-torture/execute/pr19005.c	2005-05-13 13:33:21.000000000 +0200
@@ -0,0 +1,38 @@
+/* PR target/19005 */
+extern void abort (void);
+
+int v, s;
+
+void
+bar (int a, int b)
+{
+  unsigned char x = v;
+
+  if (!s)
+    {
+      if (a != x || b != (unsigned char) (x + 1))
+        abort ();
+    }
+  else if (a != (unsigned char) (x + 1) || b != x)
+    abort ();
+  s ^= 1;
+}
+
+int
+foo (int x)
+{
+  unsigned char a = x, b = x + 1;
+
+  bar (a, b);
+  a ^= b; b ^= a; a ^= b;
+  bar (a, b);
+  return 0;
+}
+
+int
+main (void)
+{
+  for (v = -10; v < 266; v++)
+    foo (v);
+  return 0;
+}

gcc4-pr21610.patch:
 c-typeck.c                                   |   12 ++++++++++--
 testsuite/gcc.c-torture/compile/20050516-1.c |   12 ++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

--- NEW FILE gcc4-pr21610.patch ---
2005-05-16  Jakub Jelinek  <jakub at redhat.com>

	PR tree-optimization/21610
	* c-typeck.c (decl_constant_value_for_broken_optimization): If not
	returning DECL, call unshare_expr.

--- gcc/c-typeck.c.jj	2005-05-16 09:44:21.000000000 +0200
+++ gcc/c-typeck.c	2005-05-16 20:48:12.000000000 +0200
@@ -1249,10 +1249,18 @@ decl_constant_value (tree decl)
 static tree
 decl_constant_value_for_broken_optimization (tree decl)
 {
+  tree ret;
+
   if (pedantic || DECL_MODE (decl) == BLKmode)
     return decl;
-  else
-    return decl_constant_value (decl);
+
+  ret = decl_constant_value (decl);
+  /* Avoid unwanted tree sharing between the initializer and current
+     function's body where the tree can be modified e.g. by the
+     gimplifier.  */
+  if (ret != decl && TREE_STATIC (decl))
+    ret = unshare_expr (ret);
+  return ret;
 }
 
 
--- gcc/testsuite/gcc.c-torture/compile/20050516-1.c.jj	2005-05-16 20:51:37.000000000 +0200
+++ gcc/testsuite/gcc.c-torture/compile/20050516-1.c	2005-05-16 20:51:02.000000000 +0200
@@ -0,0 +1,12 @@
+/* PR tree-optimization/21610 */
+
+struct S { char s; };
+struct T { struct S t; };
+
+struct S *const p = &((struct T * const) (0x4000))->t;
+
+void
+foo (void)
+{
+  p->s = 0;
+}


Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/.cvsignore,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- .cvsignore	12 May 2005 13:26:05 -0000	1.89
+++ .cvsignore	16 May 2005 23:06:32 -0000	1.90
@@ -1 +1 @@
-gcc-4.0.0-20050512.tar.bz2
+gcc-4.0.0-20050516.tar.bz2

gcc4-fortran-pr15080.patch:
 fortran/trans-stmt.c                                    |  262 ++++++++++------
 testsuite/gfortran.fortran-torture/execute/forall_3.f90 |    3 
 testsuite/gfortran.fortran-torture/execute/where_7.f90  |   53 +++
 testsuite/gfortran.fortran-torture/execute/where_8.f90  |   28 +
 4 files changed, 248 insertions(+), 98 deletions(-)

Index: gcc4-fortran-pr15080.patch
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/gcc4-fortran-pr15080.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- gcc4-fortran-pr15080.patch	5 May 2005 21:10:21 -0000	1.2
+++ gcc4-fortran-pr15080.patch	16 May 2005 23:06:33 -0000	1.3
@@ -1,4 +1,4 @@
-2005-05-04  Jakub Jelinek  <jakub at redhat.com>
+2005-05-16  Jakub Jelinek  <jakub at redhat.com>
 
 	PR fortran/15080
 	* trans-stmt.c (generate_loop_for_temp_to_lhs): Remove SIZE and COUNT2
@@ -8,17 +8,31 @@
 	(generate_loop_for_rhs_to_temp): Likewise.
 	(compute_overall_iter_number): Add INNER_SIZE_BODY argument.
 	It non-NULL, add it to body.
+	(allocate_temp_for_forall_nest_1): New function, split from
+	allocate_temp_for_forall_nest.
 	(allocate_temp_for_forall_nest): Add INNER_SIZE_BODY argument,
-	propagate it down to compute_overall_iter_number.
+	propagate it down to compute_overall_iter_number.  Use
+	allocate_temp_for_forall_nest_1.
 	(gfc_trans_assign_need_temp): Remove COUNT2.  Call
 	compute_inner_temp_size into a new stmtblock_t.  Adjust calls to
 	allocate_temp_for_forall_nest, generate_loop_for_rhs_to_temp
 	and generate_loop_for_temp_to_lhs.
-	(gfc_trans_pointer_assign_need_temp, gfc_evaluate_where_mask):
-	Adjust calls to allocate_temp_for_forall_nest.
+	(gfc_trans_pointer_assign_need_temp): Adjust calls to
+	allocate_temp_for_forall_nest.
+	(gfc_evaluate_where_mask): Call compute_inner_temp_size into a new
+	stmtblock_t.  Call compute_overall_iter_number just once, then
+	allocate_temp_for_forall_nest_1 twice with the same size.
+	Initialize mask indexes if nested_forall_info != NULL.
+	(gfc_trans_where_2): Initialize mask indexes before calling
+	gfc_trans_nested_forall_loop.
 
---- gcc/fortran/trans-stmt.c.jj	2005-05-04 01:14:09.000000000 +0200
-+++ gcc/fortran/trans-stmt.c	2005-05-04 01:21:58.000000000 +0200
+	* gfortran.fortran-torture/execute/forall_3.f90: Remove comment
+	about the test failing.
+	* gfortran.fortran-torture/execute/where_7.f90: New test.
+	* gfortran.fortran-torture/execute/where_8.f90: New test.
+
+--- gcc/fortran/trans-stmt.c.jj	2005-05-16 23:33:20.000000000 +0200
++++ gcc/fortran/trans-stmt.c	2005-05-17 00:38:02.000000000 +0200
 @@ -1518,15 +1518,14 @@ gfc_do_allocate (tree bytesize, tree siz
  /* Generate codes to copy the temporary to the actual lhs.  */
  
@@ -58,7 +72,7 @@
  
        /* Start the scalarized loop body.  */
        gfc_start_scalarized_body (&loop1, &body);
-@@ -1583,11 +1582,7 @@ generate_loop_for_temp_to_lhs (gfc_expr 
+@@ -1583,46 +1582,42 @@ generate_loop_for_temp_to_lhs (gfc_expr 
  
        /* Form the expression of the temporary.  */
        if (lss != gfc_ss_terminator)
@@ -71,7 +85,37 @@
        /* Translate expr.  */
        gfc_conv_expr (&lse, expr);
  
-@@ -1611,10 +1606,10 @@ generate_loop_for_temp_to_lhs (gfc_expr 
+       /* Use the scalar assignment.  */
+       tmp = gfc_trans_scalar_assign (&lse, &rse, expr->ts.type);
+ 
+-     /* Form the mask expression according to the mask tree list.  */
+-     if (wheremask)
+-       {
+-	 wheremaskexpr = gfc_build_array_ref (wheremask, count3);
+-         tmp2 = TREE_CHAIN (wheremask);
+-         while (tmp2)
+-           {
+-             tmp1 = gfc_build_array_ref (tmp2, count3);
+-             wheremaskexpr = build2 (TRUTH_AND_EXPR, TREE_TYPE (tmp1),
+-				     wheremaskexpr, tmp1);
+-             tmp2 = TREE_CHAIN (tmp2);
+-           }
+-         tmp = build3_v (COND_EXPR, wheremaskexpr, tmp, build_empty_stmt ());
+-       }
++      /* Form the mask expression according to the mask tree list.  */
++      if (wheremask)
++        {
++	  wheremaskexpr = gfc_build_array_ref (wheremask, count3);
++	  tmp2 = TREE_CHAIN (wheremask);
++	  while (tmp2)
++	    {
++	      tmp1 = gfc_build_array_ref (tmp2, count3);
++	      wheremaskexpr = build2 (TRUTH_AND_EXPR, TREE_TYPE (tmp1),
++				      wheremaskexpr, tmp1);
++	      tmp2 = TREE_CHAIN (tmp2);
++	    }
++	  tmp = build3_v (COND_EXPR, wheremaskexpr, tmp, build_empty_stmt ());
++        }
  
        gfc_add_expr_to_block (&body, tmp);
  
@@ -85,6 +129,18 @@
  
        /* Increment count3.  */
        if (count3)
+-        {
+-          tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type,
++	{
++	  tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type,
+ 			      count3, gfc_index_one_node));
+-          gfc_add_modify_expr (&body, count3, tmp);
+-        }
++	  gfc_add_modify_expr (&body, count3, tmp);
++	}
+ 
+       /* Generate the copying loops.  */
+       gfc_trans_scalarizing_loops (&loop1, &body);
 @@ -1630,9 +1625,6 @@ generate_loop_for_temp_to_lhs (gfc_expr 
        gfc_add_block_to_block (&block, &loop1.post);
        gfc_cleanup_loop (&loop1);
@@ -153,7 +209,7 @@
        tmp = build3_v (COND_EXPR, wheremaskexpr, tmp, build_empty_stmt ());
      }
  
-@@ -1718,13 +1706,18 @@ generate_loop_for_rhs_to_temp (gfc_expr 
+@@ -1718,21 +1706,26 @@ generate_loop_for_rhs_to_temp (gfc_expr 
    if (lss == gfc_ss_terminator)
      {
        gfc_add_block_to_block (&block, &body1);
@@ -175,6 +231,18 @@
  
        /* Increment count3.  */
        if (count3)
+-        {
+-          tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type,
++	{
++	  tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type,
+ 			      count3, gfc_index_one_node));
+-          gfc_add_modify_expr (&body1, count3, tmp);
+-        }
++	  gfc_add_modify_expr (&body1, count3, tmp);
++	}
+ 
+       /* Generate the copying loops.  */
+       gfc_trans_scalarizing_loops (&loop, &body1);
 @@ -1742,11 +1735,8 @@ generate_loop_for_rhs_to_temp (gfc_expr 
  
        gfc_cleanup_loop (&loop);
@@ -206,28 +274,93 @@
    if (nested_forall_info)
      tmp = build2 (PLUS_EXPR, gfc_array_index_type, number,
  		  inner_size);
-@@ -1858,8 +1850,8 @@ compute_overall_iter_number (forall_info
+@@ -1852,22 +1844,17 @@ compute_overall_iter_number (forall_info
+ }
+ 
+ 
+-/* Allocate temporary for forall construct according to the information in
+-   nested_forall_info.  INNER_SIZE is the size of temporary needed in the
+-   assignment inside forall.  PTEMP1 is returned for space free.  */
++/* Allocate temporary for forall construct.  SIZE is the size of temporary
++   needed.  PTEMP1 is returned for space free.  */
  
  static tree
- allocate_temp_for_forall_nest (forall_info * nested_forall_info, tree type,
+-allocate_temp_for_forall_nest (forall_info * nested_forall_info, tree type,
 -                               tree inner_size, stmtblock_t * block,
 -                               tree * ptemp1)
-+			       tree inner_size, stmtblock_t * inner_size_body,
-+			       stmtblock_t * block, tree * ptemp1)
++allocate_temp_for_forall_nest_1 (tree type, tree size, stmtblock_t * block,
++				 tree * ptemp1)
  {
    tree unit;
    tree temp1;
-@@ -1867,7 +1859,8 @@ allocate_temp_for_forall_nest (forall_in
-   tree bytesize, size;
- 
-   /* Calculate the total size of temporary needed in forall construct.  */
+   tree tmp;
+-  tree bytesize, size;
+-
+-  /* Calculate the total size of temporary needed in forall construct.  */
 -  size = compute_overall_iter_number (nested_forall_info, inner_size, block);
-+  size = compute_overall_iter_number (nested_forall_info, inner_size,
-+				      inner_size_body, block);
++  tree bytesize;
  
    unit = TYPE_SIZE_UNIT (type);
    bytesize = fold (build2 (MULT_EXPR, gfc_array_index_type, size, unit));
-@@ -1893,17 +1886,16 @@ gfc_trans_assign_need_temp (gfc_expr * e
+@@ -1884,7 +1871,56 @@ allocate_temp_for_forall_nest (forall_in
+ }
+ 
+ 
+-/* Handle assignments inside forall which need temporary.  */
++/* Allocate temporary for forall construct according to the information in
++   nested_forall_info.  INNER_SIZE is the size of temporary needed in the
++   assignment inside forall.  PTEMP1 is returned for space free.  */
++
++static tree
++allocate_temp_for_forall_nest (forall_info * nested_forall_info, tree type,
++			       tree inner_size, stmtblock_t * inner_size_body,
++			       stmtblock_t * block, tree * ptemp1)
++{
++  tree size;
++
++  /* Calculate the total size of temporary needed in forall construct.  */
++  size = compute_overall_iter_number (nested_forall_info, inner_size,
++				      inner_size_body, block);
++
++  return allocate_temp_for_forall_nest_1 (type, size, block, ptemp1);
++}
++
++
++/* Handle assignments inside forall which need temporary.
++
++    forall (i=start:end:stride; maskexpr)
++      e<i> = f<i>
++    end forall
++   (where e,f<i> are arbitrary expressions possibly involving i
++    and there is a dependency between e<i> and f<i>)
++   Translates to:
++    masktmp(:) = maskexpr(:)
++
++    maskindex = 0;
++    count1 = 0;
++    num = 0;
++    for (i = start; i <= end; i += stride)
++      num += SIZE (f<i>)
++    count1 = 0;
++    ALLOCATE (tmp(num))
++    for (i = start; i <= end; i += stride)
++      {
++	if (masktmp[maskindex++])
++	  tmp[count1++] = f<i>
++      }
++    maskindex = 0;
++    count1 = 0;
++    for (i = start; i <= end; i += stride)
++      {
++	if (masktmp[maskindex++])
++	  e<i> = tmp[count1++]
++      }
++    DEALLOCATE (tmp)
++  */
+ static void
+ gfc_trans_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, tree wheremask,
+                             forall_info * nested_forall_info,
+@@ -1893,17 +1929,16 @@ gfc_trans_assign_need_temp (gfc_expr * e
    tree type;
    tree inner_size;
    gfc_ss *lss, *rss;
@@ -249,7 +382,7 @@
  
    /* Count is the wheremask index.  */
    if (wheremask)
-@@ -1919,15 +1911,17 @@ gfc_trans_assign_need_temp (gfc_expr * e
+@@ -1919,15 +1954,17 @@ gfc_trans_assign_need_temp (gfc_expr * e
  
    /* Calculate the size of temporary needed in the assignment. Return loop, lss
       and rss which are used in function generate_loop_for_rhs_to_temp().  */
@@ -270,7 +403,7 @@
  
    /* Initialize the maskindexes.  */
    forall_tmp = nested_forall_info;
-@@ -1941,8 +1935,8 @@ gfc_trans_assign_need_temp (gfc_expr * e
+@@ -1941,8 +1978,8 @@ gfc_trans_assign_need_temp (gfc_expr * e
      }
  
    /* Generate codes to copy rhs to the temporary .  */
@@ -281,7 +414,7 @@
  
    /* Generate body and loops according to the information in
       nested_forall_info.  */
-@@ -1968,8 +1962,7 @@ gfc_trans_assign_need_temp (gfc_expr * e
+@@ -1968,8 +2005,7 @@ gfc_trans_assign_need_temp (gfc_expr * e
      gfc_add_modify_expr (block, count, gfc_index_zero_node);
  
    /* Generate codes to copy the temporary to lhs.  */
@@ -291,7 +424,7 @@
  
    /* Generate body and loops according to the information in
       nested_forall_info.  */
-@@ -2022,8 +2015,8 @@ gfc_trans_pointer_assign_need_temp (gfc_
+@@ -2022,8 +2058,8 @@ gfc_trans_pointer_assign_need_temp (gfc_
  
        /* Allocate temporary for nested forall construct according to the
           information in nested_forall_info and inner_size.  */
@@ -302,7 +435,7 @@
        gfc_start_block (&body);
        gfc_init_se (&lse, NULL);
        lse.expr = gfc_build_array_ref (tmp1, count);
-@@ -2112,7 +2105,7 @@ gfc_trans_pointer_assign_need_temp (gfc_
+@@ -2112,7 +2148,7 @@ gfc_trans_pointer_assign_need_temp (gfc_
  
        /* Allocate temporary for nested forall construct.  */
        tmp1 = allocate_temp_for_forall_nest (nested_forall_info, parmtype,
@@ -311,21 +444,204 @@
        gfc_start_block (&body);
        gfc_init_se (&lse, NULL);
        lse.expr = gfc_build_array_ref (tmp1, count);
-@@ -2582,7 +2575,7 @@ gfc_evaluate_where_mask (gfc_expr * me, 
+@@ -2203,7 +2239,7 @@ gfc_trans_pointer_assign_need_temp (gfc_
+     end forall
+    (where e,f,g,h<i> are arbitrary expressions possibly involving i)
+    Translates to:
+-    count = ((end + 1 - start) / staride)
++    count = ((end + 1 - start) / stride)
+     masktmp(:) = maskexpr(:)
+ 
+     maskindex = 0;
+@@ -2569,8 +2605,8 @@ gfc_evaluate_where_mask (gfc_expr * me, 
+   gfc_ss *lss, *rss;
+   gfc_loopinfo loop;
+   tree ptemp1, ntmp, ptemp2;
+-  tree inner_size;
+-  stmtblock_t body, body1;
++  tree inner_size, size;
++  stmtblock_t body, body1, inner_size_body;
+   gfc_se lse, rse;
+   tree count;
+   tree tmpexpr;
+@@ -2578,11 +2614,16 @@ gfc_evaluate_where_mask (gfc_expr * me, 
+   gfc_init_loopinfo (&loop);
+ 
+   /* Calculate the size of temporary needed by the mask-expr.  */
+-  inner_size = compute_inner_temp_size (me, me, block, &lss, &rss);
++  gfc_init_block (&inner_size_body);
++  inner_size = compute_inner_temp_size (me, me, &inner_size_body, &lss, &rss);
++
++  /* Calculate the total size of temporary needed.  */
++  size = compute_overall_iter_number (nested_forall_info, inner_size,
++				      &inner_size_body, block);
  
    /* Allocate temporary for where mask.  */
-   tmp = allocate_temp_for_forall_nest (nested_forall_info, boolean_type_node,
+-  tmp = allocate_temp_for_forall_nest (nested_forall_info, boolean_type_node,
 -                                       inner_size, block, &ptemp1);
-+				       inner_size, NULL, block, &ptemp1);
++  tmp = allocate_temp_for_forall_nest_1 (boolean_type_node, size, block,
++					 &ptemp1);
    /* Record the temporary address in order to free it later.  */
    if (ptemp1)
      {
-@@ -2595,7 +2588,7 @@ gfc_evaluate_where_mask (gfc_expr * me, 
+@@ -2594,8 +2635,8 @@ gfc_evaluate_where_mask (gfc_expr * me, 
+     }
  
    /* Allocate temporary for !mask.  */
-   ntmp = allocate_temp_for_forall_nest (nested_forall_info, boolean_type_node,
+-  ntmp = allocate_temp_for_forall_nest (nested_forall_info, boolean_type_node,
 -                                        inner_size, block, &ptemp2);
-+					inner_size, NULL, block, &ptemp2);
++  ntmp = allocate_temp_for_forall_nest_1 (boolean_type_node, size, block,
++					  &ptemp2);
    /* Record the temporary  in order to free it later.  */
    if (ptemp2)
      {
+@@ -2678,8 +2719,22 @@ gfc_evaluate_where_mask (gfc_expr * me, 
+   tmp1 = gfc_finish_block (&body);
+   /* If the WHERE construct is inside FORALL, fill the full temporary.  */
+   if (nested_forall_info != NULL)
+-    tmp1 = gfc_trans_nested_forall_loop (nested_forall_info, tmp1, 1, 1);
++    {
++      forall_info *forall_tmp;
++      tree maskindex;
+ 
++      /* Initialize the maskindexes.  */
++      forall_tmp = nested_forall_info;
++      while (forall_tmp != NULL)
++	{
++	  maskindex = forall_tmp->maskindex;
++	  if (forall_tmp->mask)
++	    gfc_add_modify_expr (block, maskindex, gfc_index_zero_node);
++	  forall_tmp = forall_tmp->next_nest;
++	}
++
++      tmp1 = gfc_trans_nested_forall_loop (nested_forall_info, tmp1, 1, 1);
++    }
+ 
+   gfc_add_expr_to_block (block, tmp1);
+ 
+@@ -3000,6 +3055,9 @@ gfc_trans_where_2 (gfc_code * code, tree
+                                                 nested_forall_info, block);
+                   else
+                     {
++		      forall_info *forall_tmp;
++		      tree maskindex;
++
+                       /* Variables to control maskexpr.  */
+                       count1 = gfc_create_var (gfc_array_index_type, "count1");
+                       count2 = gfc_create_var (gfc_array_index_type, "count2");
+@@ -3008,6 +3066,18 @@ gfc_trans_where_2 (gfc_code * code, tree
+ 
+                       tmp = gfc_trans_where_assign (expr1, expr2, mask, count1,
+                                                     count2);
++
++		      /* Initialize the maskindexes.  */
++		      forall_tmp = nested_forall_info;
++		      while (forall_tmp != NULL)
++			{
++			  maskindex = forall_tmp->maskindex;
++			  if (forall_tmp->mask)
++			    gfc_add_modify_expr (block, maskindex,
++						 gfc_index_zero_node);
++			  forall_tmp = forall_tmp->next_nest;
++			}
++
+                       tmp = gfc_trans_nested_forall_loop (nested_forall_info,
+                                                           tmp, 1, 1);
+                       gfc_add_expr_to_block (block, tmp);
+--- gcc/testsuite/gfortran.fortran-torture/execute/where_7.f90.jj	2005-05-17 00:23:08.000000000 +0200
++++ gcc/testsuite/gfortran.fortran-torture/execute/where_7.f90	2005-05-17 00:23:08.000000000 +0200
+@@ -0,0 +1,53 @@
++! Really test where inside forall with temporary
++program evil_where
++  implicit none
++  type t
++    logical valid
++    integer :: s
++    integer, dimension(:), pointer :: p
++  end type
++  type (t), dimension (5) :: v
++  integer i
++
++  allocate (v(1)%p(2))
++  allocate (v(2)%p(8))
++  v(3)%p => NULL()
++  allocate (v(4)%p(8))
++  allocate (v(5)%p(2))
++
++  v(:)%valid = (/.true., .true., .false., .true., .true./)
++  v(:)%s = (/1, 8, 999, 6, 2/)
++  v(1)%p(:) = (/9, 10/)
++  v(2)%p(:) = (/1, 2, 3, 4, 5, 6, 7, 8/)
++  v(4)%p(:) = (/13, 14, 15, 16, 17, 18, 19, 20/)
++  v(5)%p(:) = (/11, 12/)
++
++  forall (i=1:5,v(i)%valid)
++    where (v(i)%p(1:v(i)%s).gt.4)
++      v(i)%p(1:v(i)%s) = v(6-i)%p(1:v(i)%s)
++    end where
++  end forall
++
++  if (any(v(1)%p(:) .ne. (/11, 10/))) call abort
++  if (any(v(2)%p(:) .ne. (/1, 2, 3, 4, 17, 18, 19, 20/))) call abort
++  if (any(v(4)%p(:) .ne. (/1, 2, 3, 4, 5, 6, 19, 20/))) call abort
++  if (any(v(5)%p(:) .ne. (/9, 10/))) call abort
++
++  v(1)%p(:) = (/9, 10/)
++  v(2)%p(:) = (/1, 2, 3, 4, 5, 6, 7, 8/)
++  v(4)%p(:) = (/13, 14, 15, 16, 17, 18, 19, 20/)
++  v(5)%p(:) = (/11, 12/)
++
++  forall (i=1:5,v(i)%valid)
++    where (v(i)%p(1:v(i)%s).le.4)
++      v(i)%p(1:v(i)%s) = v(6-i)%p(1:v(i)%s)
++    end where
++  end forall
++
++  if (any(v(1)%p(:) .ne. (/9, 10/))) call abort
++  if (any(v(2)%p(:) .ne. (/13, 14, 15, 16, 5, 6, 7, 8/))) call abort
++  if (any(v(4)%p(:) .ne. (/13, 14, 15, 16, 17, 18, 19, 20/))) call abort
++  if (any(v(5)%p(:) .ne. (/11, 12/))) call abort
++
++  ! I should really free the memory I've allocated.
++end program
+--- gcc/testsuite/gfortran.fortran-torture/execute/where_8.f90.jj	2005-05-17 00:23:08.000000000 +0200
++++ gcc/testsuite/gfortran.fortran-torture/execute/where_8.f90	2005-05-17 00:23:08.000000000 +0200
+@@ -0,0 +1,28 @@
++program where_8
++  implicit none
++  type t
++    logical valid
++    integer :: s
++    integer, dimension(8) :: p
++  end type
++  type (t), dimension (5) :: v
++  integer i
++
++  v(:)%valid = (/.true., .true., .false., .true., .true./)
++  v(:)%s = (/1, 8, 999, 6, 2/)
++  v(1)%p(:) = (/9, 10, 0, 0, 0, 0, 0, 0/)
++  v(2)%p(:) = (/1, 2, 3, 4, 5, 6, 7, 8/)
++  v(4)%p(:) = (/13, 14, 15, 16, 17, 18, 19, 20/)
++  v(5)%p(:) = (/11, 12, 0, 0, 0, 0, 0, 0/)
++
++  forall (i=1:5,v(i)%valid)
++    where (v(i)%p(1:v(i)%s).gt.4)
++      v(i)%p(1:v(i)%s) = 21
++    end where
++  end forall
++
++  if (any(v(1)%p(:) .ne. (/21, 10, 0, 0, 0, 0, 0, 0/))) call abort
++  if (any(v(2)%p(:) .ne. (/1, 2, 3, 4, 21, 21, 21, 21/))) call abort
++  if (any(v(4)%p(:) .ne. (/21, 21, 21, 21, 21, 21, 19, 20/))) call abort
++  if (any(v(5)%p(:) .ne. (/21, 21, 0, 0, 0, 0, 0, 0/))) call abort
++end program
+--- gcc/testsuite/gfortran.fortran-torture/execute/forall_3.f90.jj	2004-06-28 01:56:58.000000000 +0200
++++ gcc/testsuite/gfortran.fortran-torture/execute/forall_3.f90	2005-05-17 00:23:08.000000000 +0200
+@@ -1,6 +1,5 @@
++! PR fortran/15080
+ ! Really test forall with temporary
+-! This test fails (2004-06-28).  See PR15080.  I'd XFAIL it,
+-! but there doesn't seem to be an easy way to do this for torture tests.
+ program evil_forall
+   implicit none
+   type t


Index: gcc4.spec
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/gcc4.spec,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- gcc4.spec	12 May 2005 19:06:15 -0000	1.38
+++ gcc4.spec	16 May 2005 23:06:33 -0000	1.39
@@ -1,6 +1,6 @@
-%define DATE 20050512
+%define DATE 20050516
 %define gcc_version 4.0.0
-%define gcc_release 5
+%define gcc_release 6
 %define _unpackaged_files_terminate_build 0
 %define multilib_64_archs sparc64 ppc64 s390x x86_64
 %ifarch %{ix86} alpha ia64 x86_64 s390
@@ -85,15 +85,16 @@
 Patch13: gcc4-struct-layout.patch
 Patch14: gcc4-ppc32-hwint32.patch
 Patch15: gcc4-awt-buffer-strategy.patch
-Patch16: gcc4-htab-expand.patch
+Patch16: gcc4-bz154684.patch
 Patch17: gcc4-gfortran-namelist.patch
 Patch18: gcc4-pr21495.patch
 Patch19: gcc4-java-x509-extension.patch
 Patch20: gcc4-pr21454.patch
 Patch21: gcc4-pr21329.patch
 Patch22: gcc4-pr21492.patch
-Patch23: gcc4-spec23-test.patch
-Patch24: gcc4-fold-indirect-ref.patch
+Patch23: gcc4-bz157308.patch
+Patch24: gcc4-pr21610.patch
+Patch25: gcc4-pr19005-test.patch
 
 %define _gnu %{nil}
 %ifarch sparc
@@ -418,15 +419,16 @@
 %patch13 -p0 -b .struct-layout~
 #%patch14 -p0 -b .ppc32-hwint32~
 %patch15 -p0 -b .awt-buffer-strategy~
-%patch16 -p0 -b .htab-expand~
+%patch16 -p0 -b .bz154684~
 %patch17 -p0 -b .gfortran-namelist~
 %patch18 -p0 -b .pr21495~
 %patch19 -p0 -b .java-x509-extension~
 %patch20 -p0 -b .pr21454~
 %patch21 -p0 -b .pr21329~
 %patch22 -p0 -b .pr21492~
-%patch23 -p0 -b .spec23-test~
-%patch24 -p0 -R -b .fold-indirect-ref~
+%patch23 -p0 -b .bz157308~
+%patch24 -p0 -b .pr21610~
+%patch25 -p0 -b .pr19005-test~
 
 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
@@ -1421,6 +1423,17 @@
 %endif
 
 %changelog
+* Tue May 17 2005 Jakub Jelinek  <jakub at redhat.com> 4.0.0-6
+- update from CVS
+  - PRs target/18655, bootstrap/21230, fortran/17143, fortran/17432,
+	java/21519, libfortran/21324, libgcj/20504, libgcj/21557,
+	libgcj/21606, libstdc++/21526, middle-end/21237, target/21551,
+	target/21556, tree-optimization/21532
+- fixed WHERE inside FORALL (PR fortran/15080)
+- fix a tree sharing bug (#157792, PR tree-optimization/21610)
+- avoid using hash tables recursively (#157308)
+- fix ppc64 libgcj (Andrew Haley, #154684, #142611)
+
 * Thu May 12 2005 Jakub Jelinek  <jakub at redhat.com> 4.0.0-5
 - update from CVS
   - PRs bootstrap/21403, c++/19203, c++/20723, c++/21352, c/21160, c/21342,


Index: sources
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/sources,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- sources	12 May 2005 13:26:05 -0000	1.91
+++ sources	16 May 2005 23:06:33 -0000	1.92
@@ -1 +1 @@
-5cda3ead4f6a3eb785fb8d3402bf67c5  gcc-4.0.0-20050512.tar.bz2
+ed172f7b5b4de1351544626a0c13a380  gcc-4.0.0-20050516.tar.bz2


--- gcc4-fold-indirect-ref.patch DELETED ---


--- gcc4-htab-expand.patch DELETED ---


--- gcc4-spec23-test.patch DELETED ---




More information about the fedora-cvs-commits mailing list