aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-08-26 16:55:05 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-08-26 16:55:05 +0200
commita6c975bd8e847c29541026b66b33275b42df4995 (patch)
tree5460c14eafa145770f2aadf261d0b5fd64127454 /gcc
parent2f27df53e757ee0ef77d042e92a7cd8e931e97f5 (diff)
downloadgcc-a6c975bd8e847c29541026b66b33275b42df4995.zip
gcc-a6c975bd8e847c29541026b66b33275b42df4995.tar.gz
gcc-a6c975bd8e847c29541026b66b33275b42df4995.tar.bz2
trans-decl.c (get_proc_pointer_decl): Set DECL_TLS_MODEL if threadprivate.
* 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. From-SVN: r178114
Diffstat (limited to 'gcc')
-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 be796ba..08c68ad 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 126a52b..ce4ab3d 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 1059a42..c85e20c 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);