From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10095 invoked by alias); 18 Feb 2018 16:18:00 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 10067 invoked by uid 89); 18 Feb 2018 16:17:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:2059 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; Sun, 18 Feb 2018 16:17:57 +0000 Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 03ABF134C0; Sun, 18 Feb 2018 17:17:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin2.netcologne.de (Postfix) with ESMTP id EB29E11DF8; Sun, 18 Feb 2018 17:17:54 +0100 (CET) Received: from [78.35.153.101] (helo=cc-smtpin2.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.9) (envelope-from ) id 5a89a732-02b8-7f0000012729-7f000001a8fd-1 for ; Sun, 18 Feb 2018 17:17:54 +0100 Received: from [192.168.178.20] (xdsl-78-35-153-101.netcologne.de [78.35.153.101]) (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; Sun, 18 Feb 2018 17:17:53 +0100 (CET) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, fortran] Remove workaround introduced because of PR80945 Message-ID: <60f8791a-aca6-4c3e-bd90-a0a4bda8670d@netcologne.de> Date: Sun, 18 Feb 2018 16:18:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------6A039EEC729B888C61B0094B" X-SW-Source: 2018-02/txt/msg00127.txt.bz2 This is a multi-part message in MIME format. --------------6A039EEC729B888C61B0094B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 629 Hello world, after Paul's fix for PR80945, the code in frontend-passes.c meant to circumvent this bug is no longer needed. The attached patch removes it, adding a test case which shows that the optimization is working. After this, I think we can finally lay PR 35339 to rest. Regression-tested. OK for trunk? Regards Thomas 2018-02-18 Thomas Koenig PR fortran/35339 * frontend-passes.c (traverse_io_block): Remove workaround for PR 80945. 2018-02-18 Thomas Koenig PR fortran/35339 * gfortran.dg/implied_do_io_4.f90: New test. --------------6A039EEC729B888C61B0094B Content-Type: text/x-patch; name="p1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="p1.diff" Content-length: 729 Index: frontend-passes.c =================================================================== --- frontend-passes.c (Revision 257788) +++ frontend-passes.c (Arbeitskopie) @@ -1162,14 +1162,7 @@ traverse_io_block (gfc_code *code, bool *has_reach gcc_assert (curr->op == EXEC_TRANSFER); - /* FIXME: Workaround for PR 80945 - array slices with deferred character - lenghts do not work. Remove this section when the PR is fixed. */ e = curr->expr1; - if (e->expr_type == EXPR_VARIABLE && e->ts.type == BT_CHARACTER - && e->ts.deferred) - return false; - /* End of section to be removed. */ - ref = e->ref; if (!ref || ref->type != REF_ARRAY || ref->u.ar.codimen != 0 || ref->next) return false; --------------6A039EEC729B888C61B0094B Content-Type: text/x-fortran; name="implied_do_io_4.f90" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="implied_do_io_4.f90" Content-length: 774 ! { dg-do run } ! { dg-additional-options "-ffrontend-optimize -fdump-tree-original" } ! PR fortran/35339 - make sure that I/O of an implied DO loop ! of allocatable character arrays a) works and b) is converted ! to a transfer_array program main implicit none integer:: i integer, parameter:: N = 10 character(len=:), dimension(:),allocatable:: ca allocate(character(len=N):: ca(3)) open(unit=10,status="scratch") ca(1) = "foo" ca(2) = "bar" ca(3) = "xyzzy" write (10, '(3A10)') (ca(i),i=1,3) rewind (10) ca(:) = '' read (10, '(3A10)') (ca(i),i=1,3) if (ca(1) /= 'foo' .or. ca(2) /= 'bar' .or. ca(3) /= 'xyzzy') call abort end program ! { dg-final { scan-tree-dump-times "_gfortran_transfer_array" 2 "original" } } --------------6A039EEC729B888C61B0094B--