From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53431 invoked by alias); 19 Nov 2019 22:55:04 -0000 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 Received: (qmail 53412 invoked by uid 89); 19 Nov 2019 22:55:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=H*MI:sk:BA895BD, H*i:sk:BA895BD, H*f:sk:BA895BD, INTENT X-HELO: cc-smtpout2.netcologne.de Received: from cc-smtpout2.netcologne.de (HELO cc-smtpout2.netcologne.de) (89.1.8.212) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Nov 2019 22:55:02 +0000 Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout2.netcologne.de (Postfix) with ESMTP id 29B781284D; Tue, 19 Nov 2019 23:55:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netcologne.de; s=nc1116a; t=1574204100; bh=+yckNJwOF6kYXeR6gMTBfEAuJvKoEvKLEtfqwmYXeZw=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To:From; b=MyEsGHBYq+9gk4iKv5uhGhj59xHRjFauVoIwfc7LJAg+TAZ2IJaCrVSUyidNPY4UK 0Wk9jyKhxHPW9lGGZeY5VYG7f5bKO2eSk1uYBH9i85DnsqgPBQnCcEZ16bwCkz7EwF mP8xHHzl3dnRDc093SGGM4cqXOveiYlJ8b8XPwQuUf36IURknQlC8lhIExeijbtMyU gmXje/rx5aZLfo4h+NWX7kBJRwfqZHGECqTtftdD/HbBRgrN5RUG1JM5aI1/tKX6sF JsOEVzIzSyaN02o6o8wDC6crZw78XNHyN9kljnRyDpMao/gVWG2MBdasZW9Ocikb/E 4fYHYNOMkf2ww== Received: from localhost (localhost [127.0.0.1]) by cc-smtpin1.netcologne.de (Postfix) with ESMTP id 26B8111EE5; Tue, 19 Nov 2019 23:55:00 +0100 (CET) Received: from [2001:4dd6:1e9a:0:7285:c2ff:fe6c:992d] (helo=cc-smtpin1.netcologne.de) by localhost with ESMTP (eXpurgate 4.6.0) (envelope-from ) id 5dd472c4-5e31-7f0000012729-7f0000019fe8-1 for ; Tue, 19 Nov 2019 23:55:00 +0100 Received: from [IPv6:2001:4dd6:1e9a:0:7285:c2ff:fe6c:992d] (2001-4dd6-1e9a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2001:4dd6:1e9a:0:7285:c2ff:fe6c:992d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA; Tue, 19 Nov 2019 23:54:55 +0100 (CET) Subject: Re: [patch, fortran] Load scalar intent-in variables at the beginning of procedures To: Bernhard Reutner-Fischer , gcc-patches@gcc.gnu.org, =?UTF-8?Q?Thomas_K=c3=b6nig?= , Tobias Burnus , "fortran@gcc.gnu.org" References: <48286910-ebbb-10e4-488b-8c96e505375c@tkoenig.net> <43b9fcf0-f457-90a7-c807-4aebc65cb045@tkoenig.net> <2981fd67-007e-7327-8208-27e8fd18d9db@netcologne.de> From: Thomas Koenig Message-ID: <56a5680e-5e48-4d74-dfca-0a083aae8a3c@netcologne.de> Date: Tue, 19 Nov 2019 23:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2019-11/txt/msg01870.txt.bz2 Am 19.11.19 um 11:39 schrieb Bernhard Reutner-Fischer: > + char name[GFC_MAX_SYMBOL_LEN + 1]; > + snprintf (name, GFC_MAX_SYMBOL_LEN, "__dummy_%d_%s", var_num++, > + f->sym->name); > + > + if (gfc_get_sym_tree (name, ns, &symtree, false) != 0) > > (I) you should + sizeof(__dummy__) + 10 for unsigned long %d or the like. GFC_MAX_SYMBOL_LEN is the maximum length of a gfortran symbol. AFAIK, it is not possible to use a longer symbol name than that, so it needs to be truncated. Uniqueness of the variable name is guaranteed by the var_num variable. If the user puts dummy arguments Supercalifragilisticexpialidociousa and Supercalifragilisticexpialidociousb into the argument list of a procedure, he will have to look at the numbers to differentiate them :-) > (II) s/__dummy/__intent_in/ for clarity? It's moved away a bit from INTENT(IN) now, because an argument which cannot be modified (even by passing to a procedure with a dummy argument with unknown intent) is now also handled. Regards Thomas