From patchwork Thu Jun 20 12:03:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 1119408 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-503354-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=netcologne.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="xOs6NFR0"; dkim=pass (2048-bit key; unprotected) header.d=netcologne.de header.i=@netcologne.de header.b="Dxq6TDh3"; 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 45V0pY4tRcz9s4Y for ; Thu, 20 Jun 2019 22:03:48 +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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=HxVzw1Bz/UOEchyOzoZoPF62KOfx5MCt1gJlcOk4jZQDtQZYFI wLa+GuwwFLyHvlfqh/JBjqLPqyArVRJEdo3+RUEXUWdgr8OlC5bx1Q8UhzuGOIUv KhWM9xoJntu4b88BhjqoJaAWUVO5ld4icC0W2/2nrm8FuQSPrVTOPL0ZY= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=IC1T3TxwHxT+8jz1CBfcsfFQvgw=; b=xOs6NFR0JN3AyCcAkAZu 9T4jR2KoauW+iuYufu3KaMxtVGehJI/rf3Z3q09s2q1l++ts2OrRgDq//fDfQ6i+ /nJzj8qqWyHi2GRZs7HnaiZ7xNUdNnUVoPjYfLLr5gMqNuWYWukKAdWnYC9E3qxc gY2gie4H/oe/34JcgvuzRWw= Received: (qmail 6889 invoked by alias); 20 Jun 2019 12:03:42 -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 6434 invoked by uid 89); 20 Jun 2019 12:03:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=tstype, ts.type, UD:ts.type X-HELO: cc-smtpout1.netcologne.de Received: from cc-smtpout1.netcologne.de (HELO cc-smtpout1.netcologne.de) (89.1.8.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Jun 2019 12:03:39 +0000 Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 48B7B127C2; Thu, 20 Jun 2019 14:03:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netcologne.de; s=nc1116a; t=1561032209; bh=XfVlrcwBKZiO3IwKU/TdaWuR6h4YDWq0SL6mL+Mb6iQ=; h=To:From:Subject:Message-ID:Date:From; b=Dxq6TDh3NtYfkx0Cv/7QHlsx0RNvlg+6nwb/+TqJHyNu/xOCA+n2YYTMVo9SKeKX+ EN3UWSQJKh6qb40/b+4cvZevujf1fFLX5gWURT9nXIqrz08mTlXVSAl/8F/Fngyn5Y QDSb45+OJmi19lwdOLkDHmgFe/k3o4rSrD30U6W6EA4R2j/n2s9iL4dUfAIL4hqR8F kzbkSrZfD99KywKABUixmItVyXcKO9nklulBmKDofxVk7siOAJdma9KSpqkbHQsH9d WOjm1o8B/qpFri/n/atvTy36jgqrdrmqEDqcdb94szuG1F4yafm4c3Kp9kVtgzquru Klp8UhoSGpSJw== Received: from localhost (localhost [127.0.0.1]) by cc-smtpin1.netcologne.de (Postfix) with ESMTP id 44E5411E9F; Thu, 20 Jun 2019 14:03:29 +0200 (CEST) Received: from [2001:4dd7:7e7b:0:7285:c2ff:fe6c:992d] (helo=cc-smtpin1.netcologne.de) by localhost with ESMTP (eXpurgate 4.6.0) (envelope-from ) id 5d0b7611-1e16-7f0000012729-7f0000019aec-1 for ; Thu, 20 Jun 2019 14:03:29 +0200 Received: from [IPv6:2001:4dd7:7e7b:0:7285:c2ff:fe6c:992d] (2001-4dd7-7e7b-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2001:4dd7:7e7b: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; Thu, 20 Jun 2019 14:03:26 +0200 (CEST) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, committed] Fix for PR 90937 Message-ID: Date: Thu, 20 Jun 2019 14:03:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 Hello world, I have committed the attached patch to trunk as obvious to fix another of the regressions stemming from the "make up formal from actual arglist" patch, as obvious and simple. I will backport this patch to the other affected branches, probably over the weekend. Regards Thomas 2019-06-20 Thomas Koenig PR fortran/90937 * trans-types.c (get_formal_from_actual_arglist): Get symbol from current namespace so it will be freed later. If symbol is of type character, get an empty character length. 2019-06-20 Thomas Koenig PR fortran/90937 * gfortran.dg/external_procedure_4.f90: New test. Index: trans-types.c =================================================================== --- trans-types.c (Revision 272479) +++ trans-types.c (Arbeitskopie) @@ -2997,7 +2997,7 @@ get_formal_from_actual_arglist (gfc_symbol *sym, g if (a->expr) { snprintf (name, GFC_MAX_SYMBOL_LEN, "_formal_%d", var_num ++); - gfc_get_symbol (name, NULL, &s); + gfc_get_symbol (name, gfc_current_ns, &s); if (a->expr->ts.type == BT_PROCEDURE) { s->attr.flavor = FL_PROCEDURE; @@ -3005,6 +3005,10 @@ get_formal_from_actual_arglist (gfc_symbol *sym, g else { s->ts = a->expr->ts; + + if (s->ts.type == BT_CHARACTER) + s->ts.u.cl = gfc_get_charlen (); + s->ts.deferred = 0; s->ts.is_iso_c = 0; s->ts.is_c_interop = 0;