This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/4122: undefined reference to `non-virtual thunk to ...'
- From: Robert Boehne <rboehne at ricardo-us dot com>
- To: gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, juergen at monocerus dot demon dot co dot uk, boehme at informatik dot hu-berlin dot de, loewis at informatik dot hu-berlin dot de, rboehne at ricardo-us dot com, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, michael at ritzert dot de
- Cc: jason_merrill at redhat dot com
- Date: Fri, 14 Dec 2001 17:04:59 -0600
- Subject: Re: c++/4122: undefined reference to `non-virtual thunk to ...'
- Organization: Ricardo Software
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4122
Hello,
I've tracked this problem down to the changes applied on June 6, 2001 in
the gcc-3_0-branch that correspond to this ChangeLog entry:
2001-06-06 Jason Merrill <jason_merrill@redhat.com>
* cp-tree.h (THUNK_GENERATE_WITH_VTABLE_P): Lose.
(struct lang_decl_flags): Lose generate_with_vtable_p.
(BV_GENERATE_THUNK_WITH_VTABLE_P): Lose.
* class.c (copy_virtuals): Adjust.
* decl2.c (mark_vtable_entries): Adjust.
* method.c (make_thunk, build_vtable_entry): Adjust.
* class.c (update_vtable_entry_for_fn): Only look as far as the
first defining class.
(build_vtbl_initializer): Put nothing in the slot for a function
only
defined in a lost primary virtual base.
(add_vcall_offset_vtbl_entries_1): Use the same code for
the lost primary case and the normal case.
(dfs_unshared_virtual_bases): Don't lose a non-virtual primary
base.
(get_vfield_offset, get_derived_offset): Lose.
(dfs_find_final_overrider): Use look_for_overrides_here.
(get_matching_virtual): New fn.
* semantics.c (emit_associated_thunks): Check
BV_USE_VCALL_INDEX_P,
not BV_VCALL_INDEX.
* search.c (look_for_overrides_here): Split out from...
(look_for_overrides_r): Here.
* class.c (find_final_overrider): Return error_mark_node on
error.
This problem is present in all releases of 3.0 as well as CVS head.
My uninitiated eye can't definitively say, but it looks suspicious
that a macro named "THUNK_GENERATE_WITH_VTABLE_P" was removed in
this patch. I hope to have a valid patch to fix this problem before
year's end, but I won't be the least bit upset if someone else
figures this out before I do. Any insight into the problem would
be appreciated. I determined this by checking out the branch
with -rgcc-3_0-branch -D "June 6, 2001 4:00pm" and bootstrapping,
then attempting to compile the i2.cpp example attached to the PR in
GNATS (which compiles and runs without error) then updating cvs
by another four hours (-rgcc-3_0-branch -D "June 6, 2001 8:00pm")
and repeating.
Thanks,
Robert Boehne