From patchwork Fri Aug 24 19:03:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 179881 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]) by ozlabs.org (Postfix) with SMTP id E42942C00D8 for ; Sat, 25 Aug 2012 05:03:36 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1346439817; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=Tu45t/vVQYFgtWe8pdXZwUk6zQw=; b=qRogr754YyiIdxT kW6SfdQP/nZrCtD4hLT5sA4IVjjREcvZH3btgdEn7gkXpc8cU8teBuV3VrW8AfSc gIviLbz5i5k8q8RHQhRQod3W2Z4JPiiGA0+fE53yZZ2ZAN5oh3z9JK4XiKNvSYFG r7PXGMWJeqoPWcWE4Tl0qUp6XHlk= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=CEq+eUkESXc7me+b0S/YKHt3kq6NOE5MCrt4JonGhhxA9GHrTERzhy1gE/LA1p g4jAbF+Zz4/ZfCxWKaANC2osCwZfJkk6+4NyvQScxl5TIra4HyhM8hNGs4ROxqZH KR4Nx6/v9vExsISVDMOGYU6px5VWbgBrUG2VU3yvITx2s=; Received: (qmail 25786 invoked by alias); 24 Aug 2012 19:03:27 -0000 Received: (qmail 25646 invoked by uid 22791); 24 Aug 2012 19:03:26 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Aug 2012 19:03:12 +0000 Received: from [192.168.178.22] (port-92-204-67-8.dynamic.qsc.de [92.204.67.8]) by mx02.qsc.de (Postfix) with ESMTP id 6EBA327733; Fri, 24 Aug 2012 21:03:09 +0200 (CEST) Message-ID: <5037CFEC.5050404@net-b.de> Date: Fri, 24 Aug 2012 21:03:08 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Alessandro Fanfarillo CC: gcc patches , gfortran , "Rouson, Damian" Subject: Re: [Fortran] PR37336 - FIINAL patch [1/n]: Implement the finalization wrapper subroutine References: <50295E1A.5050108@net-b.de> <50312777.9090007@net-b.de> In-Reply-To: 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 Dear Alessandro, Alessandro Fanfarillo wrote: > there are some problems with the final-wrapper-v2.diff patch; I get > Internal Error at (1): > gfc_code2string(): Bad code > for every test case that I use; in attachment final2.f90. Fixed by the patch below. However, note that the current patch only implement the wrapper function - it doesn't handle calling the wrapper function. That's requires a follow up patch. (That was the reason that I did not do extensive test.) The patch is a complete module.c patch, not incrementally based on the previous patch. Tobias diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index a4ff199..3e636cd 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -1840,17 +1840,18 @@ typedef enum AB_ELEMENTAL, AB_PURE, AB_RECURSIVE, AB_GENERIC, AB_ALWAYS_EXPLICIT, AB_CRAY_POINTER, AB_CRAY_POINTEE, AB_THREADPRIVATE, AB_ALLOC_COMP, AB_POINTER_COMP, AB_PROC_POINTER_COMP, AB_PRIVATE_COMP, - AB_VALUE, AB_VOLATILE, AB_PROTECTED, AB_LOCK_COMP, + AB_VALUE, AB_VOLATILE, AB_PROTECTED, AB_LOCK_COMP, AB_FINAL_COMP, AB_IS_BIND_C, AB_IS_C_INTEROP, AB_IS_ISO_C, AB_ABSTRACT, AB_ZERO_COMP, AB_IS_CLASS, AB_PROCEDURE, AB_PROC_POINTER, AB_ASYNCHRONOUS, AB_CODIMENSION, AB_COARRAY_COMP, AB_VTYPE, AB_VTAB, AB_CONTIGUOUS, AB_CLASS_POINTER, - AB_IMPLICIT_PURE + AB_IMPLICIT_PURE, AB_ARTIFICIAL } ab_attribute; static const mstring attr_bits[] = { minit ("ALLOCATABLE", AB_ALLOCATABLE), + minit ("ARTIFICIAL", AB_ARTIFICIAL), minit ("ASYNCHRONOUS", AB_ASYNCHRONOUS), minit ("DIMENSION", AB_DIMENSION), minit ("CODIMENSION", AB_CODIMENSION), @@ -1883,6 +1884,7 @@ static const mstring attr_bits[] = minit ("VALUE", AB_VALUE), minit ("ALLOC_COMP", AB_ALLOC_COMP), minit ("COARRAY_COMP", AB_COARRAY_COMP), + minit ("FINAL_COMP", AB_FINAL_COMP), minit ("LOCK_COMP", AB_LOCK_COMP), minit ("POINTER_COMP", AB_POINTER_COMP), minit ("PROC_POINTER_COMP", AB_PROC_POINTER_COMP), @@ -1975,6 +1977,8 @@ mio_symbol_attribute (symbol_attribute *attr) { if (attr->allocatable) MIO_NAME (ab_attribute) (AB_ALLOCATABLE, attr_bits); + if (attr->artificial) + MIO_NAME (ab_attribute) (AB_ARTIFICIAL, attr_bits); if (attr->asynchronous) MIO_NAME (ab_attribute) (AB_ASYNCHRONOUS, attr_bits); if (attr->dimension) @@ -2057,6 +2061,8 @@ mio_symbol_attribute (symbol_attribute *attr) MIO_NAME (ab_attribute) (AB_PRIVATE_COMP, attr_bits); if (attr->coarray_comp) MIO_NAME (ab_attribute) (AB_COARRAY_COMP, attr_bits); + if (attr->final_comp) + MIO_NAME (ab_attribute) (AB_FINAL_COMP, attr_bits); if (attr->lock_comp) MIO_NAME (ab_attribute) (AB_LOCK_COMP, attr_bits); if (attr->zero_comp) @@ -2090,6 +2096,9 @@ mio_symbol_attribute (symbol_attribute *attr) case AB_ALLOCATABLE: attr->allocatable = 1; break; + case AB_ARTIFICIAL: + attr->artificial = 1; + break; case AB_ASYNCHRONOUS: attr->asynchronous = 1; break; @@ -2198,6 +2207,9 @@ mio_symbol_attribute (symbol_attribute *attr) case AB_COARRAY_COMP: attr->coarray_comp = 1; break; + case AB_FINAL_COMP: + attr->final_comp = 1; + break; case AB_LOCK_COMP: attr->lock_comp = 1; break;