This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16636] Unable to emit vtable info
- From: "miko at stacken dot kth dot se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jul 2004 12:53:03 -0000
- Subject: [Bug c++/16636] Unable to emit vtable info
- References: <20040719194957.16636.miko@stacken.kth.se>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From miko at stacken dot kth dot se 2004-07-22 12:52 -------
(In reply to comment #4)
> If you still think that this is a bug, you will have to present us with
> a complete example where this is actually a problem. In your example,
> you don't have any user of the vtable, so there doesn't seem to be a bug
> with not emitting it. Please show us a complete example that actually
> fails to link.
Based on comments made by Andrew Pinski that the code isn't legal, I don't
think I can argue this is a bug, per se.
> If you can show us an example where this actually does lead to a problem,
> we may reconsider. In general, however, the rule to emit the vtable with the
> first non-inlined function seems to be OK with everyone, though.
Ok, I did some more playing around. It turns out that the example given
(which was obviously a condensed version of what I'm running into) DOES
emit a vtable with -fno-default-inline. However, if class B
class B : public A
{
public:
int b;
virtual void foo() { ++b; }
virtual
~B () { }
B() : A(), b(0) { }
};
becomes:
class B : public A
{
public:
int b;
virtual
~B () { }
virtual void foo();
B() : A(), b(0) { }
};
(note the reordering of the functions)
then no vtable is emitted with -fno-default-inline. This would appear to
be inconsistent behaviour. If -fno-default-inline is enough to force a vtable
emission when all fns are inline, you'd have thought it enough to force it when
the first is inline, since we're stating not to inline functions by default.
Yes/no?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16636