From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68502 invoked by alias); 5 Sep 2018 14:57:54 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 68216 invoked by uid 89); 5 Sep 2018 14:57:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1735, H*Ad:U*aldot, HContent-Transfer-Encoding:8bit X-HELO: mail-wm0-f41.google.com Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Sep 2018 14:57:50 +0000 Received: by mail-wm0-f41.google.com with SMTP id s12-v6so8356370wmc.0; Wed, 05 Sep 2018 07:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nLSr2Fb7+GgCLPGdQhm3icYIhZiLzTrYRy+eBhBK2FI=; b=h5IZxpjLkyWsp9fnXTpgpFX/FbdlhrHbLpRpKJjNQfEr8DvZuif9+SZOvIkNQlPVq9 8wRNoeIWsb7UwFH4KsPo3ojwDwqrDo4OPsdGXGxdQlGyDZJV7QICHYopaD2oKjLMtH/w tVNNzfQf94KYNuCmbe9zvdV3qmnI6Aea68K7zeUZpKIpYvakAEjak2e8/B75v2m+QqDM H2/uxG2PU3SZuuxrJuz5iIFA3TJnYkoFCWaVAFSpFVx9V2RGQiQ+10YAUjjMf/DmzeQ+ KCBQk3UDj+ftbJPfljfHT2Qn2bWIK5/ltc4AEBH3PmU/VXPwojEZkM+maqkmt3cvle2s dNMA== Return-Path: Received: from s46.loc (91-119-125-11.dsl.dynamic.surfer.at. [91.119.125.11]) by smtp.gmail.com with ESMTPSA id t9-v6sm3523680wra.91.2018.09.05.07.57.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Sep 2018 07:57:45 -0700 (PDT) Received: from cow by s46.loc with local (Exim 4.91) (envelope-from ) id 1fxZFY-00007W-3x; Wed, 05 Sep 2018 14:57:44 +0000 From: Bernhard Reutner-Fischer To: fortran@gcc.gnu.org Cc: Bernhard Reutner-Fischer , gcc-patches@gcc.gnu.org Subject: [PATCH,FORTRAN 06/29] Use stringpool for association_list Date: Wed, 05 Sep 2018 14:57:00 -0000 Message-Id: <20180905145732.404-7-rep.dot.nop@gmail.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00027.txt.bz2 From: Bernhard Reutner-Fischer 2017-10-26 Bernhard Reutner-Fischer * gfortran.h (struct gfc_association_list): Change name to pointer. * match.c (gfc_match_associate): Adjust. --- gcc/fortran/gfortran.h | 2 +- gcc/fortran/match.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 774a6de6168..ff42b39b453 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2482,7 +2482,7 @@ typedef struct gfc_association_list /* True when the rank of the target expression is guessed during parsing. */ unsigned rankguessed:1; - char name[GFC_MAX_SYMBOL_LEN + 1]; + const char *name; gfc_symtree *st; /* Symtree corresponding to name. */ locus where; diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 1b03e7251a5..38827ed4637 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -1891,8 +1891,7 @@ gfc_match_associate (void) gfc_association_list* a; /* Match the next association. */ - const char *name_hack = NULL; - if (gfc_match (" %n =>", &name_hack) != MATCH_YES) + if (gfc_match (" %n =>", &newAssoc->name) != MATCH_YES) { gfc_error ("Expected association at %C"); goto assocListError; @@ -1909,12 +1908,11 @@ gfc_match_associate (void) } gfc_matching_procptr_assignment = 0; } - strcpy (newAssoc->name, name_hack); newAssoc->where = gfc_current_locus; /* Check that the current name is not yet in the list. */ for (a = new_st.ext.block.assoc; a; a = a->next) - if (!strcmp (a->name, newAssoc->name)) + if (a->name == newAssoc->name) { gfc_error ("Duplicate name %qs in association at %C", newAssoc->name); -- 2.19.0.rc1