From patchwork Sun Oct 16 06:27:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janne Blomqvist X-Patchwork-Id: 682657 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 3sxWcm5pvFz9s5g for ; Sun, 16 Oct 2016 17:28:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Anm2yedY; 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:from :to:cc:subject:date:message-id; q=dns; s=default; b=mxnTSE8W8vkf ojAFpilMlJOosxzlzilXgBUFvINhJrsrGpzm/8rW3XrkGff7peokcSz0VMnUwnYr yUZHo39C1uwF2EkXHctDbhL7hL0p0mMruhobZxFc8PG0px512nEg2OvOinoUB8H3 9ja4Sg7wjpZiMqQNREItzzX507ATpd4= 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=zfwHnQvXe0UOfgAIVq HTuKzvtmo=; b=Anm2yedYVv2Wr9qVc78Bb7PS2xmxRnudaTW2AphGibI7/NAi04 US6zKp8iHOMphIS9dRTu92LzB8uDAoh8QA7cEiw67KLsx4K7fR10edZn6fCn2ztT fBnJQE0PU9divWQS431t0veyK07vsASPauLbEEN1lVqXfa6VmUUgkvt3k= Received: (qmail 110158 invoked by alias); 16 Oct 2016 06:28:24 -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 110096 invoked by uid 89); 16 Oct 2016 06:28:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, SPF_PASS autolearn=ham version=3.3.2 spammy=opp, dtp, UD:common.unit, sk:st_para X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-lf0-f68.google.com Received: from mail-lf0-f68.google.com (HELO mail-lf0-f68.google.com) (209.85.215.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 16 Oct 2016 06:28:02 +0000 Received: by mail-lf0-f68.google.com with SMTP id x23so14872058lfi.1; Sat, 15 Oct 2016 23:28:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LNYwn2eLC3hhCBoBEM7cIS1hO1bUN0bYo0nM+JtaukE=; b=en0Px8jea2jpR5Q9Ah7W4sXIcSDRvUFeeYq7Mjgfet3yKWZkrdQ8G9J0jeUFUAwrJM ju1PEzpCX9xIVbJUXEBD2hONdLreM37sBd2wuIWRnC4Z1dZLvD+vT6+ASSbTtTA7o+h/ 9k3n23zMqtJMqUlhBQvtbU/GTtvXlgdFjYcakwjIJOrdwxoN5D2P0JvWzML3+RRHRthi IIa4J0olcEQzZrD0QX3eYEEQeOflXfuPpp0GHwMp1SnZ8mrFej4dFXfxkc9XDciWM4bi 4UgU6dKTyj20kUl/o8Oak1AKPer80wfPM+SI9PXQNJc1VUZ/tMlo9URvoZVm+7rULUqG UVpA== X-Gm-Message-State: AA6/9RnAzFbIfHZPPVrwtPkJsWktzUzUHqBw6pRuzPA8yyApNCXYgHNkq9tQ2sCPfZfnzQ== X-Received: by 10.25.66.72 with SMTP id p69mr8530021lfa.82.1476599278988; Sat, 15 Oct 2016 23:27:58 -0700 (PDT) Received: from dt.lan (91-159-207-203.elisa-laajakaista.fi. [91.159.207.203]) by smtp.gmail.com with ESMTPSA id h88sm6413138lfi.6.2016.10.15.23.27.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Oct 2016 23:27:57 -0700 (PDT) From: Janne Blomqvist To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Janne Blomqvist Subject: [PATCH, libfortran] PR 48587 Newunit allocator, cleanup Date: Sun, 16 Oct 2016 09:27:46 +0300 Message-Id: <1476599266-8522-1-git-send-email-blomqvist.janne@gmail.com> Improve error message, and remove a redundant check, as the same check is done a bit earlier due to the PR 48587 patch. 2016-10-16 Janne Blomqvist PR libfortran/48587 * io/transfer.c (data_transfer_init): Improve error message, remove redundant check. Regtested on x86_64-pc-linux-gnu. Committed as obvious. --- libgfortran/io/transfer.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 7696cca..2232417 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -2606,7 +2606,8 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag) /* This means we tried to access an external unit < 0 without having opened it first with NEWUNIT=. */ generate_error (&dtp->common, LIBERROR_BAD_OPTION, - "Invalid unit number in statement"); + "Unit number is negative and unit was not already " + "opened with OPEN(NEWUNIT=...)"); return; } else if (dtp->u.p.current_unit->s == NULL) @@ -2614,14 +2615,6 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag) st_parameter_open opp; unit_convert conv; - if (dtp->common.unit < 0 && !is_internal_unit (dtp)) - { - close_unit (dtp->u.p.current_unit); - dtp->u.p.current_unit = NULL; - generate_error (&dtp->common, LIBERROR_BAD_OPTION, - "Bad unit number in statement"); - return; - } memset (&u_flags, '\0', sizeof (u_flags)); u_flags.access = ACCESS_SEQUENTIAL; u_flags.action = ACTION_READWRITE;