This is the mail archive of the gcc-patches@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++) followup linkage patch


This fixes the crash building tinfo2.o on non-ELF targets.

1999-03-25  Jason Merrill  <jason@yorick.cygnus.com>

	* decl2.c (comdat_linkage): Treat vtables like functions.

Index: decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.193
retrieving revision 1.194
diff -c -p -r1.193 -r1.194
*** decl2.c	1999/03/23 02:33:34	1.193
--- decl2.c	1999/03/25 19:45:25	1.194
*************** comdat_linkage (decl)
*** 2370,2379 ****
  {
    if (flag_weak)
      make_decl_one_only (decl);
!   else if (TREE_CODE (decl) == FUNCTION_DECL)
      TREE_PUBLIC (decl) = 0;
    else
      {
        if (DECL_INITIAL (decl) == 0
  	  || DECL_INITIAL (decl) == error_mark_node)
  	DECL_COMMON (decl) = 1;
--- 2370,2383 ----
  {
    if (flag_weak)
      make_decl_one_only (decl);
!   else if (TREE_CODE (decl) == FUNCTION_DECL || DECL_VIRTUAL_P (decl))
!     /* We can just emit functions and vtables statically; it doesn't really
!        matter if we have multiple copies.  */
      TREE_PUBLIC (decl) = 0;
    else
      {
+       /* Static data member template instantiations, however, cannot
+ 	 have multiple copies.  */
        if (DECL_INITIAL (decl) == 0
  	  || DECL_INITIAL (decl) == error_mark_node)
  	DECL_COMMON (decl) = 1;


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