From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1091 invoked by alias); 6 Jul 2010 10:14:39 -0000 Received: (qmail 1034 invoked by uid 48); 6 Jul 2010 10:14:26 -0000 Date: Tue, 06 Jul 2010 10:14:00 -0000 Message-ID: <20100706101426.1033.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/43945] [OOP] Derived type with GENERIC: resolved to the wrong specific TBP In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sfilippone at uniroma2 dot it" 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/msg00536.txt.bz2 ------- Comment #24 from sfilippone at uniroma2 dot it 2010-07-06 10:14 ------- (In reply to comment #23) > (In reply to comment #22) > > > generic_23.f03 obviously works becase the binding name DOIT and the procedure > name are one and the same.... > Hi all Another variation to the test case, to have the guilty statements in a one-line function of their own, and the -fdump-tree-original shows what's going on: tryset is correct, tryall has this "a->$vptr->allocate->allocate_mnnz " thing which leads to error. If it was just "a->$vptr->allocate_mnnz " (which I tested by changing the statement to invoke directly the specific binding name) it would work. So, it looks like the code that resolves the generic procedure would do well to just avoid the GENERIC part of the vtab, resolve the generic to a specific and invoke the vtab for the specific. I have tried to follow the resolve code, but I got lost (I guess it's a bit coplex as a first trip inside gfortran guts :-) I suppose the originator(s) of the code would do much better. tryall (struct class$d_base_sparse_mat & restrict a, integer(kind=4) & restrict m, integer(kind=4) & restrict n, integer(kind=4) & restrict nz) { a->$vptr->allocate->allocate_mnnz ((integer(kind=4) *) m, (integer(kind=4) *) n, (struct class$d_base_sparse_mat *) a, (integer(kind=4) *) nz); } tryset (struct class$d_base_sparse_mat & restrict a) { a->$vptr->set_null ((struct class$d_base_sparse_mat *) a); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43945