From patchwork Wed Sep 5 14:57:20 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: 966449 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-485246-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="KrnEIwin"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pMChUuHx"; 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 4256VK59RCz9s5c for ; Thu, 6 Sep 2018 01:06:32 +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=lYL 0SHLM8FmBgIc1BH4S96Ni7Ru3vw2KMmzi+6cVMk+h+bSPnwFgig4aojK+HTtHuyv /8Jnn/0D/dYlUTQ5osaORq7oByuBKKd1L7aHPXNmFYvITkbx83latjHinzbv2gUS 8C3FzLMgIm33qKhj6MOy5quNctbHLhnnDW9EfNbE= 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=29erUxdRF Zf1FxagkTElYRFEWg0=; b=KrnEIwinDEPBhgn1/uGd2Qlqn+dBUAW12wGfvWETh mR4hQpJiK7RLYourVcTsQIazPGxXSh5Y+KtYZRgNZWtDZnskPk9VE5AJYo8qtxqY kdw7xxrotESSI0QclTesZLvNFXVwDVQRh9Imohr7i9EnIOcF4dt2FywYJ6+GNy86 PM= Received: (qmail 102817 invoked by alias); 5 Sep 2018 15:02:50 -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 102652 invoked by uid 89); 5 Sep 2018 15:02:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.8 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= X-HELO: mail-wm0-f53.google.com Received: from mail-wm0-f53.google.com (HELO mail-wm0-f53.google.com) (74.125.82.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Sep 2018 15:02:48 +0000 Received: by mail-wm0-f53.google.com with SMTP id n11-v6so8077148wmc.2; Wed, 05 Sep 2018 08:02:47 -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=wTl/pOKRnBBXO0Tz9iv3IuPQUxrjuxL/fOKa0qFHxKo=; b=pMChUuHx4Po2VsBJiHY99CLb0vqV80MWHbfzuP6hMzu8HbsnZOgvTl9EqImACvPAby XA2lknCZnriCuBEI1zPdSJFYd5G5qebe8APjzGTTLdAGZ2L0m4XScMbHPTL0AlqK07gX Nj+b82eP+XiJYUZ+KMbq13zBM2pius6ifngL8JQFwnTFvyd3mBMvxTt51ldcEcrMtYwU FVBdmmlBkrSHqnQ7Ym4wGYlPXt2pri7+NB/I8T/fs4R6/TjeyG2gARyDMplNmq4AKPem 48VJHTrY5uePOGAQMqkhA6TEMKa3on33+jrWzmU+NOCzlf1LlVBVrRTcNG54J6mouMJk e3Dg== Received: from s46.loc (91-119-125-11.dsl.dynamic.surfer.at. [91.119.125.11]) by smtp.gmail.com with ESMTPSA id h10-v6sm3302783wmf.44.2018.09.05.08.02.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Sep 2018 08:02:45 -0700 (PDT) Received: from cow by s46.loc with local (Exim 4.91) (envelope-from ) id 1fxZFa-000083-3B; Wed, 05 Sep 2018 14:57:46 +0000 From: Bernhard Reutner-Fischer To: fortran@gcc.gnu.org Cc: Bernhard Reutner-Fischer , gcc-patches@gcc.gnu.org Subject: [PATCH,FORTRAN 17/29] Use stringpool for iso_fortran_env Date: Wed, 5 Sep 2018 14:57:20 +0000 Message-Id: <20180905145732.404-18-rep.dot.nop@gmail.com> In-Reply-To: References: MIME-Version: 1.0 X-IsSubscribed: yes From: Bernhard Reutner-Fischer gcc/fortran/ChangeLog: 2017-11-23 Bernhard Reutner-Fischer * module.c (use_iso_fortran_env_module): Use stringpool and use pointer comparison instead of strcmp. --- gcc/fortran/module.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index d7bc7fbef1c..3b644234921 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -6678,7 +6678,7 @@ read_module_to_tmpbuf () static void use_iso_fortran_env_module (void) { - static char mod[] = "iso_fortran_env"; + const char *mod = gfc_get_string ("%s", "iso_fortran_env"); gfc_use_rename *u; gfc_symbol *mod_sym; gfc_symtree *mod_symtree; @@ -6686,11 +6686,11 @@ use_iso_fortran_env_module (void) int i, j; intmod_sym symbol[] = { -#define NAMED_INTCST(a,b,c,d) { a, b, 0, d }, -#define NAMED_KINDARRAY(a,b,c,d) { a, b, 0, d }, -#define NAMED_DERIVED_TYPE(a,b,c,d) { a, b, 0, d }, -#define NAMED_FUNCTION(a,b,c,d) { a, b, c, d }, -#define NAMED_SUBROUTINE(a,b,c,d) { a, b, c, d }, +#define NAMED_INTCST(a,b,c,d) { a, gfc_get_string ("%s", b), 0, d }, +#define NAMED_KINDARRAY(a,b,c,d) { a, gfc_get_string ("%s", b), 0, d }, +#define NAMED_DERIVED_TYPE(a,b,c,d) { a, gfc_get_string ("%s", b), 0, d }, +#define NAMED_FUNCTION(a,b,c,d) { a, gfc_get_string ("%s", b), c, d }, +#define NAMED_SUBROUTINE(a,b,c,d) { a, gfc_get_string ("%s", b), c, d }, #include "iso-fortran-env.def" { ISOFORTRANENV_INVALID, NULL, -1234, 0 } }; @@ -6708,7 +6708,7 @@ use_iso_fortran_env_module (void) mod_sym->attr.flavor = FL_MODULE; mod_sym->attr.intrinsic = 1; - mod_sym->module = gfc_get_string ("%s", mod); + mod_sym->module = mod; mod_sym->from_intmod = INTMOD_ISO_FORTRAN_ENV; } else @@ -6723,7 +6723,7 @@ use_iso_fortran_env_module (void) bool found = false; for (u = gfc_rename_list; u; u = u->next) { - if (strcmp (symbol[i].name, u->use_name) == 0) + if (symbol[i].name == u->use_name) { found = true; u->found = 1;