diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-15 09:57:54 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-15 09:57:54 +0000 |
commit | 48080ae7d5a84d071c0311d19646859d1b743da3 (patch) | |
tree | be5d403048ff99d6d1060ac0b9d66a4b664a4728 /gcc/fortran | |
parent | cd2ba456af4afec9fb3f45a4af67fddaf15c43d9 (diff) | |
download | gcc-48080ae7d5a84d071c0311d19646859d1b743da3.tar.gz |
PR fortran/27446
* trans-openmp.c (gfc_trans_omp_array_reduction): Ensure
OMP_CLAUSE_REDUCTION_{INIT,MERGE} are set to BIND_EXPR.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113787 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-openmp.c | 18 |
2 files changed, 21 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index fadf75031f7..f5c36e7a704 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +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> * Make-lang.in (fortran/options.o): Depend on $(TARGET_H). diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index bd57836713a..f33f1bd3741 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -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_expr *e1, *e2, *e3, *e4; gfc_ref *ref; - tree decl, backend_decl; + tree decl, backend_decl, stmt; locus old_loc = gfc_current_locus; const char *iname; try t; @@ -400,10 +400,22 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where) gcc_assert (t == SUCCESS); /* 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. */ - 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. */ OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = outer_sym.backend_decl; |