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]

Re: Patch to DECL_ASSEMBLER_NAME handling


My previous patch broke the ability to compare DECL_ASSEMBLER_NAME to
determine if two member functions were the same; this fixes that.

Fixes g++.other/redecl4.C.

2000-03-06  Jason Merrill  <jason@casey.cygnus.com>

	* varasm.c (make_decl_rtl): Don't add a number to members of
	local classes.
	(make_function_rtl): Likewise.

Index: varasm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/varasm.c,v
retrieving revision 1.102
diff -c -p -r1.102 varasm.c
*** varasm.c	2000/03/04 00:48:46	1.102
--- varasm.c	2000/03/07 08:30:11
*************** make_function_rtl (decl)
*** 522,529 ****
    char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
    char *new_name = name;
  
!   /* Rename a nested function to avoid conflicts.  */
    if (decl_function_context (decl) != 0
        && DECL_INITIAL (decl) != 0
        && DECL_RTL (decl) == 0)
      {
--- 522,531 ----
    char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
    char *new_name = name;
  
!   /* Rename a nested function to avoid conflicts, unless it's a member of
!      a local class, in which case the class name is already unique.  */
    if (decl_function_context (decl) != 0
+       && ! TYPE_P (DECL_CONTEXT (decl))
        && DECL_INITIAL (decl) != 0
        && DECL_RTL (decl) == 0)
      {
*************** make_decl_rtl (decl, asmspec, top_level)
*** 765,773 ****
        if (DECL_RTL (decl) == 0)
  	{
  	  /* Can't use just the variable's own name for a variable
! 	     whose scope is less than the whole file.
  	     Concatenate a distinguishing number.  */
! 	  if (!top_level && !TREE_PUBLIC (decl) && asmspec == 0)
  	    {
  	      char *label;
  
--- 767,778 ----
        if (DECL_RTL (decl) == 0)
  	{
  	  /* Can't use just the variable's own name for a variable
! 	     whose scope is less than the whole file, unless it's a member
! 	     of a local class (which will already be unambiguous).
  	     Concatenate a distinguishing number.  */
! 	  if (!top_level && !TREE_PUBLIC (decl)
! 	      && ! TYPE_P (DECL_CONTEXT (decl))
! 	      && asmspec == 0)
  	    {
  	      char *label;
  

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