From patchwork Sun Oct 30 20:21:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry DeLisle X-Patchwork-Id: 689053 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 3t6TSL1VnBz9t1b for ; Mon, 31 Oct 2016 07:22:25 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=l111cWOO; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=FEvc4vFHkOs8PKcM4rY2KSt/0RzQUF2QWmIxvzgl9Gxdt6oWGi PSYq0NPF/9AyHLHWIi+PVzybxC8iusRuBFrFQHMmWvv/lQ9O+8MK32zFqJ3q8lLN I4bX30V+6rDz+L9zHUdPKm+d7szNOmSUKEwN7ylFouOWehuYTDfMwylfc= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=VDPVPcQwj1RHfKg9CTEOgpcIMoM=; b=l111cWOO3dAjzF2Ss8l/ umVTMKWocBwH49WQvxn55O8mh6bZwKy5+453Fgfg9MEIancXcZd5GoRf9erRqR+W 9qRHCdu7uJ+DFlYYNdTvGyHT6ujpBz4F+jouU+qEmuWJFReJApMgJr2mTdCsyYTk wjtBOzHci6Vm3U09VvgzaZw= Received: (qmail 109744 invoked by alias); 30 Oct 2016 20:21:57 -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 109720 invoked by uid 89); 30 Oct 2016 20:21:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=FORMAT, END, 6*, STOP X-Spam-User: qpsmtpd, 2 recipients X-HELO: mtaout002-public.msg.strl.va.charter.net Received: from mtaout002-public.msg.strl.va.charter.net (HELO mtaout002-public.msg.strl.va.charter.net) (68.114.190.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 30 Oct 2016 20:21:46 +0000 Received: from impout004 ([68.114.189.19]) by mtaout002.msg.strl.va.charter.net (InterMail vM.9.00.023.01 201-2473-194) with ESMTP id <20161030202144.JETX7360.mtaout002.msg.strl.va.charter.net@impout004>; Sun, 30 Oct 2016 15:21:44 -0500 Received: from amda8.localdomain ([96.41.215.23]) by impout004 with charter.net id 1wMj1u0060Wrkg001wMjCC; Sun, 30 Oct 2016 15:21:44 -0500 X-Authority-Analysis: v=2.1 cv=GIqGE49K c=1 sm=1 tr=0 a=salB9WdMPIDduBH7JsZfrA==:117 a=salB9WdMPIDduBH7JsZfrA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=mDV3o1hIAAAA:8 a=3SS533rsmfTRvXzqSncA:9 a=QEXdDO2ut3YA:10 a=-I7GZGMMc5dJGHE5EZUA:9 a=_FVE-zBwftR9WsbkzFJk:22 X-Auth-id: anZkZWxpc2xlQGNoYXJ0ZXIubmV0 To: "fortran@gcc.gnu.org" Cc: GCC Patches From: Jerry DeLisle Subject: [patch, libgfortran] Bug 78123 - Short reads with T edit descriptor not padding correctly Message-ID: <2d818684-7980-2203-c665-5feadb5d459f@charter.net> Date: Sun, 30 Oct 2016 13:21:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 See patch below which is very simple. We were handling the case where we tabbed left of current position in the record by clearing the seen_eor flag. We were not handling the case where we tab toward the right and so are still at eor. New test case attached. Regression tested on x86-64-linux. OK to commit? This is a regression relative to g77. Its simple enough I think it should go to 5 and 6 as well. Regards, Jerry 2016-10-30 Jerry DeLisle PR fortran/79123 * io/transfer.c (formatted_transfer_scalar_read): Clear seen_eor only if we have tabbed to left of current position. { diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index b8eb5ed..5830362 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -1579,7 +1579,8 @@ formatted_transfer_scalar_read (st_parameter_dt *dtp, bt type, void *p, int kind dtp->u.p.current_unit->bytes_left -= dtp->u.p.sf_seen_eor; dtp->u.p.skips -= dtp->u.p.sf_seen_eor; bytes_used = pos; - dtp->u.p.sf_seen_eor = 0; + if (dtp->u.p.pending_spaces == 0) + dtp->u.p.sf_seen_eor = 0; } if (dtp->u.p.skips < 0)