From patchwork Wed May 29 13:22:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 247265 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 357052C0316 for ; Wed, 29 May 2013 23:22:45 +1000 (EST) 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:content-transfer-encoding; q=dns; s= default; b=j2jo80nzou926CsUi5R1QJ+lkTIS2rZMrOOybfbYrKa0/LkxqiKCW 3ycDTq1W1GbcNzO+5XLbvZlRyuxMRjbulL1AaT0deCyIYLsERAhaj+qnZdnNtWqZ LXFP3jDvW2N4pkO3N1GLlkZa+VB8Ba4cw4Q//0n6WFRD7j+PFD7IeU= 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:content-transfer-encoding; s=default; bh=xmOKLfqkiY/yFbsoEOkwzESe/r4=; b=SGlrP4f4ZwHHPDGspjNshmd979lI Vc7PlOkrUi92VW8hb3CNME5eeUx0pltGsOO4o+fqc/WGacmReyLTWyJJBgC7qAuZ OU0sSdkp0eAIGQ633VsuC58DgBunXUsFoTAIRWWvaAkxTVBOCWo7txAtBN16KkIz lnqCN8+uh/cNuQk= Received: (qmail 8572 invoked by alias); 29 May 2013 13:22:39 -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 8552 invoked by uid 89); 29 May 2013 13:22:38 -0000 X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_DNSWL_NONE, TW_GZ autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 3 recipients Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 29 May 2013 13:22:37 +0000 Received: from archimedes.net-b.de (port-92-195-106-97.dynamic.qsc.de [92.195.106.97]) by mx01.qsc.de (Postfix) with ESMTP id E2CA73CEE7; Wed, 29 May 2013 15:22:33 +0200 (CEST) Message-ID: <51A60118.9020707@net-b.de> Date: Wed, 29 May 2013 15:22:32 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Janus Weil CC: gcc patches , gfortran Subject: Re: [Patch, Fortran] Enable the generation of the FINALization wrapper function References: <519D164E.100@net-b.de> <51A38128.1070509@net-b.de> In-Reply-To: Janus Weil wrote: >> Build and regtested on x86-64-gnu-linux. >> OK for the trunk? > I think this patch is ok. Just one nit: > > @@ -5571,7 +5569,7 @@ gfc_dump_module (const char *name, int dump_flag) > FIXME: For backwards compatibility with the old uncompressed > module format, write an extra empty line. When the module version > is bumped, this can be removed. */ > - gzprintf (module_fp, "GFORTRAN module version '%s' created from %s\n\n", > + gzprintf (module_fp, "GFORTRAN module version '%s' created from %s\n", > MOD_VERSION, gfc_source_file); > > Here you should remove the FIXME. I thought I had done this - but seemingly I missed that one. DONE. Dominique was that brave and tested the posted patches. Doing so, he found that the finalization wrapper causes an ICE with -m32. The reason is that I use gfc_convert_type to convert the kind value of result variable of the RANK intrinsic. It turned out that calling that for a no op conversion leads to an ICE (internal error). (The conversion is supposed to convert the default-kind result value to the gfc_array_index_kind, otherwise one runs into an ICE at tree level.) Well, the solution is simple: Only convert it when needed. Hence, I included the following patch in the committal (Rev. 199409). + gfc_convert_type_warn (rank, &idx->ts, 2, 0); Thanks to both of you for the review and the testing. * * * Now the important ingredients for finalization are all in, the next task is to actually do finalization. The first patch has been posted, but it will take a while until all finalization calls will be available. Tobias --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -1644 +1644,2 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns, - gfc_convert_type (rank, &idx->ts, 2); + if (rank->ts.kind != idx->ts.kind)