From patchwork Wed Sep 5 14:57:10 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: 966426 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-485223-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="eFhc6aco"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F4Fa3cJe"; 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 4256Kz3m12z9sCn for ; Thu, 6 Sep 2018 00:59:19 +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=Beh y6kXrcyS3m//mTp9WHJ83YulKdxKTaCSMDKFGjE14WHL82HFeKgGT3E+4N8yxbQB XdQWzjwlb/f/CLWuOabd8YMgbHtnZBch4ETkOUZ4PHs0pAEGEvACu0hnxMRjBz8T hVe4FBAkFgtP+CjcgxQZK9jkH21kQV4pZOghVUsE= 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=h99i5xCvJ W68Sm5/3XbyuIWHX/s=; b=eFhc6aco00OQZuvmgtqr1fR+ydfyLvVJwSvK/B2lH 4l+b6Q+biu0AKZCPN7pA5UpeTDt9MuUd44NVRZ2/t8MTNxDRgQ1Zs6adlC9jkZ09 XHtCV5qM9AUa/L0AK7S4kihCUu53DRT5qmVHmvAG028Mx/A/2ZA12nh9hn5qnvCQ N4= Received: (qmail 68357 invoked by alias); 5 Sep 2018 14:57:53 -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 68058 invoked by uid 89); 5 Sep 2018 14:57:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 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=H*Ad:U*aldot, HContent-Transfer-Encoding:8bit X-HELO: mail-wr1-f52.google.com Received: from mail-wr1-f52.google.com (HELO mail-wr1-f52.google.com) (209.85.221.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Sep 2018 14:57:49 +0000 Received: by mail-wr1-f52.google.com with SMTP id a108-v6so7956255wrc.13; 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=2hVyzFEegswvhab18QLj7jCaMRhLv58BnbCRL/0ik+Q=; b=F4Fa3cJeWkSyFXGf8xlL8mpmoUl4JYzdh6ZShNHPn94hUaEnrR5OXyE3DL26Z/xvd8 BqPz5zIMT/mRiRC2USKRnqdNDDR/G7RWbcxuLUfWY2SQPX89154sJhLmR4dGGyAOnmE/ wTAeef2/tLCbD3QQpbhNor/bIZ9xfiDiIwfOtkeSRET7EbzNfxGb9e3cmf96T+WGim4j CS61VUb2jsK//maSU2UaR0OTIxPH8yXWdsPHHHtX5BHkZnndoTQF7xqz5C5ZV3dxkkvL +/iiCHIzzilekwOiWWxlEUooQCLOCye19XlR7LITHtzqgI4X2NlM5g5qKYAlI30tfIcQ ixew== Received: from s46.loc (91-119-125-11.dsl.dynamic.surfer.at. [91.119.125.11]) by smtp.gmail.com with ESMTPSA id o33-v6sm2948820wrf.11.2018.09.05.07.57.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Sep 2018 07:57:47 -0700 (PDT) Received: from cow by s46.loc with local (Exim 4.91) (envelope-from ) id 1fxZFY-00007Z-9X; 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 07/29] Use stringpool for some gfc_code2string return values Date: Wed, 5 Sep 2018 14:57:10 +0000 Message-Id: <20180905145732.404-8-rep.dot.nop@gmail.com> In-Reply-To: References: MIME-Version: 1.0 X-IsSubscribed: yes From: Bernhard Reutner-Fischer Use a stringpool-node for those gfc_code2string values that are used as names. gcc/fortran/ChangeLog: 2017-10-26 Bernhard Reutner-Fischer * interface.c (gfc_match_generic_spec, gfc_check_dtio_interfaces, gfc_find_typebound_dtio_proc, gfc_find_specific_dtio_proc): Use stringpool node for those return values of gfc_code2string that are used as names. --- gcc/fortran/interface.c | 50 ++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 19a0eb28edd..8716813b7b2 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -182,12 +182,12 @@ gfc_match_generic_spec (interface_type *type, *op = dtio_op (name); if (*op == INTRINSIC_FORMATTED) { - name = gfc_code2string (dtio_procs, DTIO_RF); + name = gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_RF)); *type = INTERFACE_DTIO; } if (*op == INTRINSIC_UNFORMATTED) { - name = gfc_code2string (dtio_procs, DTIO_RUF); + name = gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_RUF)); *type = INTERFACE_DTIO; } if (*op != INTRINSIC_NONE) @@ -199,12 +199,12 @@ gfc_match_generic_spec (interface_type *type, *op = dtio_op (name); if (*op == INTRINSIC_FORMATTED) { - name = gfc_code2string (dtio_procs, DTIO_WF); + name = gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_WF)); *type = INTERFACE_DTIO; } if (*op == INTRINSIC_UNFORMATTED) { - name = gfc_code2string (dtio_procs, DTIO_WUF); + name = gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_WUF)); *type = INTERFACE_DTIO; } if (*op != INTRINSIC_NONE) @@ -4927,8 +4927,8 @@ gfc_check_dtio_interfaces (gfc_symbol *derived) || ((dtio_codes)code == DTIO_WF); tb_io_st = gfc_find_typebound_proc (derived, &t, - gfc_code2string (dtio_procs, code), - true, &derived->declared_at); + gfc_get_string ("%s", gfc_code2string (dtio_procs, code)), + true, &derived->declared_at); if (tb_io_st != NULL) check_dtio_interface1 (derived, tb_io_st, true, formatted, code); } @@ -4940,7 +4940,7 @@ gfc_check_dtio_interfaces (gfc_symbol *derived) || ((dtio_codes)code == DTIO_WF); tb_io_st = gfc_find_symtree (derived->ns->sym_root, - gfc_code2string (dtio_procs, code)); + gfc_get_string ("%s", gfc_code2string (dtio_procs, code))); if (tb_io_st != NULL) check_dtio_interface1 (derived, tb_io_st, false, formatted, code); } @@ -4961,31 +4961,23 @@ gfc_find_typebound_dtio_proc (gfc_symbol *derived, bool write, bool formatted) { if (write == true) tb_io_st = gfc_find_typebound_proc (derived, &t, - gfc_code2string (dtio_procs, - DTIO_WF), - true, - &derived->declared_at); + gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_WF)), + true, &derived->declared_at); else tb_io_st = gfc_find_typebound_proc (derived, &t, - gfc_code2string (dtio_procs, - DTIO_RF), - true, - &derived->declared_at); + gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_RF)), + true, &derived->declared_at); } else { if (write == true) tb_io_st = gfc_find_typebound_proc (derived, &t, - gfc_code2string (dtio_procs, - DTIO_WUF), - true, - &derived->declared_at); + gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_WUF)), + true, &derived->declared_at); else tb_io_st = gfc_find_typebound_proc (derived, &t, - gfc_code2string (dtio_procs, - DTIO_RUF), - true, - &derived->declared_at); + gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_RUF)), + true, &derived->declared_at); } return tb_io_st; } @@ -5041,23 +5033,19 @@ gfc_find_specific_dtio_proc (gfc_symbol *derived, bool write, bool formatted) { if (write == true) tb_io_st = gfc_find_symtree (extended->ns->sym_root, - gfc_code2string (dtio_procs, - DTIO_WF)); + gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_WF))); else tb_io_st = gfc_find_symtree (extended->ns->sym_root, - gfc_code2string (dtio_procs, - DTIO_RF)); + gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_RF))); } else { if (write == true) tb_io_st = gfc_find_symtree (extended->ns->sym_root, - gfc_code2string (dtio_procs, - DTIO_WUF)); + gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_WUF))); else tb_io_st = gfc_find_symtree (extended->ns->sym_root, - gfc_code2string (dtio_procs, - DTIO_RUF)); + gfc_get_string ("%s", gfc_code2string (dtio_procs, DTIO_RUF))); } if (tb_io_st != NULL