Commit 5b8fdd1f by Jakub Jelinek Committed by Jakub Jelinek

re PR fortran/27446 (ICE on OpenMP array REDUCTION clause)

	PR fortran/27446
	* trans-openmp.c (gfc_trans_omp_array_reduction): Ensure
	OMP_CLAUSE_REDUCTION_{INIT,MERGE} are set to BIND_EXPR.

From-SVN: r113787
parent 7e497d0c
2006-05-15 Jakub Jelinek <jakub@redhat.com>
PR fortran/27446
* trans-openmp.c (gfc_trans_omp_array_reduction): Ensure
OMP_CLAUSE_REDUCTION_{INIT,MERGE} are set to BIND_EXPR.
2006-05-14 H.J. Lu <hongjiu.lu@intel.com> 2006-05-14 H.J. Lu <hongjiu.lu@intel.com>
* Make-lang.in (fortran/options.o): Depend on $(TARGET_H). * Make-lang.in (fortran/options.o): Depend on $(TARGET_H).
......
...@@ -262,7 +262,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where) ...@@ -262,7 +262,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
gfc_symbol init_val_sym, outer_sym, intrinsic_sym; gfc_symbol init_val_sym, outer_sym, intrinsic_sym;
gfc_expr *e1, *e2, *e3, *e4; gfc_expr *e1, *e2, *e3, *e4;
gfc_ref *ref; gfc_ref *ref;
tree decl, backend_decl; tree decl, backend_decl, stmt;
locus old_loc = gfc_current_locus; locus old_loc = gfc_current_locus;
const char *iname; const char *iname;
try t; try t;
...@@ -400,10 +400,22 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where) ...@@ -400,10 +400,22 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
gcc_assert (t == SUCCESS); gcc_assert (t == SUCCESS);
/* Create the init statement list. */ /* Create the init statement list. */
OMP_CLAUSE_REDUCTION_INIT (c) = gfc_trans_assignment (e1, e2); pushlevel (0);
stmt = gfc_trans_assignment (e1, e2);
if (TREE_CODE (stmt) != BIND_EXPR)
stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0, 0));
else
poplevel (0, 0, 0);
OMP_CLAUSE_REDUCTION_INIT (c) = stmt;
/* Create the merge statement list. */ /* Create the merge statement list. */
OMP_CLAUSE_REDUCTION_MERGE (c) = gfc_trans_assignment (e3, e4); pushlevel (0);
stmt = gfc_trans_assignment (e3, e4);
if (TREE_CODE (stmt) != BIND_EXPR)
stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0, 0));
else
poplevel (0, 0, 0);
OMP_CLAUSE_REDUCTION_MERGE (c) = stmt;
/* And stick the placeholder VAR_DECL into the clause as well. */ /* And stick the placeholder VAR_DECL into the clause as well. */
OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = outer_sym.backend_decl; OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = outer_sym.backend_decl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment