This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ is broken


Hi,

C++ is basically broken on certain platforms like Linux/Alpha. The
problem is very tricky. Here is what I found out:

1. egcs 1.0.3 is ok.
2. Linux/Alpha uses thunks and defines ASM_OUTPUT_MI_THUNK.
3. Linux/Alpha generates a global constructor to create vtable.
4. In finish_file () from cp/decl2.c, it does

	/* do_ctors will reverse the lists for messing up.  */
	if (needs_messing_up)
	{
	    do_ctors ();
	}

where all the virtual functions in a class is referenced
in the global constructor to create vtable for the class,
including the pure virtual one.
5. But the pure virtual functions are replaced by __pure_virtual
after do_ctors () is called. That leaves the the pure virtual
functions referenced in the global constructor undefined.

We should fix it in egcs 1.1.

Thanks.

H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]