From patchwork Fri Dec 1 18:06:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 843644 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-468358-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="vQAT9pOj"; 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 3ypMgG5bTwz9t2x for ; Sat, 2 Dec 2017 05:07:22 +1100 (AEDT) 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=u9fZ/q1zSMOoaIKUxUeo7t8t4pUt7cswASOj0JKqu3PvCUtDq5 wkqWFyJSMKpaYKTpcHjA9mLJJjhNzLH2qVyjlgphMYC5puNoVtSh+D1UM2Uaphyz 2izvpXlNya3AzyXieR2pPGQkkahkht5E9MSgEfzS+L0FX+EeRhTobhdOM= 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=KRRK/uR4dnPgGkGVzB62rMGbZrM=; b=vQAT9pOjtBt3SW40gq9M 8VnvcJEow5K8nveV4difil63K3BEBcTbK/S0kOiUAy7vUAuTW3cIa55D2UbGlyIJ WrWFq1izHQrHEV1PC5zTn+x8TMgeMqioNcv0UvHbwQ3PHYUnRm693TYUtqowF5Vv ZSWwXCEe7r1X90zrfzKp5yY= Received: (qmail 89082 invoked by alias); 1 Dec 2017 18:07:06 -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 89060 invoked by uid 89); 1 Dec 2017 18:07:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients 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; Fri, 01 Dec 2017 18:07:03 +0000 Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 775BB1349B; Fri, 1 Dec 2017 19:06:59 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin2.netcologne.de (Postfix) with ESMTP id 73BE211DFE; Fri, 1 Dec 2017 19:06:59 +0100 (CET) Received: from [78.35.131.21] (helo=cc-smtpin2.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.9) (envelope-from ) id 5a219a43-02b8-7f0000012729-7f000001d1d1-1 for ; Fri, 01 Dec 2017 19:06:59 +0100 Received: from [192.168.178.20] (xdsl-78-35-131-21.netcologne.de [78.35.131.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA; Fri, 1 Dec 2017 19:06:57 +0100 (CET) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, fortran, committed] Fix part 2 of PR 83224 Message-ID: Date: Fri, 1 Dec 2017 19:06:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Hello world, I have committed the fix for the second part (and original test case) of PR 83224 as obvious after regression-testing as r255331. Regards Thomas 2017-12-01 Thomas Koenig PR fortran/83224 * frontend-passes.c (create_var): Also handle character arrays, handling deferred lenghts. 2017-12-01 Thomas Koenig PR fortran/83224 * gfortran.dg/dependency_51.f90: New test. Index: frontend-passes.c =================================================================== --- frontend-passes.c (Revision 255294) +++ frontend-passes.c (Arbeitskopie) @@ -767,7 +767,7 @@ create_var (gfc_expr * e, const char *vname) } deferred = 0; - if (e->ts.type == BT_CHARACTER && e->rank == 0) + if (e->ts.type == BT_CHARACTER) { gfc_expr *length; @@ -778,6 +778,8 @@ create_var (gfc_expr * e, const char *vname) else { symbol->attr.allocatable = 1; + symbol->ts.u.cl->length = NULL; + symbol->ts.deferred = 1; deferred = 1; } } @@ -790,7 +792,7 @@ create_var (gfc_expr * e, const char *vname) result = gfc_get_expr (); result->expr_type = EXPR_VARIABLE; - result->ts = e->ts; + result->ts = symbol->ts; result->ts.deferred = deferred; result->rank = e->rank; result->shape = gfc_copy_shape (e->shape, e->rank);