From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103642 invoked by alias); 6 May 2016 11:29:22 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 103613 invoked by uid 89); 6 May 2016 11:29:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00,KAM_ASCII_DIVIDERS,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=felix, Felix, Hx-languages-length:2597, HRB X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 06 May 2016 11:29:11 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E066DAB5F; Fri, 6 May 2016 11:29:08 +0000 (UTC) Date: Fri, 06 May 2016 11:29:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org cc: fortran@gcc.gnu.org Subject: Re: [PATCH] Fix PR70937 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2016-05/txt/msg00011.txt.bz2 On Fri, 6 May 2016, Richard Biener wrote: > > The following patch fixes another case of missing DECL_EXPR in the FE. > > Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. > > Ok for trunk? Dominique noticed a FAIL early which is fixed by adjusting the patch to only handle TYPE_DECL TYPE_NAME like so: Index: gcc/fortran/trans-decl.c =================================================================== --- gcc/fortran/trans-decl.c (revision 235945) +++ gcc/fortran/trans-decl.c (working copy) @@ -3818,6 +3818,12 @@ gfc_trans_vla_type_sizes (gfc_symbol *sy } gfc_trans_vla_type_sizes_1 (type, body); + /* gfc_build_qualified_array may have built this type but left TYPE_NAME + pointing to the original type whose type sizes we need to expose to + the gimplifier unsharing. */ + if (TYPE_NAME (type) + && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL) + gfc_add_expr_to_block (body, build1 (DECL_EXPR, type, TYPE_NAME (type))); } I've re-started testing. Ok with that change? Thanks, Richard. > Thanks, > Richard. > > 2016-05-06 Richard Biener > > PR fortran/70937 > * trans-decl.c (gfc_trans_vla_type_sizes): Add a DECL_EXPR for > the TYPE_DECL as well. > > * gfortran.dg/pr70937.f90: New testcase. > > Index: gcc/fortran/trans-decl.c > =================================================================== > *** gcc/fortran/trans-decl.c (revision 235945) > --- gcc/fortran/trans-decl.c (working copy) > *************** gfc_trans_vla_type_sizes (gfc_symbol *sy > *** 3818,3823 **** > --- 3818,3828 ---- > } > > gfc_trans_vla_type_sizes_1 (type, body); > + /* gfc_build_qualified_array may have built this type but left TYPE_NAME > + pointing to the original type whose type sizes we need to expose to > + the gimplifier unsharing. */ > + if (TYPE_NAME (type)) > + gfc_add_expr_to_block (body, build1 (DECL_EXPR, type, TYPE_NAME (type))); > } > > > Index: gcc/testsuite/gfortran.dg/pr70937.f90 > =================================================================== > *** gcc/testsuite/gfortran.dg/pr70937.f90 (revision 0) > --- gcc/testsuite/gfortran.dg/pr70937.f90 (working copy) > *************** > *** 0 **** > --- 1,10 ---- > + ! { dg-do compile } > + ! { dg-options "-flto" } > + SUBROUTINE dbcsr_test_read_args(narg, args) > + CHARACTER(len=*), DIMENSION(:), & > + INTENT(out) :: args > + CHARACTER(len=80) :: line > + DO > + args(narg) = line > + ENDDO > + END SUBROUTINE dbcsr_test_read_args > -- Richard Biener SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)