From patchwork Mon Oct 30 18:05:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Kargl X-Patchwork-Id: 832126 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-465507-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="DIhl+Gz4"; 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 3yQj8K0Qnfz9t5C for ; Tue, 31 Oct 2017 05:05:52 +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:date :from:to:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=BOGYtabhxaRLx3pkoRVx1nK56gW2MtmvY98DgggCktI L7CngYLAXuWEUtsKj2bW+mNVaNSlFcz/y1SS7+VDozk6/S4NuMeJfP5ietJwru68 xd7VL65ERhTIcN6kasA0LLhOS4JDJe+SPKHomvXVkSbM8JC0P9x7FEyYmQWj7M1Y = 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:date :from:to:subject:message-id:reply-to:mime-version:content-type; s=default; bh=EIkvgatVjE74yyEnNlZH3qWRPFg=; b=DIhl+Gz4DpZrUjJMp 11ypmviHD1r+wqNzrmpbfkxgduBEX15oWqZrb5W5efUCILnXQg0Yo54RcwNy/e4E 4MLL0MI044q7nnc43zPiHsXcAqYMp8ClBckym/Hl1cd/lGsMjfBn9qXjSgZA32fW B6pVJC7RYnRlafH0eTFkPLM5ao= Received: (qmail 24024 invoked by alias); 30 Oct 2017 18:05:34 -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 23951 invoked by uid 89); 30 Oct 2017 18:05:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-9.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=chairman, U*kargl, corrected, unformatted X-Spam-User: qpsmtpd, 2 recipients X-HELO: troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Oct 2017 18:05:28 +0000 Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id v9UI5Q84066477 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 30 Oct 2017 11:05:26 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id v9UI5PoO066476; Mon, 30 Oct 2017 11:05:25 -0700 (PDT) (envelope-from sgk) Date: Mon, 30 Oct 2017 11:05:25 -0700 From: Steve Kargl To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] Fix gfortran.dg/dtio_13.f90 failure on at least FreeBSD Message-ID: <20171030180525.GA66467@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.2 (2016-11-26) The attached patch fixes the failure of gfortran.dg/dtio_13.f90 on at least FreeBSD. This test has been failing for a very long time. In resolve_transfer, gfortran needs to check for a BT_CLASS, but failed to to do. The patch allows one to remove a TODO in dt90_13.f90 and more important the dg-error test for a spurious error. OK to commit? 2017-10-30 Steven G. Kargl * resolve.c (resolve_transfer): Set derived to correct symbol for BT_CLASS. 2017-10-30 Steven G. Kargl * gfortran.dg/dtio_13.f90: Remove TODO comment and dg-error test. Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (revision 254232) +++ gcc/fortran/resolve.c (working copy) @@ -9181,7 +9181,7 @@ resolve_transfer (gfc_code *code) if (dt && dt->dt_io_kind->value.iokind != M_INQUIRE && (ts->type == BT_DERIVED || ts->type == BT_CLASS)) { - if (ts->type == BT_DERIVED) + if (ts->type == BT_DERIVED || ts->type == BT_CLASS) derived = ts->u.derived; else derived = ts->u.derived->components->ts.u.derived; Index: gcc/testsuite/gfortran.dg/dtio_13.f90 =================================================================== --- gcc/testsuite/gfortran.dg/dtio_13.f90 (revision 254232) +++ gcc/testsuite/gfortran.dg/dtio_13.f90 (working copy) @@ -136,9 +136,7 @@ program test character(3) :: a, b class(t) :: chairman ! { dg-error "must be dummy, allocatable or pointer" } open (unit=71, file='myunformatted_data.dat', form='unformatted') -! The following error is spurious and is eliminated if previous error is corrected. -! TODO Although better than an ICE, fix me. - read (71) a, chairman, b ! { dg-error "cannot be polymorphic" } + read (71) a, chairman, b close (unit=71) end