From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13502 invoked by alias); 5 Nov 2010 15:29:30 -0000 Received: (qmail 13388 invoked by uid 22791); 5 Nov 2010 15:29:28 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE 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, 05 Nov 2010 15:29:17 +0000 Received: from [192.168.178.22] (port-92-204-76-125.dynamic.qsc.de [92.204.76.125]) by mx02.qsc.de (Postfix) with ESMTP id 29CA61E788; Fri, 5 Nov 2010 16:29:14 +0100 (CET) Message-ID: <4CD422C8.5070400@net-b.de> Date: Fri, 05 Nov 2010 15:36:00 -0000 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101026 SUSE/3.1.6 Thunderbird/3.1.6 MIME-Version: 1.0 To: Janus Weil CC: gfortran , gcc-patches Subject: Re: [RFC] Polymorphic deep copy (aka PR46174) References: <4CD0F19B.7020402@frontier.com> <4CD3AC9D.3090205@net-b.de> <4CD3DF4E.8080706@net-b.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2010-11/txt/msg00533.txt.bz2 On 11/05/2010 03:01 PM, Janus Weil wrote: >> I think the following program is valid and now rejected with your patch: Can we add that program or turn one of the type-bound operator test cases from dg-do compile to dg-do run? Seemingly, we lack such a test case. * * * Regarding the generate code, I have a RFC: Currently, gfortran assume that all code is old and uses no polymorphic data types. Only few newer code exists which does. A consequence of that is that the vtable is always populated per translation unit. For instance, the "copy$" exists in every file which uses CLASS(t). (As function which is not externally visible.) That works and is fine; however, if one has a program which heavily uses polymorphic types, the size could be significantly reduced by generating the function only once at the place where the TYPE is defined. Current version: + No OOP penalty for code which never uses CLASS + Local scope which makes inlining even without LTO easier - Larger files due to duplicated code Single-occurence: + Generated only once, smaller files - Also generated if CLASS is not used Comments? We don't have to decide now, but if we change the ABI, it has either to be in 4.6 or in the ABI-breaking version (4.7?). 4.6 is OK because in 4.5 the polymorphism support was very experimental. See also PR 46313 (part c) for another reason to break the ABI. * * * > The attached new version of the patch finally is free of regressions > (on x86_64-unknown-linux-gnu). Ok for trunk? OK; but please add (or "dg-do run" enable) a test case for the user-defined assignment. You could also add PR 45451 to the changelog as the patch seemingly fixes the last remaining issue of that PR. Tobias PS: The next step logically following this patch is to add deep-"free$" support (cf. comment 2 of this PR 46174) and - in relation with automatic (re)allocation on assignment - to add support for an assignment to a polymorphic variable.