From patchwork Sat May 9 13:12:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 470325 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 54F55140281 for ; Sat, 9 May 2015 23:13:14 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ifq6m4AM; 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=Pyu8WnZPUfsDa7S/+ wINsjmCULD6YIJ3REAszTLnL019PKcJd5VnDbKWs8zkCAKzWO41OOfrQ4LAHmHGI GtbB6PtPz2uT5ovEcNuNXq1PurzPqF8YS+VE/biKDfp535XR8xk/Pj+APwJLO83h 0z9sR2MWu+ileeq4glJmVFLOnk= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=OoGhDBwrQDu8UxLx6TKTf9B GRHc=; b=ifq6m4AMwqEY/E5oNL6QfPkxgXGoRnJT+scCQIh1eNwK7JhO2++GbWz YB4WAnl+C05aFyZ0fci/50ceorDY5uAcxwcxoWBjqbRG3NyR+jeNbDqRafjaWQAT ofWQaEhIVNqYSdUhDpSy9x003FQORQPWqipJPZ+dRkUgQbxoyYeA= Received: (qmail 29648 invoked by alias); 9 May 2015 13:13:01 -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 27701 invoked by uid 89); 9 May 2015 13:13:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp23.services.sfr.fr Received: from smtp23.services.sfr.fr (HELO smtp23.services.sfr.fr) (93.17.128.22) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sat, 09 May 2015 13:12:59 +0000 Received: from filter.sfr.fr (localhost [86.72.15.135]) by msfrf2301.sfr.fr (SMTP Server) with ESMTP id 3DE6F700007B; Sat, 9 May 2015 15:12:56 +0200 (CEST) Authentication-Results: sfrmc.priv.atos.fr; dkim=none (no signature); dkim-adsp=none (no policy) header.from=mikael.morin@sfr.fr Received: from tolstoi.localhost (135.15.72.86.rev.sfr.net [86.72.15.135]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by msfrf2301.sfr.fr (SMTP Server) with ESMTP id A6E47700006F; Sat, 9 May 2015 15:12:55 +0200 (CEST) X-SFR-UUID: 20150509131255683.A6E47700006F@msfrf2301.sfr.fr Message-ID: <554E07CA.2020808@sfr.fr> Date: Sat, 09 May 2015 15:12:42 +0200 From: Mikael Morin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Paul Richard Thomas , Steve Kargl CC: Andre Vehreschild , "fortran@gcc.gnu.org" , gcc-patches Subject: Re: [Patch, fortran] PR65792 - allocation of scalar elemental function with structure constructor fails References: <20150426185319.GA29878@troutmask.apl.washington.edu> In-Reply-To: X-IsSubscribed: yes Le 01/05/2015 20:25, Paul Richard Thomas a écrit : > Dear All, > > By the time I went to commit, something had changed and the patch > caused a regression. I presume that the version that I had of Andre's > patch was not the same as the one committed. I'll cast an eye over it > this weekend and see if I can understand what gives. > Hello Paul, to get things moving again, I propose the attached fix to your patch. Tested on alloc_comp_deep_copy_1 only for now. Mikael diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 6cf5fe2..532f4b7 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -7078,7 +7078,8 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr, } gfc_add_modify (&block, dest, fold_convert (TREE_TYPE (dest), se.expr)); - if (cm->ts.u.derived->attr.alloc_comp) + if (cm->ts.u.derived->attr.alloc_comp + && expr->expr_type != EXPR_NULL) { tmp = gfc_copy_alloc_comp (cm->ts.u.derived, se.expr, dest, expr->rank);