From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24934 invoked by alias); 28 Oct 2009 14:32:14 -0000 Received: (qmail 24918 invoked by uid 22791); 28 Oct 2009 14:32:13 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Oct 2009 14:32:08 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id n9SEW5V8021945; Wed, 28 Oct 2009 07:32:06 -0700 Received: from bwz27 (bwz27.prod.google.com [10.188.26.27]) by wpaz33.hot.corp.google.com with ESMTP id n9SEW2wN005319; Wed, 28 Oct 2009 07:32:02 -0700 Received: by bwz27 with SMTP id 27so1319981bwz.1 for ; Wed, 28 Oct 2009 07:32:02 -0700 (PDT) Received: by 10.204.156.28 with SMTP id u28mr1904844bkw.74.1256740322013; Wed, 28 Oct 2009 07:32:02 -0700 (PDT) Received: from coign.google.com ([67.218.106.108]) by mx.google.com with ESMTPS id 14sm278489bwz.5.2009.10.28.07.31.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 28 Oct 2009 07:32:00 -0700 (PDT) To: Rafael Espindola Cc: GCC Patches , Richard Guenther , Diego Novillo , Paul Brook , fortran@gcc.gnu.org Subject: Re: [patch] Fix PR41764 References: <38a0d8450910211055g4968b06fie72550732e1dcf4c@mail.gmail.com> <38a0d8450910211517j4af51106qf3f81c169a7e830c@mail.gmail.com> <38a0d8450910261141i5f4dda4erfd4122c388f2f240@mail.gmail.com> <38a0d8450910271648m76a92c3as1b8a8ee9404cc7e1@mail.gmail.com> From: Ian Lance Taylor Date: Wed, 28 Oct 2009 14:34:00 -0000 In-Reply-To: <38a0d8450910271648m76a92c3as1b8a8ee9404cc7e1@mail.gmail.com> (Rafael Espindola's message of "Tue\, 27 Oct 2009 19\:48\:50 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2009-10/txt/msg01669.txt.bz2 Rafael Espindola writes: > gcc/ > 2009-10-27 Rafael Avila de Espindola > > * dbxout.c (dbxout_common_check): Accept non public trees. > * dwarf2out.c (fortran_common): Accept non public trees. > > gcc/fortran/ > 2009-10-27 Rafael Avila de Espindola > > * trans-common.c (create_common): Set TREE_PUBLIC to false on > fake variables. The middle-end parts of this patch are OK. This is OK if the Fortran maintainers are OK with the change to trans-common.c. Thanks. > diff --git a/gcc/dbxout.c b/gcc/dbxout.c > index b5688d9..0bf5e3c 100644 > --- a/gcc/dbxout.c > +++ b/gcc/dbxout.c > @@ -3189,7 +3189,7 @@ dbxout_common_check (tree decl, int *value) > rtx sym_addr; > const char *name = NULL; > > - /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if > + /* If the decl isn't a VAR_DECL, or if it isn't static, or if > it does not have a value (the offset into the common area), or if it > is thread local (as opposed to global) then it isn't common, and shouldn't > be handled as such. > @@ -3198,7 +3198,6 @@ dbxout_common_check (tree decl, int *value) > for thread-local symbols. Can be handled via same mechanism as used > in dwarf2out.c. */ > if (TREE_CODE (decl) != VAR_DECL > - || !TREE_PUBLIC(decl) > || !TREE_STATIC(decl) > || !DECL_HAS_VALUE_EXPR_P(decl) > || DECL_THREAD_LOCAL_P (decl) > diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c > index 129ba7d..732b6a6 100644 > --- a/gcc/dwarf2out.c > +++ b/gcc/dwarf2out.c > @@ -15621,12 +15621,11 @@ fortran_common (tree decl, HOST_WIDE_INT *value) > tree offset; > int volatilep = 0, unsignedp = 0; > > - /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if > + /* If the decl isn't a VAR_DECL, or if it isn't static, or if > it does not have a value (the offset into the common area), or if it > is thread local (as opposed to global) then it isn't common, and shouldn't > be handled as such. */ > if (TREE_CODE (decl) != VAR_DECL > - || !TREE_PUBLIC (decl) > || !TREE_STATIC (decl) > || !DECL_HAS_VALUE_EXPR_P (decl) > || !is_fortran ()) > diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c > index 5b1952a..1fb3c40 100644 > --- a/gcc/fortran/trans-common.c > +++ b/gcc/fortran/trans-common.c > @@ -680,7 +680,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) > var_decl = build_decl (s->sym->declared_at.lb->location, > VAR_DECL, DECL_NAME (s->field), > TREE_TYPE (s->field)); > - TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl); > TREE_STATIC (var_decl) = TREE_STATIC (decl); > TREE_USED (var_decl) = TREE_USED (decl); > if (s->sym->attr.use_assoc) > @@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) > TREE_ADDRESSABLE (var_decl) = 1; > /* This is a fake variable just for debugging purposes. */ > TREE_ASM_WRITTEN (var_decl) = 1; > - > + /* Fake variables are not visible from other translation units. */ > + TREE_PUBLIC (var_decl) = 0; > + > /* To preserve identifier names in COMMON, chain to procedure > scope unless at top level in a module definition. */ > if (com