diff options
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/method.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/abi/thunk3.C | 20 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/abi/thunk4.C | 22 | ||||
-rw-r--r-- | gcc/varasm.c | 6 |
7 files changed, 62 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 32606d7..f9b9002 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2005-12-29 Nathan Sidwell <nathan@codesourcery.com> + + * varasm.c (get_section): Use gcc_assert. + 2005-12-29 Paul Brook <paul@codesourcery.com> * config/m68k/m68k.h (RETURN_ADDR_RTX): Define. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ae0fcf5..7391d15 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2005-12-29 Nathan Sidwell <nathan@codesourcery.com> + + * method.c (make_thunk): Don't set comdat_linkage here. + (use_thunk): Make thunk one only here, if thunk target is + DECL_ONE_ONLY. + 2005-12-26 Mark Mitchell <mark@codesourcery.com> PR c++/25439 diff --git a/gcc/cp/method.c b/gcc/cp/method.c index f3c86d3..250c66d 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -137,8 +137,6 @@ make_thunk (tree function, bool this_adjusting, TREE_READONLY (thunk) = TREE_READONLY (function); TREE_THIS_VOLATILE (thunk) = TREE_THIS_VOLATILE (function); TREE_PUBLIC (thunk) = TREE_PUBLIC (function); - if (flag_weak) - comdat_linkage (thunk); SET_DECL_THUNK_P (thunk, this_adjusting); THUNK_TARGET (thunk) = function; THUNK_FIXED_OFFSET (thunk) = d; @@ -381,8 +379,8 @@ use_thunk (tree thunk_fndecl, bool emit_p) DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function); DECL_VISIBILITY_SPECIFIED (thunk_fndecl) = DECL_VISIBILITY_SPECIFIED (function); - if (flag_weak && TREE_PUBLIC (thunk_fndecl)) - comdat_linkage (thunk_fndecl); + if (DECL_ONE_ONLY (function)) + make_decl_one_only (thunk_fndecl); if (flag_syntax_only) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c95b8f8..4dbfe9b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,7 +1,12 @@ +2005-12-29 Nathan Sidwell <nathan@codesourcery.com> + + * g++.dg/abi/thunk3.C: New. + * g++.dg/abi/thunk4.C: New. + 2005-12-29 Paul Thomas <pault@gcc.gnu.org> PR fortran/25532 - *gfortran.dg/host_used_types_1.f90: New test. Check that host + * gfortran.dg/host_used_types_1.f90: New test. Check that host associated derived type components of derived types are properly declared in contained procedures. diff --git a/gcc/testsuite/g++.dg/abi/thunk3.C b/gcc/testsuite/g++.dg/abi/thunk3.C new file mode 100644 index 0000000..8b5f3ce --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/thunk3.C @@ -0,0 +1,20 @@ +// { dg-final { scan-assembler-not ".weak\t_ZThn4_N7Derived3FooEv" } } + +struct Base +{ + virtual void Foo (); +}; + +struct Filler +{ + virtual void Baz (); +}; + +struct Derived : Filler, Base +{ + virtual void Foo (); +}; + +void Derived::Foo () +{ +} diff --git a/gcc/testsuite/g++.dg/abi/thunk4.C b/gcc/testsuite/g++.dg/abi/thunk4.C new file mode 100644 index 0000000..1c47740 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/thunk4.C @@ -0,0 +1,22 @@ +// { dg-final { scan-assembler ".weak\t_ZThn4_N7Derived3FooEv" } } + +struct Base +{ + virtual void Foo (); +}; + +struct Filler +{ + virtual void Baz (); +}; + +struct Derived : Filler, Base +{ + virtual void Foo (); +}; + +inline void Derived::Foo () +{ +} + +Derived f; diff --git a/gcc/varasm.c b/gcc/varasm.c index f39b07c..eafba6b 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -249,10 +249,8 @@ get_section (const char *name, unsigned int flags, tree decl) /* Sanity check user variables for flag changes. */ if (decl == 0) decl = sect->named.decl; - if (decl) - error ("%+D causes a section type conflict", decl); - else - gcc_unreachable (); + gcc_assert (decl); + error ("%+D causes a section type conflict", decl); } } return sect; |