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]

Fix for g++.law/operators8.C when NO_DOLLAR_IN_LABEL and NO_DOT_IN_LABEL


I found this while defining NO_DOLLAR_IN_LABEL and NO_DOT_IN_LABEL for
cris-axis-aout to work around a bug in collect2.c (film at 11).

The test-case g++.law/operators8.C failed because the synthesized
assignment operator copied the vtable ptr too, because
cp/method.c:do_build_assign_ref didn't recognize VFIELD_NAME_P.  The diff
-cp4 shows why it fails; there's an missing (or extraneous) underscore, so
the strncmp would never match.  I went with "missing underscore" here.

No idea how to test this seriously without modifying an existing target;
no simulator target defines NO_DOT_IN_LABEL.  Anyway, this fixes the
failure for cris-axis-aout and (surprise) it bootstraps and checks with no
regressions on i686-pc-linux-gnu.

Ok to commit?

cp/
	* cp-tree.h (VFIELD_NAME_FORMAT) [NO_DOLLAR_IN_LABEL &&
	NO_DOT_IN_LABEL]: Adjust to match VFIELD_NAME.

Index: cp-tree.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.639
diff -p -c -c -p -4 -r1.639 cp-tree.h
*** cp-tree.h	2001/08/24 12:07:43	1.639
--- cp-tree.h	2001/09/24 13:58:15
*************** extern varray_type local_classes;
*** 3167,3175 ****
  #define VFIELD_NAME "__vptr_"
  #define VFIELD_NAME_P(ID_NODE) \
    (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \
  	    sizeof (VFIELD_NAME) - 1))
! #define VFIELD_NAME_FORMAT "_vptr_%s"
  #define STATIC_NAME_FORMAT "__static_%s_%s"
  
  #define ANON_AGGRNAME_PREFIX "__anon_"
  #define ANON_AGGRNAME_P(ID_NODE) \
--- 3167,3175 ----
  #define VFIELD_NAME "__vptr_"
  #define VFIELD_NAME_P(ID_NODE) \
    (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \
  	    sizeof (VFIELD_NAME) - 1))
! #define VFIELD_NAME_FORMAT "__vptr_%s"
  #define STATIC_NAME_FORMAT "__static_%s_%s"
  
  #define ANON_AGGRNAME_PREFIX "__anon_"
  #define ANON_AGGRNAME_P(ID_NODE) \

brgds, H-P


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