From patchwork Sat Nov 18 10:34:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janne Blomqvist X-Patchwork-Id: 839239 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-467283-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="Dr0mtdMa"; 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 3yfBDq6F0Zz9ryk for ; Sat, 18 Nov 2017 21:34:34 +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:from :to:cc:subject:date:message-id; q=dns; s=default; b=XA9h5EsCNDB9 PjDrzIydWPQbE1h6QGL2t0Z60hqB4f0iWHfj1NEwlD3K2zWrmuRC8mTmWOl+9DEA 4TktFuYy6KbjxZX7rzPcooa+ipmCpwv2AwKNWzDoEs1xnxm571zOEnzCgeTjEQus BN3ULWSiJMQmne+MNHZtn2bjGx/hwIE= 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:from :to:cc:subject:date:message-id; s=default; bh=pwfYcpa9QhwIHyejt4 2vkOrJeiA=; b=Dr0mtdMade3J9JdIjl2eA2NNN6ERKEbjP8ZCZ2ulQVDByMERwR Aci2AGhnOFzvmZG9wSUtv7QRWIgx45RrpvhTzwYTOCnPC3JGLXHDdHsFZ/AQYM6p GprNrHwernv78ZMBgh1H+zppOoXXxPHAb546w9ijbxHs/ddVkArrVP4SM= Received: (qmail 42211 invoked by alias); 18 Nov 2017 10:34:23 -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 42190 invoked by uid 89); 18 Nov 2017 10:34:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:Sat, rec X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-lf0-f67.google.com Received: from mail-lf0-f67.google.com (HELO mail-lf0-f67.google.com) (209.85.215.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 18 Nov 2017 10:34:20 +0000 Received: by mail-lf0-f67.google.com with SMTP id k66so5274776lfg.3; Sat, 18 Nov 2017 02:34:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IgyFOtOVwMlniGjNnbUnwfITIm0TdWrdbGkWN5nmB/Q=; b=aZZSEvY+SOrkPDOVbZmX4pJ72PbIoCVjdvfWqzaAvOX8YHJWW08+EPGjZUtCmPb8Oc 5XazwqBTqAO4c+9RdVEE8f0Zu4lOpZmeNz6yd2Ywx5453gUQQukPO383h/NPpVN6rXAU zAhQrdoRrxpjRYObRgrFuy6AShGHejONMCS3mVFGiscch5CStxc++V8/1APdvvSoEdWW PfwXdnazssOwVORfQ01wGqXR1ovrjXll2VjhM3x2vwROTj0IJbIVc3lejN2EvK6b4ZJM OVVfcqDBPJJ+pnyiJVNoKc9lmEUiVS1QYoZMyuDTOrZ12CDf2shAt2oki86/Jz9FNGpr XrtQ== X-Gm-Message-State: AJaThX4wqRabCtmCIwpvNaMkqMPnEO/lco/F7HhKTQTIDnNolD6XO5ne IWe5ylSPgIriAgMHTiy/dW4fbw== X-Google-Smtp-Source: AGs4zMbOx5CHhHHndgr0PL8JDG1ujAUR7QDKe92DNdZJkaE5h1oKh+6oJ3E16N4T3sLPuQ/Knyrn+w== X-Received: by 10.25.142.5 with SMTP id q5mr1715174lfd.19.1511001258370; Sat, 18 Nov 2017 02:34:18 -0800 (PST) Received: from dt.lan (a88-114-247-254.elisa-laajakaista.fi. [88.114.247.254]) by smtp.gmail.com with ESMTPSA id o86sm1376999lja.2.2017.11.18.02.34.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 02:34:17 -0800 (PST) From: Janne Blomqvist To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Janne Blomqvist Subject: [PATCH] Make NEXTREC specifier for INQUIRE work for large record numbers Date: Sat, 18 Nov 2017 12:34:10 +0200 Message-Id: <1511001250-27383-1-git-send-email-blomqvist.janne@gmail.com> This is accomplished by making the NEXTREC specifier be a 8 byte integer where supported. I wasn't able to come up with a testcase that does not create a large file that could be added to the testsuite, but here's one which creates a 2 GB file: program nextrec implicit none integer(8) :: ii, n open(10, file="foo.dat", recl=1, access="direct", form="unformatted", status="replace") do ii = 1, huge(1) + 2_8 write(10, rec=ii) 'a' end do inquire(10, nextrec=n) if (n /= huge(1) + 2_8) then call abort() end if close(10, status="delete") end program nextrec Regtested on x86_64-pc-linux-gnu, Ok for trunk? gcc/fortran/ChangeLog: 2017-11-18 Janne Blomqvist PR fortran/83036 * ioparm.def (IOPARM): Make nextrec a pintio. libgfortran/ChangeLog: 2017-11-18 Janne Blomqvist PR fortran/83036 * io/io.h: Make nextrec a GFC_IO_INT*. --- gcc/fortran/ioparm.def | 2 +- libgfortran/io/io.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/ioparm.def b/gcc/fortran/ioparm.def index ca5631b..920934a 100644 --- a/gcc/fortran/ioparm.def +++ b/gcc/fortran/ioparm.def @@ -62,7 +62,7 @@ IOPARM (inquire, exist, 1 << 7, pint4) IOPARM (inquire, opened, 1 << 8, pint4) IOPARM (inquire, number, 1 << 9, pint4) IOPARM (inquire, named, 1 << 10, pint4) -IOPARM (inquire, nextrec, 1 << 11, pint4) +IOPARM (inquire, nextrec, 1 << 11, pintio) IOPARM (inquire, recl_out, 1 << 12, pint4) IOPARM (inquire, strm_pos_out, 1 << 13, pintio) IOPARM (inquire, file, 1 << 14, char1) diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index df49157..483ee93 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -388,7 +388,8 @@ typedef struct { st_parameter_common common; GFC_INTEGER_4 *exist, *opened, *number, *named; - GFC_INTEGER_4 *nextrec, *recl_out; + GFC_IO_INT *nextrec; + GFC_INTEGER_4 *recl_out; GFC_IO_INT *strm_pos_out; CHARACTER1 (file); CHARACTER2 (access);