This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: gomp - equivalence for threadprivate data
Tobias Burnus wrote:
Matevz Tadel wrote:
I filled a bugreport (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38979)
to track this.
First, thank you all for taking interest in this.
Tobias wrote in the comment to the bug report that simply removing the
error might already be enough.
If you can point us to the place where this error is generated we can
test if disabling it (or changing it to a warning) produces the
desired results.
You can try the following patch (completely untested).
Tobias
Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c (revision 143664)
+++ gcc/fortran/symbol.c (working copy)
@@ -477,7 +477,6 @@
conf (in_equivalence, result);
conf (in_equivalence, entry);
conf (in_equivalence, allocatable);
- conf (in_equivalence, threadprivate);
conf (in_namelist, pointer);
conf (in_namelist, allocatable);
Thanks! I've applied the patch to the head of the 4.3 branch. I had to comment
out another check in openmp.c (diff attached).
Running in the main thread gives the same results. Will try running in a
non-main thread now and then go multithreaded. This might take a while, as I
have to finish something else this week, although I'm very tempted to pretend it
is not there :)
Thanks again!
Matevz
Index: gcc/fortran/openmp.c
===================================================================
--- gcc/fortran/openmp.c (revision 143701)
+++ gcc/fortran/openmp.c (working copy)
@@ -474,10 +474,11 @@
switch (m)
{
case MATCH_YES:
- if (sym->attr.in_common)
+ /* Commented out by Matevz Tadel. */
+ /* if (sym->attr.in_common)
gfc_error_now ("Threadprivate variable at %C is an element of "
"a COMMON block");
- else if (gfc_add_threadprivate (&sym->attr, sym->name,
+ else */ if (gfc_add_threadprivate (&sym->attr, sym->name,
&sym->declared_at) == FAILURE)
goto cleanup;
goto next_item;
Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c (revision 143701)
+++ gcc/fortran/symbol.c (working copy)
@@ -465,7 +465,8 @@
conf (in_equivalence, result);
conf (in_equivalence, entry);
conf (in_equivalence, allocatable);
- conf (in_equivalence, threadprivate);
+ /* Adviced by Tobias Burnus, warned this is not tested. */
+ /* conf (in_equivalence, threadprivate); */
conf (in_namelist, pointer);
conf (in_namelist, allocatable);