From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8178 invoked by alias); 21 Jun 2010 10:18:45 -0000 Received: (qmail 8131 invoked by uid 48); 21 Jun 2010 10:18:31 -0000 Date: Mon, 21 Jun 2010 10:18:00 -0000 Message-ID: <20100621101831.8130.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/44541] [OOP] wrong code for polymorphic variable with INTENT(OUT)/Alloc w/ MOLD In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "janus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-06/txt/msg02006.txt.bz2 ------- Comment #2 from janus at gcc dot gnu dot org 2010-06-21 10:18 ------- My first idea to fix this was to add a new field to the vtabs, let's call it $def_init, which would be the fourth field in the vtab structure (after $hash, $size and $extends), and would contain the default initialization values for the type. However, this approach does not work, since the field needed for default initialization would have to be of the derived type which the vtab belongs to. This however can have different sizes, so that the PPCs in the vtab will not be aligned any more for extended types, which messes up dynamic dispatch. Alternatives: (1) make $def_init a pointer (problem: initialization of $def_init itself) (2) add standalone variables a la "type_t$def_init" to carry default initialization for each type (3) ...? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44541