[tuples] Fix Fortran array reductions

Jakub Jelinek jakub@redhat.com
Fri May 30 14:28:00 GMT 2008


Hi!

This fixes all remaining libgomp failures on tuples branch, will go
back now to the few remaining gomp.exp failures.

2008-05-30  Jakub Jelinek  <jakub@redhat.com>

	* omp-low.c (scan_sharing_clauses): Call scan_omp on
	OMP_CLAUSE_REDUCTION_GIMPLE_{INIT,MERGE} instead of
	scan_omp_op on OMP_CLAUSE_REDUCTION_{INIT,MERGE}.
	(lower_rec_input_clauses): Clear
	OMP_CLAUSE_REDUCTION_GIMPLE_{INIT,MERGE} instead of
	OMP_CLAUSE_REDUCTION_{INIT,MERGE}.  Call lower_omp
	on OMP_CLAUSE_REDUCTION_GIMPLE_MERGE before gimple_seq_add_seq
	to replace all occurences of placeholder in the seq.
	* gimplify.c (gimplify_scan_omp_clauses): Clear
	OMP_CLAUSE_REDUCTION_{INIT,MERGE} after gimplifying it.

--- gcc/omp-low.c.jj	2008-05-29 21:36:57.000000000 +0200
+++ gcc/omp-low.c	2008-05-30 14:01:38.000000000 +0200
@@ -1155,8 +1155,8 @@ scan_sharing_clauses (tree clauses, omp_
       if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
 	  && OMP_CLAUSE_REDUCTION_PLACEHOLDER (c))
 	{
-	  scan_omp_op (&OMP_CLAUSE_REDUCTION_INIT (c), ctx);
-	  scan_omp_op (&OMP_CLAUSE_REDUCTION_MERGE (c), ctx);
+	  scan_omp (OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c), ctx);
+	  scan_omp (OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c), ctx);
 	}
 }
 
@@ -1898,7 +1898,7 @@ lower_rec_input_clauses (tree clauses, g
 		  gimple_seq_add_seq (ilist,
 		      		     OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c));
 
-		  OMP_CLAUSE_REDUCTION_INIT (c) = NULL;
+		  OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c) = NULL;
 		}
 	      else
 		{
@@ -2062,8 +2062,9 @@ lower_reduction_clauses (tree clauses, g
 	    ref = build_fold_addr_expr (ref);
 	  SET_DECL_VALUE_EXPR (placeholder, ref);
 	  DECL_HAS_VALUE_EXPR_P (placeholder) = 1;
+	  lower_omp (OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c), ctx);
 	  gimple_seq_add_seq (&sub_seq, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c));
-	  OMP_CLAUSE_REDUCTION_MERGE (c) = NULL;
+	  OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c) = NULL;
 	  OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = NULL;
 	}
       else
--- gcc/gimplify.c.jj	2008-05-28 16:43:05.000000000 +0200
+++ gcc/gimplify.c	2008-05-30 13:29:15.000000000 +0200
@@ -5304,6 +5304,8 @@ gimplify_scan_omp_clauses (tree *list_p,
 		  		&OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c));
 	      pop_gimplify_context 
 		(gimple_seq_first_stmt (OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c)));
+	      OMP_CLAUSE_REDUCTION_INIT (c) = NULL_TREE;
+	      OMP_CLAUSE_REDUCTION_MERGE (c) = NULL_TREE;
 
 	      gimplify_omp_ctxp = outer_ctx;
 	    }

	Jakub



More information about the Gcc-patches mailing list