From patchwork Sat Feb 23 04:48:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry DeLisle X-Patchwork-Id: 1047271 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-496937-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=charter.net Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="wBR2HFik"; 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 445wjP2n0yz9s5c for ; Sat, 23 Feb 2019 15:49:19 +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:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=yaiACB93gNZ9kSOJPYHrtOoPWDLhqeYx9BYkzzWyVrYwAhScE5 y5lAzyMgxm8ugF5UXQJ0zlLCGqPNimoPcXeMRIdNmFoumz6eDneFOQzsN+Bc4B0W JhPCtTq4GC8629tlbqbu+zlet8LqjgXqiXvzvID5k9xDpWBUICY7oi5YY= 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=gEMAb8kvauorHOSb4jOV6RbOhqA=; b=wBR2HFikBal+Z6wJyPMw vPvtPjdkCYblUKfG0g/O/OluP3vV8IPU1/ZVU2fu2l/JPDlILNVwl1UQEvR5RAkm m43V3mtQ2PcLeX0slbeFYgt5m9XEt1NIseumHcVvyvl9zOA42+UKOLVklE4dRTZf WlqJlQPtrX+yoiZRCHRAi/4= Received: (qmail 80977 invoked by alias); 23 Feb 2019 04:49:02 -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 80560 invoked by uid 89); 23 Feb 2019 04:48:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=H*MI:charter, gfc_symbol, gfc_typespec, H*M:4c29 X-HELO: impout009.msg.chrl.nc.charter.net Received: from impout009aa.msg.chrl.nc.charter.net (HELO impout009.msg.chrl.nc.charter.net) (47.43.20.33) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 23 Feb 2019 04:48:55 +0000 Received: from [192.168.1.6] ([66.191.41.128]) by cmsmtp with ESMTPA id xPF1g6cO5iYmuxPF1glGXJ; Sat, 23 Feb 2019 04:48:49 +0000 Authentication-Results: charter.net; none To: "fortran@gcc.gnu.org" Cc: GCC Patches From: Jerry DeLisle Subject: [PATCH, libgfortran] PR83387 Defined output does not work for a derived type that has no components Message-ID: Date: Fri, 22 Feb 2019 20:48:46 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 This patch is simple and obvious. Regression tested on x86_64-pc-linux-gnu. Test case attached. (Changelog for test case will be included) I will commit tomorrow. Regards, Jerry 2019-02-23 Jerry DeLisle PR fortran/84387 * trans-io.c (transfer_expr): Do not return if there are no components to the derived type or class. diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index 9a13af4a630..9e7071dc121 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -2407,8 +2407,6 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr, case_bt_struct: case BT_CLASS: - if (ts->u.derived->components == NULL) - return; if (gfc_bt_struct (ts->type) || ts->type == BT_CLASS) { gfc_symbol *derived;