summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-26 14:55:05 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-26 14:55:05 +0000
commit8fb1768c966f7d62a38dc5be5593ca52fa198bd4 (patch)
tree5460c14eafa145770f2aadf261d0b5fd64127454 /gcc/fortran
parent5eaef98c9e343c1aaeba9132c9ff289dfa642bae (diff)
downloadgcc-8fb1768c966f7d62a38dc5be5593ca52fa198bd4.tar.gz
* trans-decl.c (get_proc_pointer_decl): Set DECL_TLS_MODEL
if threadprivate. * symbol.c (check_conflict): Allow threadprivate attribute with FL_PROCEDURE if proc_pointer. * testsuite/libgomp.fortran/threadprivate4.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178114 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/symbol.c3
-rw-r--r--gcc/fortran/trans-decl.c5
3 files changed, 14 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index be796bae6e1..08c68ada97e 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+2011-08-26 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-decl.c (get_proc_pointer_decl): Set DECL_TLS_MODEL
+ if threadprivate.
+ * symbol.c (check_conflict): Allow threadprivate attribute with
+ FL_PROCEDURE if proc_pointer.
+
2011-08-25 Mikael Morin <mikael.morin@gcc.gnu.org>
PR fortran/50050
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 126a52b9e7e..ce4ab3d1c38 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -673,7 +673,8 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
conf2 (codimension);
conf2 (dimension);
conf2 (function);
- conf2 (threadprivate);
+ if (!attr->proc_pointer)
+ conf2 (threadprivate);
}
if (!attr->proc_pointer)
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 1059a42f8ab..c85e20c007b 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1534,6 +1534,11 @@ get_proc_pointer_decl (gfc_symbol *sym)
false, true);
}
+ /* Handle threadprivate procedure pointers. */
+ if (sym->attr.threadprivate
+ && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
+ DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
+
attributes = add_attributes_to_decl (sym->attr, NULL_TREE);
decl_attributes (&decl, attributes, 0);