From patchwork Wed Sep 5 14:57:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 966427 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-485224-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="gCrUArj+"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="h5IZxpjL"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4256LM4L6Rz9sCn for ; Thu, 6 Sep 2018 00:59:39 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; q=dns; s=default; b=bMW seBnPfrGlkkJe11ANZWf0I0G0rg9+oAjs379jvBgQcXURTpnZAxtJH7edG6PLCjg msZBwtCPZXlgHPKbXwnM9VypOzrzZqOZ0xpSuTfSeDCZQxA7z7NyTjnfG6aEcVQF I6p6Qkezo72/76nC+kFW2JlagCJ4aJLKPp87SBIg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=default; bh=QO/M9yprr oqnxcNZNBqatj/fIe4=; b=gCrUArj+nYGIM3wBX+BVYxHf9ekxld4axkGMLR+cy QnekzMUImBmISOwEAw7kJwln/m/Y+sbsUxygYQ/bsCnsVFnHDdzv/nDXpQG0IWWd ThenpdhVM01LYUUYq7QHynpUkK+DO+wkk2GB+aysdd5HNBYUEnrJnLkD2DVZn21y WY= Received: (qmail 68501 invoked by alias); 5 Sep 2018 14:57:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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== 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, 5 Sep 2018 14:57:09 +0000 Message-Id: <20180905145732.404-7-rep.dot.nop@gmail.com> In-Reply-To: References: MIME-Version: 1.0 X-IsSubscribed: yes 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);