diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-06-15 14:15:26 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-06-15 14:15:26 +0200 |
commit | 79943d19dc27298a384fce25c604fe6191e0765f (patch) | |
tree | 160e18b4ba214f50eed4f22ee4c8e9a0dff923af /gcc/fortran | |
parent | eed5f58ad65fc65af6d50e263a632537c9478b26 (diff) | |
download | gcc-79943d19dc27298a384fce25c604fe6191e0765f.zip gcc-79943d19dc27298a384fce25c604fe6191e0765f.tar.gz gcc-79943d19dc27298a384fce25c604fe6191e0765f.tar.bz2 |
re PR fortran/44536 (OMP: missing error with default(none))
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.
From-SVN: r160779
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/fortran/f95-lang.c | 2 | ||||
-rw-r--r-- | gcc/fortran/trans-openmp.c | 18 | ||||
-rw-r--r-- | gcc/fortran/trans.h | 1 |
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3d7dde7..39cab7a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,13 @@ +2010-06-15 Jakub Jelinek <jakub@redhat.com> + + PR fortran/44536 + * 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. + 2010-06-13 Daniel Franke <franke.daniel@gmail.com> PR fortran/31588 diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index a97016a..c6af002 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -111,6 +111,7 @@ static void gfc_init_ts (void); #undef LANG_HOOKS_INIT_TS #undef LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE #undef LANG_HOOKS_OMP_PREDETERMINED_SHARING +#undef LANG_HOOKS_OMP_REPORT_DECL #undef LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR #undef LANG_HOOKS_OMP_CLAUSE_COPY_CTOR #undef LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP @@ -137,6 +138,7 @@ static void gfc_init_ts (void); #define LANG_HOOKS_INIT_TS gfc_init_ts #define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE gfc_omp_privatize_by_reference #define LANG_HOOKS_OMP_PREDETERMINED_SHARING gfc_omp_predetermined_sharing +#define LANG_HOOKS_OMP_REPORT_DECL gfc_omp_report_decl #define LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR gfc_omp_clause_default_ctor #define LANG_HOOKS_OMP_CLAUSE_COPY_CTOR gfc_omp_clause_copy_ctor #define LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP gfc_omp_clause_assign_op diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 50e7847..1be4b81 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. */ diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 72f8a43..946ce2e 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -523,6 +523,7 @@ bool gfc_get_array_descr_info (const_tree, struct array_descr_info *); /* In trans-openmp.c */ bool gfc_omp_privatize_by_reference (const_tree); enum omp_clause_default_kind gfc_omp_predetermined_sharing (tree); +tree gfc_omp_report_decl (tree); tree gfc_omp_clause_default_ctor (tree, tree, tree); tree gfc_omp_clause_copy_ctor (tree, tree, tree); tree gfc_omp_clause_assign_op (tree, tree, tree); |