From patchwork Mon Dec 16 15:15:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Dominique_d=27Humi=C3=A8res?= X-Patchwork-Id: 301746 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 95DC82C007B for ; Tue, 17 Dec 2013 02:15:22 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :to:cc:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= acSrR/a4+mgMxUvT3W/FguvYTKyrq6Wk0ZErSmi4dRRUbbLQF0S/inGnXjFeS4bX mfCklY7nRqMXodzgOE3F+8cR3Azpj3PgbMsvyVGzFQqrDGsBxF5ejH213qQDLWys KZzXtsBfNSOZo4c4rymXWaIRFDUU1bQ8qVce5Pn3kV4= 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:date :to:cc:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=PDUfvF POtqK0wFT/DVFb+GBJkns=; b=BMCO+S434P1SKLEFissrJ7iszzeHpan4KvhaaA d90ZLmxPswozOew5sX1sxiPWmc+CbuJ3WHqByl9Epb3XeLwiF6GxyKlnS3I6/G2B HhzgbUPmP+pdyZHBC6PcJF0NHgnvW8MI2IcVblhyoVssg/J/LodxosRAKskInfG5 C9zqw= Received: (qmail 17254 invoked by alias); 16 Dec 2013 15:15:09 -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 17231 invoked by uid 89); 16 Dec 2013 15:15:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: nef2.ens.fr Received: from nef2.ens.fr (HELO nef2.ens.fr) (129.199.96.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Dec 2013 15:15:05 +0000 Received: from mailhost.lps.ens.fr (tournesol.lps.ens.fr [129.199.120.1]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id rBGFF28J046205 ; Mon, 16 Dec 2013 16:15:02 +0100 (CET) X-Envelope-To: gcc-patches@gcc.gnu.org Received: from localhost (localhost [127.0.0.1]) by mailhost.lps.ens.fr (Postfix) with ESMTP id 20EEAF7; Mon, 16 Dec 2013 16:15:02 +0100 (CET) Received: from mailhost.lps.ens.fr ([127.0.0.1]) by localhost (tournesol.lps.ens.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j9XISKoLcdgC; Mon, 16 Dec 2013 16:15:02 +0100 (CET) Received: by mailhost.lps.ens.fr (Postfix, from userid 8513) id 106E2104; Mon, 16 Dec 2013 16:15:02 +0100 (CET) Date: Mon, 16 Dec 2013 16:15:02 +0100 To: jvdelisle@gcc.gnu Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org, burnus@net-b.de Subject: Re: [patch, libgfortran] PR59419 Failing OPEN with FILE='xxx' and IOSTAT creates the file 'xxx' User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-Id: <20131216151502.106E2104@mailhost.lps.ens.fr> From: dominiq@lps.ens.fr (Dominique Dhumieres) Hi Jerry, Glad to see you back! I stumbled on this pr while trying to clean the files left after the tests (see http://gcc.gnu.org/ml/fortran/2013-10/msg00083.html, note that gfortran.dg/c_loc_test_22.f90 has already been applied). I have a pending patch cleaning the remaining files; the full cleaning being blocked by the pr. With your patch 2 out of 3 files no longer appear. The last one is due to gfortran.dg/open_negative_unit_1.f90 because foo.txt is not deleted after the second open. I think this is the intended behavior and I propose the following patch: The first part check that foo.txt exists and delete it. The inquire checks that the file is not created again. The test regtest with your patch and abort without it. > I will conjure up a test case for this. Unless you have already such a test, I think the above will be enough. Cheers, Dominique PS Could you please have a look at pr48906 comment 40? I have the impression that it is fixed and IMO if some issues remain, it would probably better to open new PR for them. --- ../_clean//gcc/testsuite/gfortran.dg/open_negative_unit_1.f90 2013-03-20 09:20:18.000000000 +0100 +++ gcc/testsuite/gfortran.dg/open_negative_unit_1.f90 2013-12-16 15:51:33.000000000 +0100 @@ -6,6 +6,7 @@ program nutest implicit none + logical l integer id, ios open(newunit=id, file="foo.txt", iostat=ios) @@ -16,6 +17,14 @@ program nutest close(id, status="delete") + open(unit=10, file="foo.txt", status="old", iostat=ios) + if (ios /= 0) call abort + + close(10, status="delete") + open(-10, file="foo.txt", iostat=ios) if (ios == 0) call abort + + inquire(file="foo.txt", exist=l) + if (l) call abort end program nutest