summaryrefslogtreecommitdiffstats
path: root/gcc/fortran
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-10 11:09:32 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-10 11:09:32 +0000
commitab283007ee7f3ab8a13175a902f6fd9df7671a8f (patch)
tree9dd7aaae5ad79b9f1cbca973925cadd4943d88ad /gcc/fortran
parent827aca2cc2509cdfef609e708173d6b4bdaaee27 (diff)
downloadppe42-gcc-ab283007ee7f3ab8a13175a902f6fd9df7671a8f.tar.gz
ppe42-gcc-ab283007ee7f3ab8a13175a902f6fd9df7671a8f.zip
PR fortran/59488
* trans-openmp.c (gfc_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for parameters or vtables. * gfortran.dg/gomp/pr59488-1.f90: New test. * gfortran.dg/gomp/pr59488-2.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216068 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-openmp.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 6a47227acd3..18f360da9b5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/59488
+ * trans-openmp.c (gfc_omp_predetermined_sharing): Return
+ OMP_CLAUSE_DEFAULT_SHARED for parameters or vtables.
+
2014-09-03 Marek Polacek <polacek@redhat.com>
Backport from trunk
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 548b5d3a485..e31ede29bfa 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -135,6 +135,16 @@ gfc_omp_predetermined_sharing (tree decl)
if (GFC_DECL_RESULT (decl) && ! DECL_HAS_VALUE_EXPR_P (decl))
return OMP_CLAUSE_DEFAULT_SHARED;
+ /* These are either array or derived parameters, or vtables.
+ In the former cases, the OpenMP standard doesn't consider them to be
+ variables at all (they can't be redefined), but they can nevertheless appear
+ in parallel/task regions and for default(none) purposes treat them as shared.
+ For vtables likely the same handling is desirable. */
+ if (TREE_CODE (decl) == VAR_DECL
+ && TREE_READONLY (decl)
+ && TREE_STATIC (decl))
+ return OMP_CLAUSE_DEFAULT_SHARED;
+
return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
}
OpenPOWER on IntegriCloud