From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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, 01 Dec 2017 18:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1924B4F06020984C3E8BC960" X-SW-Source: 2017-12/txt/msg00061.txt.bz2 This is a multi-part message in MIME format. --------------1924B4F06020984C3E8BC960 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 437 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. --------------1924B4F06020984C3E8BC960 Content-Type: text/x-patch; name="p2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="p2.diff" Content-length: 892 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); --------------1924B4F06020984C3E8BC960 Content-Type: text/x-fortran; name="dependency_51.f90" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dependency_51.f90" Content-length: 393 ! { dg-do run } ! PR 83224 - dependency mishandling with an array constructor ! Original test case by Urban Jost program dusty_corner implicit none character(len=:),allocatable :: words(:) integer :: n words=[character(len=3) :: 'one', 'two'] n = 5 words=[character(len=n) :: words, 'three'] if (any(words /= [ "one ", "two ", "three"])) call abort end program dusty_corner --------------1924B4F06020984C3E8BC960--