From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7329 invoked by alias); 3 Jan 2015 20:50:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7308 invoked by uid 89); 3 Jan 2015 20:50:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: outpost5.zedat.fu-berlin.de Received: from outpost5.zedat.fu-berlin.de (HELO outpost5.zedat.fu-berlin.de) (130.133.4.89) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sat, 03 Jan 2015 20:50:21 +0000 Received: from relay1.zedat.fu-berlin.de ([130.133.4.67]) by outpost.zedat.fu-berlin.de (Exim 4.82) with esmtp (envelope-from ) id <1Y7VeL-000ALU-TZ>; Sat, 03 Jan 2015 21:50:17 +0100 Received: from squeeze64.physik.fu-berlin.de ([160.45.66.239] helo=tux.net-b.de) by relay1.zedat.fu-berlin.de (Exim 4.82) with esmtp (envelope-from ) id <1Y7VeK-003TXW-6A>; Sat, 03 Jan 2015 21:50:17 +0100 Message-ID: <54A855FB.3050207@net-b.de> Date: Sat, 03 Jan 2015 20:50:00 -0000 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Dominique Dhumieres , fortran@gcc.gnu.org CC: gcc-patches@gcc.gnu.org, fxcoudert@gmail.com Subject: Re: [Patch, Fortran + Testsuite] Fix coarray handling in modules References: <20150103102245.BAB57105@mailhost.lps.ens.fr> In-Reply-To: <20150103102245.BAB57105@mailhost.lps.ens.fr> Content-Type: multipart/mixed; boundary="------------020006040107010401000202" X-SW-Source: 2015-01/txt/msg00066.txt.bz2 This is a multi-part message in MIME format. --------------020006040107010401000202 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-length: 728 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 --------------020006040107010401000202 Content-Type: text/x-patch; name="foo.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="foo.diff" Content-length: 991 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); } --------------020006040107010401000202--