------- Comment #1 from erik at arbat dot com 2009-09-14 09:00 ------- Created an attachment (id=18581) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18581&action=view) Test case.
The following file illustrates the bug. Compiling with g++ -O1 -fno-strict-aliasing -c codegen.cc to see the bug. Compile with g++ -O1 -fno-strict-aliasing -fno-tree-sink -c codegen.cc to make the bug go away. If you disassemble the two versions you can see that in the buggy version both instances get the same vtable. In the correct version the constant pool is one word larger, as the two instances have two different vtables. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41354