From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6328 invoked by alias); 30 Jun 2012 00:32:45 -0000 Received: (qmail 6319 invoked by uid 22791); 30 Jun 2012 00:32:44 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_JV X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 30 Jun 2012 00:32:29 +0000 From: "jvdelisle at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/53796] I/O INQUIRE of RECL: If not specified in OPEN, the default value should be returned (sequential access) Date: Sat, 30 Jun 2012 00:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-06/txt/msg02001.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53796 --- Comment #10 from Jerry DeLisle 2012-06-30 00:32:29 UTC --- For completeness, in the case I give in Comment #9, I get Operating system error: Cannot allocate memory Memory allocation failed I have instrumented a few places to see what we are getting with the original test case included here: integer(kind=8) :: s, r open(unit=1, file='testsize.f90', status='old') inquire(unit=1, size=s, recl=r) print *, 'size=', s, ' recl=', r end And I get: $ ./a.out In init_units() max_offset set to 4294967295 In newunit(): 4294967295 Ping! recl=4294967295 size= 135 recl= -1 This confirms that we are setting the unit recl to a large number which is printed as -1 when using signed output, but unsigned is what we might expect. max_offset is calculated at run time as follows: /* Calculate the maximum file offset in a portable manner. max will be the largest signed number for the type gfc_offset. set a 1 in the LSB and keep a running sum, stopping at MSB-1 bit. */ max_offset = 0; for (i = 0; i < sizeof (max_offset) * 8 - 1; i++) max_offset = max_offset + ((gfc_offset) 1 << i); printf("max_offset set to %u\n", max_offset); I think we can decide what to do differently after we get Comment #7 feedback. In the meantime, I will be looking at what we are doing wrong in the case of Comment #9, maybe a separate bug.