From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1507 invoked by alias); 28 Jun 2012 15:42:49 -0000 Received: (qmail 1344 invoked by uid 22791); 28 Jun 2012 15:42:47 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED 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; Thu, 28 Jun 2012 15:42:34 +0000 From: "burnus 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: Thu, 28 Jun 2012 15:42: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: burnus 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: CC 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/msg01894.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53796 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #1 from Tobias Burnus 2012-06-28 15:42:32 UTC --- For comparison, for formatted and unformatted sequential, I get the following result with different compilers: NAG f95: 1024 / unformatted: 65536 Crayftn: 1024 / -1 (with int64 variable: 9223372036854775807) g95: 1000000000 / 1000000000 ifort 132 / 510 PGI -14920 (with int64 variable: 140737488340408) / as formatted gfortran -1 / -1 When exceeding an explicitly given RECL=: NAG f95: Buffer overflow on output g95: Writing more data than the record size (RECL) gfortran: End of record ifort: no error - but starts new record after recl is exceeded* crayftn: as ifort pgi: no error - but a single record* * For formatted; writing a longer string to unformatted will yield a single record. * * * gfortran has: ./libgfortran.h:#define DEFAULT_RECL 1073741824 which gets used with ./runtime/environ.c: {"GFORTRAN_DEFAULT_RECL", DEFAULT_RECL, &options.default_recl, and in io/unit.c's init_units for stdin, stdout and stderr. Others get set via io/open.c's new_unit: u->recl = opp->recl_in; And in transfer, one finds code like: /* For preconnected units with default record length, set bytes left to unit record length and proceed, otherwise error. */ ... && dtp->u.p.current_unit->recl == DEFAULT_RECL)) dtp->u.p.current_unit->bytes_left = dtp->u.p.current_unit->recl;