From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9910 invoked by alias); 30 Jul 2010 18:39:34 -0000 Received: (qmail 9855 invoked by uid 48); 30 Jul 2010 18:39:23 -0000 Date: Fri, 30 Jul 2010 18:39:00 -0000 Message-ID: <20100730183923.9854.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/44912] [OOP] Segmentation fault on TBP 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-07/txt/msg03341.txt.bz2 ------- Comment #5 from janus at gcc dot gnu dot org 2010-07-30 18:39 ------- (In reply to comment #4) > admittedly, I do not fully understand the code which sets > the TBP to the vtable - shouldn't this be done when the vtable for a type is > created rather than every time before it is used? Well, this is a bit tricky. We do not want to generate unnecessary code for non-OOP programs, therefore we can not simply create a vtab for each derived type, but we only do that if a type is actually used as a CLASS. Another problem is that the vtab init code can be generated multiple times if there are multiple CLASS usage cases in a program (blowing up code size). It might be of advantage to put the vtab init code in a special subroutine. [Preferrably in the same module where the type is declared, but this only makes sense if the module contains polymorphic code.] -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44912