public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <burnus@net-b.de>
To: Dominique Dhumieres <dominiq@lps.ens.fr>, fortran@gcc.gnu.org
Cc: gcc-patches@gcc.gnu.org, fxcoudert@gmail.com
Subject: Re: [Patch, Fortran + Testsuite] Fix coarray handling in modules
Date: Sat, 03 Jan 2015 20:50:00 -0000	[thread overview]
Message-ID: <54A855FB.3050207@net-b.de> (raw)
In-Reply-To: <20150103102245.BAB57105@mailhost.lps.ens.fr>

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

Dominique Dhumieres wrote:
> The test gfortran.dg/coarray/codimension_2.f90 fails on x86_64-apple-darwin14 with -m32
> (see https://gcc.gnu.org/ml/gcc-testresults/2015-01/msg00185.html). The error is
> [...]

Yes, there seems to be something wrong. The module has:

                  U _F.caf_token__global_coarrays_MOD_b
0000000000000000 B __global_coarrays_MOD_b

where the token should not be "U"ndefined but "B". On the other hand, 
the USEr of the module has:

0000000000000000 B _F.caf_token__global_coarrays_MOD_b
                  U __global_coarrays_MOD_b

but it should have a "U" – with two users one even would get: "multiple 
definition of `_F.caf_token__global_coarrays_MOD_b'".


Untested patch attached.

Tobias

[-- Attachment #2: foo.diff --]
[-- Type: text/x-patch, Size: 991 bytes --]

diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 9ef6bfc..84a8a6e 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -830,14 +830,23 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
 			IDENTIFIER_POINTER (gfc_sym_mangled_identifier (sym))));
 	  token = build_decl (DECL_SOURCE_LOCATION (decl), VAR_DECL, token_name,
 			      token_type);
-	  TREE_PUBLIC (token) = 1;
+	  if (sym->attr.use_assoc)
+	    DECL_EXTERNAL (token) = 1;
+	  else
+	    TREE_STATIC (token) = 1;
+
+	  if (sym->attr.use_assoc || sym->attr.access != ACCESS_PRIVATE ||
+	      sym->attr.public_used)
+	    TREE_PUBLIC (token) = 1;
 	}
       else
-	token = gfc_create_var_np (token_type, "caf_token");
+	{
+	  token = gfc_create_var_np (token_type, "caf_token");
+	  TREE_STATIC (token) = 1;
+	}
 
       GFC_TYPE_ARRAY_CAF_TOKEN (type) = token;
       DECL_ARTIFICIAL (token) = 1;
-      TREE_STATIC (token) = 1;
       gfc_add_decl_to_function (token);
     }
 

  reply	other threads:[~2015-01-03 20:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-03 10:22 Dominique Dhumieres
2015-01-03 20:50 ` Tobias Burnus [this message]
2015-01-03 21:48   ` Dominique d'Humières
2015-01-03 22:30     ` Tobias Burnus
2015-01-03 23:04       ` Dominique d'Humières
2015-01-04 18:58         ` [Patch, Fortran] Fix previous patch (was: Re: [Patch, Fortran + Testsuite] Fix coarray handling in modules) Tobias Burnus
2015-01-04 21:28           ` Dominique d'Humières
2015-01-07 21:37           ` [Patch, Fortran] Fix previous patch Tobias Burnus
     [not found]             ` <CAGkQGi+MJhuQCGyvVE-Qw9qZ6AcXBN1b62+Ky=adJO7iEKAxDA@mail.gmail.com>
2015-01-08 18:10               ` Tobias Burnus
  -- strict thread matches above, loose matches on Subject: below --
2015-01-02 11:28 [Patch, Fortran + Testsuite] Fix coarray handling in modules Tobias Burnus
2015-01-02 13:14 ` FX
2015-01-02 20:47 ` Mike Stump
2019-02-28 17:19 ` Thomas Schwinge
2019-03-21 19:34   ` Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54A855FB.3050207@net-b.de \
    --to=burnus@net-b.de \
    --cc=dominiq@lps.ens.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=fxcoudert@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).