From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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 13:13:00 -0000 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: Content-Type: multipart/mixed; boundary=------------080608050406070400070907 X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00820.txt.bz2 This is a multi-part message in MIME format. --------------080608050406070400070907 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Content-length: 477 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 --------------080608050406070400070907 Content-Type: text/x-patch; name="pr65792_fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr65792_fix.diff" Content-length: 572 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); --------------080608050406070400070907--