summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-19 13:25:22 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-19 13:25:22 +0000
commitb538a1ef072477f9ce47d1942a069b5c619d8814 (patch)
tree963ec6d00bf1bf89a14122150aae777bf1f6a55a /gcc/fortran/trans-openmp.c
parenta98c10fa821cd0cb9acbd9ea345baa505217b98a (diff)
downloadgcc-b538a1ef072477f9ce47d1942a069b5c619d8814.tar.gz
PR fortran/49792
* trans-expr.c (gfc_trans_assignment_1): Set OMPWS_SCALARIZER_WS bit in ompws_flags only if loop.temp_ss is NULL, and clear it if lhs needs reallocation. * trans-openmp.c (gfc_trans_omp_workshare): Don't return early if code is NULL, emit a barrier if workshare emitted no code at all and NOWAIT clause isn't present. * testsuite/libgomp.fortran/pr49792-1.f90: New test. * testsuite/libgomp.fortran/pr49792-2.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177898 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r--gcc/fortran/trans-openmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index b1f8e09a1b9..cfe8612dfc9 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -1764,9 +1764,6 @@ gfc_trans_omp_workshare (gfc_code *code, gfc_omp_clauses *clauses)
pushlevel (0);
- if (!code)
- return build_empty_stmt (input_location);
-
gfc_start_block (&block);
pblock = &block;
@@ -1903,6 +1900,9 @@ gfc_trans_omp_workshare (gfc_code *code, gfc_omp_clauses *clauses)
else
poplevel (0, 0, 0);
+ if (IS_EMPTY_STMT (stmt) && !clauses->nowait)
+ stmt = gfc_trans_omp_barrier ();
+
ompws_flags = 0;
return stmt;
}