re PR c++/42256 (483.xalancbmk fails to link)

PR c++/42256
	* optimize.c (maybe_clone_body): Call emit_associated_thunks
	after expand_or_defer_fn_1.

	* g++.dg/inherit/thunk11.C: New test.
	* g++.dg/inherit/thunk11.h: New file.
	* g++.dg/inherit/thunk11-aux.cc: New file.

From-SVN: r154937
This commit is contained in:
Jakub Jelinek 2009-12-03 09:03:36 +01:00 committed by Jakub Jelinek
parent 90df451fde
commit 249ccaff22
6 changed files with 48 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2009-12-03 Jakub Jelinek <jakub@redhat.com>
PR c++/42256
* optimize.c (maybe_clone_body): Call emit_associated_thunks
after expand_or_defer_fn_1.
2009-12-02 Taras Glek <taras@mozilla.com>
* parser.c (cp_parser_class_specifier): Back out my previous change.

View file

@ -309,7 +309,6 @@ maybe_clone_body (tree fn)
comdat_group = cdtor_comdat_group (fns[1], fns[0]);
DECL_COMDAT_GROUP (fns[0]) = comdat_group;
}
emit_associated_thunks (clone);
}
/* Build the delete destructor by calling complete destructor
@ -383,7 +382,10 @@ maybe_clone_body (tree fn)
finish_function (0);
BLOCK_ABSTRACT_ORIGIN (DECL_INITIAL (clone)) = DECL_INITIAL (fn);
if (alias)
expand_or_defer_fn_1 (clone);
{
if (expand_or_defer_fn_1 (clone))
emit_associated_thunks (clone);
}
else
expand_or_defer_fn (clone);
first = false;

View file

@ -1,3 +1,10 @@
2009-12-03 Jakub Jelinek <jakub@redhat.com>
PR c++/42256
* g++.dg/inherit/thunk11.C: New test.
* g++.dg/inherit/thunk11.h: New file.
* g++.dg/inherit/thunk11-aux.cc: New file.
2009-12-02 Richard Guenther <rguenther@suse.de>
* g++.dg/ipa/iinline-1.C: Adjust.

View file

@ -0,0 +1,4 @@
// { dg-do compile }
// { dg-options "-O2" }
#include "thunk11.h"

View file

@ -0,0 +1,11 @@
// PR c++/42256
// { dg-do link }
// { dg-additional-sources "thunk11-aux.cc" }
// { dg-options "-O2" }
#include "thunk11.h"
int
main ()
{
}

View file

@ -0,0 +1,16 @@
struct A
{
A () {}
virtual ~A () {}
};
struct B
{
B () {}
virtual ~B () {}
};
struct C : public A, public B
{
virtual void foo ();
virtual ~C () {};
};
inline void C::foo () {}