summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-15 12:15:26 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-15 12:15:26 +0000
commit4ad7515928723c066cc9e064a4ac2a98c3dd5066 (patch)
tree160e18b4ba214f50eed4f22ee4c8e9a0dff923af /gcc/fortran/trans-openmp.c
parent6fc0e9e58d0402444613e6adcd56490191b16eb1 (diff)
downloadgcc-4ad7515928723c066cc9e064a4ac2a98c3dd5066.tar.gz
PR fortran/44536
* langhooks.h (struct lang_hooks_for_decls): Add omp_report_decl. * langhooks-def.h (LANG_HOOKS_OMP_REPORT_DECL): Define. (LANG_HOOKS_DECLS): Add it. * gimplify.c (omp_notice_variable): Call lang_hooks.decls.omp_report_decl. * trans-openmp.c (gfc_omp_predetermined_sharing): Don't return OMP_CLAUSE_DEFAULT_SHARED for artificial vars with GFC_DECL_SAVED_DESCRIPTOR set. (gfc_omp_report_decl): New function. * trans.h (gfc_omp_report_decl): New prototype. * f95-lang.c (LANG_HOOKS_OMP_REPORT_DECL): Redefine. * gfortran.dg/gomp/pr44536.f90: New test. * gfortran.dg/gomp/sharing-3.f90: Remove xfail. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160779 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r--gcc/fortran/trans-openmp.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 50e7847d0e1..1be4b81c8e8 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -75,7 +75,10 @@ gfc_omp_privatize_by_reference (const_tree decl)
enum omp_clause_default_kind
gfc_omp_predetermined_sharing (tree decl)
{
- if (DECL_ARTIFICIAL (decl) && ! GFC_DECL_RESULT (decl))
+ if (DECL_ARTIFICIAL (decl)
+ && ! GFC_DECL_RESULT (decl)
+ && ! (DECL_LANG_SPECIFIC (decl)
+ && GFC_DECL_SAVED_DESCRIPTOR (decl)))
return OMP_CLAUSE_DEFAULT_SHARED;
/* Cray pointees shouldn't be listed in any clauses and should be
@@ -118,6 +121,19 @@ gfc_omp_predetermined_sharing (tree decl)
return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
}
+/* Return decl that should be used when reporting DEFAULT(NONE)
+ diagnostics. */
+
+tree
+gfc_omp_report_decl (tree decl)
+{
+ if (DECL_ARTIFICIAL (decl)
+ && DECL_LANG_SPECIFIC (decl)
+ && GFC_DECL_SAVED_DESCRIPTOR (decl))
+ return GFC_DECL_SAVED_DESCRIPTOR (decl);
+
+ return decl;
+}
/* Return true if DECL in private clause needs
OMP_CLAUSE_PRIVATE_OUTER_REF on the private clause. */