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]

Patches for --enable-checking


When I ran with --enable-checking, it showed quite a number of problems,
the patches for which are below.  There are still about a half dozen
g++ testsuite crashes on checking errors, but they are all in error
recovery cases where an error message has already been given.  They are
beyond my ability to fix, so I'll leave them for somebody else.

Sun Mar 26 20:15:26 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* c-convert.c (convert): Return if output or input type is ERROR_MARK.
	* c-decl.c (duplicate_decls): Only look at DECL_BUILT_IN_NONANSI
	and DECL_INLINE if FUNCTION_DECL.
	(pushdecl, redeclaration_error_message): Likewise, for DECL_INLINE.
	(store_parm_decls): Check for type of PARM_DECL being ERROR_MARK.
	Use DECL_WEAK, not DECL_RESULT, to flag for already seen.
	(combine_parm_decls): Likewise.
	* ggc-common.c (gcc_mark_tree_children, case 'd'): Use DECL_RESULT_FLD.
	* print-tree.c (print_node): Likewise.
	Only test DECL_PACKED, DECL_INLINE, DECL_BIT_FIELD, and
	DECL_TRANSPARENT_UNION on proper decl types.
	Properly handly DECL_INCOMING_RTL and DECL_SAVED_INSNS.
	* stor-layout.c (layout_decl): Only check DECL_PACKED and
	DECL_BIT_FIELD of FIELD_DECL.
	* tree.h (DECL_RESULT_FLD): New macro.
	* cp/class.c (check_field_decl): Fix typo.
	(build_vtbl_or_vbase_field): Don't clear DECL_SAVED_INSNS.
	(check_methods): Likewise.
	(check_field_decls): Likewise.
	Use DECL_CONTEXT, not DECL_FIELD_CONTEXT.
	* cp-tree.h (DECL_SHADOWED_FOR_VAR, DECL_TEMPLATE_RESULT):
	Use DECL_RESULT_FLD, not DECL_RESULT.
	* cp/decl.c (xref_tag): Use DECL_TEMPLATE_RESULT.
	* cp/lex.c (identifier_type): Likewise.
	* cp/pt.c (determine_specialization, lookup_template_class): Likewise.
	(tsubst_friend_function, tsubst_decl, instantiate_template): Likewise.
	(resolve_overloaded_unification, more_specialized): Likewise.
	* cp/semantics.c (finish_member_declaration): Likewise.
	* cp/typeck.c (build_x_function_call): Likewise.
	
*** c-convert.c	1999/09/07 05:47:26	1.6
--- c-convert.c	2000/03/27 00:59:44
*************** convert (type, expr)
*** 66,71 ****
  
    if (type == TREE_TYPE (expr)
!       || TREE_CODE (expr) == ERROR_MARK)
      return expr;
    if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr)))
      return fold (build1 (NOP_EXPR, type, expr));
--- 66,73 ----
  
    if (type == TREE_TYPE (expr)
!       || TREE_CODE (expr) == ERROR_MARK
!       || code == ERROR_MARK || TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK)
      return expr;
+ 
    if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr)))
      return fold (build1 (NOP_EXPR, type, expr));
*** c-decl.c	2000/03/23 00:40:56	1.104
--- c-decl.c	2000/03/27 00:59:59
*************** duplicate_decls (newdecl, olddecl, diffe
*** 1806,1814 ****
  
        /* Merge the type qualifiers.  */
!       if (DECL_BUILT_IN_NONANSI (olddecl) && TREE_THIS_VOLATILE (olddecl)
! 	  && !TREE_THIS_VOLATILE (newdecl))
  	TREE_THIS_VOLATILE (write_olddecl) = 0;
        if (TREE_READONLY (newdecl))
  	TREE_READONLY (write_olddecl) = 1;
        if (TREE_THIS_VOLATILE (newdecl))
  	{
--- 1806,1817 ----
  
        /* Merge the type qualifiers.  */
!       if (TREE_CODE (olddecl) == FUNCTION_DECL
! 	  && DECL_BUILT_IN_NONANSI (olddecl) && TREE_THIS_VOLATILE (olddecl)
! 	  && ! TREE_THIS_VOLATILE (newdecl))
  	TREE_THIS_VOLATILE (write_olddecl) = 0;
+ 
        if (TREE_READONLY (newdecl))
  	TREE_READONLY (write_olddecl) = 1;
+ 
        if (TREE_THIS_VOLATILE (newdecl))
  	{
*************** duplicate_decls (newdecl, olddecl, diffe
*** 1905,1916 ****
      }
  
-   /* If either decl says `inline', this fn is inline,
-      unless its definition was passed already.  */
-   if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == 0)
-     DECL_INLINE (olddecl) = 1;
-   DECL_INLINE (newdecl) = DECL_INLINE (olddecl);
- 
    if (TREE_CODE (newdecl) == FUNCTION_DECL)
      {
        if (DECL_BUILT_IN (olddecl))
  	{
--- 1908,1920 ----
      }
  
    if (TREE_CODE (newdecl) == FUNCTION_DECL)
      {
+       /* If either decl says `inline', this fn is inline,
+ 	 unless its definition was passed already.  */
+       if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == 0)
+ 	DECL_INLINE (olddecl) = 1;
+ 
+       DECL_INLINE (newdecl) = DECL_INLINE (olddecl);
+ 
        if (DECL_BUILT_IN (olddecl))
  	{
*************** pushdecl (x)
*** 2146,2150 ****
  	 We get warnings about inline functions where they are defined.
  	 Avoid duplicate warnings where they are used.  */
!       if (TREE_PUBLIC (x) && ! DECL_INLINE (x))
  	{
  	  tree decl;
--- 2150,2155 ----
  	 We get warnings about inline functions where they are defined.
  	 Avoid duplicate warnings where they are used.  */
!       if (TREE_PUBLIC (x)
! 	  && ! (TREE_CODE (x) == FUNCTION_DECL && DECL_INLINE (x)))
  	{
  	  tree decl;
*************** pushdecl (x)
*** 2283,2286 ****
--- 2288,2292 ----
  	  tree oldlocal = IDENTIFIER_LOCAL_VALUE (name);
  	  tree oldglobal = IDENTIFIER_GLOBAL_VALUE (name);
+ 
  	  IDENTIFIER_LOCAL_VALUE (name) = x;
  
*************** pushdecl (x)
*** 2288,2295 ****
  	     have a global definition or declaration for the function.  */
  	  if (oldlocal == 0
- 	      && DECL_EXTERNAL (x) && !DECL_INLINE (x)
  	      && oldglobal != 0
  	      && TREE_CODE (x) == FUNCTION_DECL
! 	      && TREE_CODE (oldglobal) == FUNCTION_DECL)
  	    {
  	      /* We have one.  Their types must agree.  */
--- 2294,2301 ----
  	     have a global definition or declaration for the function.  */
  	  if (oldlocal == 0
  	      && oldglobal != 0
  	      && TREE_CODE (x) == FUNCTION_DECL
! 	      && TREE_CODE (oldglobal) == FUNCTION_DECL
! 	      && DECL_EXTERNAL (x) && ! DECL_INLINE (x))
  	    {
  	      /* We have one.  Their types must agree.  */
*************** redeclaration_error_message (newdecl, ol
*** 2538,2543 ****
  	  /* However, defining once as extern inline and a second
  	     time in another way is ok.  */
! 	  && !(DECL_INLINE (olddecl) && DECL_EXTERNAL (olddecl)
! 	       && !(DECL_INLINE (newdecl) && DECL_EXTERNAL (newdecl))))
  	return 1;
        return 0;
--- 2544,2549 ----
  	  /* However, defining once as extern inline and a second
  	     time in another way is ok.  */
! 	  && ! (DECL_INLINE (olddecl) && DECL_EXTERNAL (olddecl)
! 	       && ! (DECL_INLINE (newdecl) && DECL_EXTERNAL (newdecl))))
  	return 1;
        return 0;
*************** store_parm_decls ()
*** 5933,5937 ****
  	      if (DECL_NAME (parm) == 0)
  		error_with_decl (parm, "parameter name omitted");
! 	      else if (TYPE_MAIN_VARIANT (TREE_TYPE (parm)) == void_type_node)
  		{
  		  error_with_decl (parm, "parameter `%s' declared void");
--- 5939,5945 ----
  	      if (DECL_NAME (parm) == 0)
  		error_with_decl (parm, "parameter name omitted");
! 	      else if (TREE_CODE (TREE_TYPE (parm)) != ERROR_MARK
! 		       && (TYPE_MAIN_VARIANT (TREE_TYPE (parm))
! 			   == void_type_node))
  		{
  		  error_with_decl (parm, "parameter `%s' declared void");
*************** store_parm_decls ()
*** 6000,6005 ****
  	 into the TREE_PURPOSE slots.  */
  
        for (parm = parmdecls; parm; parm = TREE_CHAIN (parm))
! 	DECL_RESULT (parm) = 0;
  
        for (parm = specparms; parm; parm = TREE_CHAIN (parm))
--- 6008,6015 ----
  	 into the TREE_PURPOSE slots.  */
  
+       /* We use DECL_WEAK as a flag to show which parameters have been
+ 	 seen already since it is not used on PARM_DECL or CONST_DECL.  */
        for (parm = parmdecls; parm; parm = TREE_CHAIN (parm))
! 	DECL_WEAK (parm) = 0;
  
        for (parm = specparms; parm; parm = TREE_CHAIN (parm))
*************** store_parm_decls ()
*** 6009,6013 ****
  	  if (TREE_VALUE (parm) == 0)
  	    {
! 	      error_with_decl (fndecl, "parameter name missing from parameter list");
  	      TREE_PURPOSE (parm) = 0;
  	      continue;
--- 6019,6024 ----
  	  if (TREE_VALUE (parm) == 0)
  	    {
! 	      error_with_decl (fndecl,
! 			       "parameter name missing from parameter list");
  	      TREE_PURPOSE (parm) = 0;
  	      continue;
*************** store_parm_decls ()
*** 6026,6030 ****
  	  /* If declaration already marked, we have a duplicate name.
  	     Complain, and don't use this decl twice.   */
! 	  if (found && DECL_RESULT (found) != 0)
  	    {
  	      error_with_decl (found, "multiple parameters named `%s'");
--- 6037,6041 ----
  	  /* If declaration already marked, we have a duplicate name.
  	     Complain, and don't use this decl twice.   */
! 	  if (found && DECL_WEAK (found))
  	    {
  	      error_with_decl (found, "multiple parameters named `%s'");
*************** store_parm_decls ()
*** 6065,6072 ****
  	  TREE_PURPOSE (parm) = found;
  
! 	  /* Mark this decl as "already found" -- see test, above.
! 	     It is safe to use DECL_RESULT for this
! 	     since it is not used in PARM_DECLs or CONST_DECLs.  */
! 	  DECL_RESULT (found) = error_mark_node;
  	}
  
--- 6076,6081 ----
  	  TREE_PURPOSE (parm) = found;
  
! 	  /* Mark this decl as "already found" */
! 	  DECL_WEAK (found) = 1;
  	}
  
*************** store_parm_decls ()
*** 6094,6098 ****
  	        }
  
! 	      if (DECL_RESULT (parm) == 0)
  	        {
  	          error_with_decl (parm,
--- 6103,6107 ----
  	        }
  
! 	      if (! DECL_WEAK (parm))
  	        {
  	          error_with_decl (parm,
*************** combine_parm_decls (specparms, parmlist,
*** 6310,6314 ****
  
    for (parm = parmdecls; parm; parm = TREE_CHAIN (parm))
!     DECL_RESULT (parm) = 0;
  
    for (parm = specparms; parm; parm = TREE_CHAIN (parm))
--- 6319,6323 ----
  
    for (parm = parmdecls; parm; parm = TREE_CHAIN (parm))
!     DECL_WEAK (parm) = 0;
  
    for (parm = specparms; parm; parm = TREE_CHAIN (parm))
*************** combine_parm_decls (specparms, parmlist,
*** 6326,6330 ****
        /* If declaration already marked, we have a duplicate name.
  	 Complain, and don't use this decl twice.   */
!       if (found && DECL_RESULT (found) != 0)
  	{
  	  error_with_decl (found, "multiple parameters named `%s'");
--- 6335,6339 ----
        /* If declaration already marked, we have a duplicate name.
  	 Complain, and don't use this decl twice.   */
!       if (found && DECL_WEAK (found))
  	{
  	  error_with_decl (found, "multiple parameters named `%s'");
*************** combine_parm_decls (specparms, parmlist,
*** 6364,6371 ****
        TREE_PURPOSE (parm) = found;
  
!       /* Mark this decl as "already found" -- see test, above.
! 	 It is safe to use DECL_RESULT for this
! 	 since it is not used in PARM_DECLs or CONST_DECLs.  */
!       DECL_RESULT (found) = error_mark_node;
      }
  
--- 6373,6378 ----
        TREE_PURPOSE (parm) = found;
  
!       /* Mark this decl as "already found".  */
!       DECL_WEAK (found) = 1;
      }
  
*************** combine_parm_decls (specparms, parmlist,
*** 6384,6388 ****
  	}
  
!       if (DECL_RESULT (parm) == 0)
  	{
  	  error_with_decl (parm,
--- 6391,6395 ----
  	}
  
!       if (! DECL_WEAK (parm))
  	{
  	  error_with_decl (parm,
*** ggc-common.c	2000/03/25 18:34:02	1.22
--- ggc-common.c	2000/03/27 01:00:01
*************** ggc_mark_tree_children (t)
*** 387,391 ****
        ggc_mark_tree (DECL_CONTEXT (t));
        ggc_mark_tree (DECL_ARGUMENTS (t));
!       ggc_mark_tree (DECL_RESULT (t));
        ggc_mark_tree (DECL_INITIAL (t));
        ggc_mark_tree (DECL_ABSTRACT_ORIGIN (t));
--- 387,391 ----
        ggc_mark_tree (DECL_CONTEXT (t));
        ggc_mark_tree (DECL_ARGUMENTS (t));
!       ggc_mark_tree (DECL_RESULT_FLD (t));
        ggc_mark_tree (DECL_INITIAL (t));
        ggc_mark_tree (DECL_ABSTRACT_ORIGIN (t));
*** print-tree.c	2000/03/25 18:34:03	1.27
--- print-tree.c	2000/03/27 01:00:04
*************** print_node (file, prefix, node, indent)
*** 348,361 ****
        if (DECL_REGISTER (node))
  	fputs (" regdecl", file);
-       if (DECL_PACKED (node))
- 	fputs (" packed", file);
        if (DECL_NONLOCAL (node))
  	fputs (" nonlocal", file);
-       if (DECL_INLINE (node))
- 	fputs (" inline", file);
  
        if (TREE_CODE (node) == TYPE_DECL && TYPE_DECL_SUPPRESS_DEBUG (node))
  	fputs (" suppress-debug", file);
  
        if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node))
  	fputs (" built-in", file);
--- 348,359 ----
        if (DECL_REGISTER (node))
  	fputs (" regdecl", file);
        if (DECL_NONLOCAL (node))
  	fputs (" nonlocal", file);
  
        if (TREE_CODE (node) == TYPE_DECL && TYPE_DECL_SUPPRESS_DEBUG (node))
  	fputs (" suppress-debug", file);
  
+       if (TREE_CODE (node) == FUNCTION_DECL && DECL_INLINE (node))
+ 	fputs (" inline", file);
        if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node))
  	fputs (" built-in", file);
*************** print_node (file, prefix, node, indent)
*** 363,379 ****
  	fputs (" built-in-nonansi", file);
  
        if (TREE_CODE (node) == FIELD_DECL && DECL_BIT_FIELD (node))
  	fputs (" bit-field", file);
        if (TREE_CODE (node) == LABEL_DECL && DECL_TOO_LATE (node))
  	fputs (" too-late", file);
        if (TREE_CODE (node) == VAR_DECL && DECL_IN_TEXT_SECTION (node))
  	fputs (" in-text-section", file);
  
        if (DECL_VIRTUAL_P (node))
  	fputs (" virtual", file);
        if (DECL_DEFER_OUTPUT (node))
  	fputs (" defer-output", file);
-       if (DECL_TRANSPARENT_UNION (node))
- 	fputs (" transparent-union", file);
  
        if (DECL_LANG_FLAG_0 (node))
--- 361,382 ----
  	fputs (" built-in-nonansi", file);
  
+       if (TREE_CODE (node) == FIELD_DECL && DECL_PACKED (node))
+ 	fputs (" packed", file);
        if (TREE_CODE (node) == FIELD_DECL && DECL_BIT_FIELD (node))
  	fputs (" bit-field", file);
+ 
        if (TREE_CODE (node) == LABEL_DECL && DECL_TOO_LATE (node))
  	fputs (" too-late", file);
+ 
        if (TREE_CODE (node) == VAR_DECL && DECL_IN_TEXT_SECTION (node))
  	fputs (" in-text-section", file);
  
+       if (TREE_CODE (node) == PARM_DECL && DECL_TRANSPARENT_UNION (node))
+ 	fputs (" transparent-union", file);
+ 
        if (DECL_VIRTUAL_P (node))
  	fputs (" virtual", file);
        if (DECL_DEFER_OUTPUT (node))
  	fputs (" defer-output", file);
  
        if (DECL_LANG_FLAG_0 (node))
*************** print_node (file, prefix, node, indent)
*** 435,439 ****
  
        print_node (file, "arguments", DECL_ARGUMENTS (node), indent + 4);
!       print_node (file, "result", DECL_RESULT (node), indent + 4);
        print_node_brief (file, "initial", DECL_INITIAL (node), indent + 4);
  
--- 438,442 ----
  
        print_node (file, "arguments", DECL_ARGUMENTS (node), indent + 4);
!       print_node (file, "result", DECL_RESULT_FLD (node), indent + 4);
        print_node_brief (file, "initial", DECL_INITIAL (node), indent + 4);
  
*************** print_node (file, prefix, node, indent)
*** 446,463 ****
  	}
  
!       if (DECL_SAVED_INSNS (node) != 0)
  	{
  	  indent_to (file, indent + 4);
! 	  if (TREE_CODE (node) == PARM_DECL)
! 	    {
! 	      fprintf (file, "incoming-rtl ");
! 	      print_rtl (file, DECL_INCOMING_RTL (node));
! 	    }
! 	  else if (TREE_CODE (node) == FUNCTION_DECL)
! 	    {
! 	      fprintf (file, "saved-insns ");
! 	      fprintf (file, HOST_PTR_PRINTF,
!  		       (char *) DECL_SAVED_INSNS (node));
! 	    }
  	}
  
--- 449,464 ----
  	}
  
!       if (TREE_CODE (node) == PARM_DECL && DECL_INCOMING_RTL (node) != 0)
! 	{
! 	  indent_to (file, indent + 4);
! 	  fprintf (file, "incoming-rtl ");
! 	  print_rtl (file, DECL_INCOMING_RTL (node));
! 	}
!       else if (TREE_CODE (node) == FUNCTION_DECL
! 	       && DECL_SAVED_INSNS (node) != 0)
  	{
  	  indent_to (file, indent + 4);
! 	  fprintf (file, "saved-insns ");
! 	  fprintf (file, HOST_PTR_PRINTF, (char *) DECL_SAVED_INSNS (node));
  	}
  
*** stor-layout.c	2000/03/26 19:01:54	1.61
--- stor-layout.c	2000/03/27 01:00:07
*************** layout_decl (decl, known_align)
*** 325,331 ****
       But if the decl itself wants greater alignment, don't override that.
       Likewise, if the decl is packed, don't override it.  */
!   if (!(code == FIELD_DECL && DECL_BIT_FIELD (decl))
        && (DECL_ALIGN (decl) == 0
! 	  || (! DECL_PACKED (decl) && TYPE_ALIGN (type) > DECL_ALIGN (decl))))
      DECL_ALIGN (decl) = TYPE_ALIGN (type);
  
--- 325,332 ----
       But if the decl itself wants greater alignment, don't override that.
       Likewise, if the decl is packed, don't override it.  */
!   if (! (code == FIELD_DECL && DECL_BIT_FIELD (decl))
        && (DECL_ALIGN (decl) == 0
! 	  || (! (code == FIELD_DECL && DECL_PACKED (decl))
! 	      && TYPE_ALIGN (type) > DECL_ALIGN (decl))))
      DECL_ALIGN (decl) = TYPE_ALIGN (type);
  
*************** layout_decl (decl, known_align)
*** 343,347 ****
       Conditions are: a fixed size that is correct for another mode
       and occupying a complete byte or bytes on proper boundary.  */
!   if (DECL_BIT_FIELD (decl)
        && TYPE_SIZE (type) != 0
        && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
--- 344,348 ----
       Conditions are: a fixed size that is correct for another mode
       and occupying a complete byte or bytes on proper boundary.  */
!   if (code == FIELD_DECL && DECL_BIT_FIELD (decl)
        && TYPE_SIZE (type) != 0
        && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
*************** layout_decl (decl, known_align)
*** 361,365 ****
  
    /* Turn off DECL_BIT_FIELD if we won't need it set.  */
!   if (DECL_BIT_FIELD (decl)
        && TYPE_MODE (type) == BLKmode && DECL_MODE (decl) == BLKmode
        && known_align > TYPE_ALIGN (type)
--- 362,366 ----
  
    /* Turn off DECL_BIT_FIELD if we won't need it set.  */
!   if (code == FIELD_DECL && DECL_BIT_FIELD (decl)
        && TYPE_MODE (type) == BLKmode && DECL_MODE (decl) == BLKmode
        && known_align > TYPE_ALIGN (type)
*************** layout_decl (decl, known_align)
*** 377,381 ****
    /* If requested, warn about definitions of large data objects.  */
    if (warn_larger_than
!       && (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL)
        && ! DECL_EXTERNAL (decl))
      {
--- 378,382 ----
    /* If requested, warn about definitions of large data objects.  */
    if (warn_larger_than
!       && (code == VAR_DECL || code == PARM_DECL)
        && ! DECL_EXTERNAL (decl))
      {
*** tree.h	2000/03/25 18:34:05	1.151
--- tree.h	2000/03/27 01:00:13
*************** struct tree_type
*** 1082,1085 ****
--- 1082,1088 ----
     for language-specific uses.  */
  #define DECL_ARGUMENTS(NODE) (DECL_CHECK (NODE)->decl.arguments)
+ /* This field is used to reference anything in decl.result and is meant only
+    for use by the garbage collector.  */
+ #define DECL_RESULT_FLD(NODE) (DECL_CHECK (NODE)->decl.result)
  /* In FUNCTION_DECL, holds the decl for the return value.  */
  #define DECL_RESULT(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.result)
*** cp/class.c	2000/03/26 18:57:57	1.280
--- cpclass.c	2000/03/27 01:00:37
*************** check_field_decl (field, t, cant_have_co
*** 3759,3763 ****
  
        for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields))
! 	if (TREE_CODE (field) == FIELD_DECL && !DECL_C_BIT_FIELD (field))
  	  check_field_decl (fields, t, cant_have_const_ctor,
  			    cant_have_default_ctor, no_const_asn_ref,
--- 3759,3763 ----
  
        for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields))
! 	if (TREE_CODE (fields) == FIELD_DECL && !DECL_C_BIT_FIELD (field))
  	  check_field_decl (fields, t, cant_have_const_ctor,
  			    cant_have_default_ctor, no_const_asn_ref,
*************** check_field_decls (t, access_decls, empt
*** 3923,3927 ****
  	 or an enumerator.  */
  
!       DECL_FIELD_CONTEXT (x) = t;
  
        /* ``A local class cannot have static data members.'' ARM 9.4 */
--- 3923,3927 ----
  	 or an enumerator.  */
  
!       DECL_CONTEXT (x) = t;
  
        /* ``A local class cannot have static data members.'' ARM 9.4 */
*************** check_field_decls (t, access_decls, empt
*** 3954,3959 ****
  	continue;
  	  
-       DECL_SAVED_INSNS (x) = 0;
- 
        /* When this goes into scope, it will be a non-local reference.  */
        DECL_NONLOCAL (x) = 1;
--- 3954,3957 ----
*************** build_vtbl_or_vbase_field (name, assembl
*** 4111,4115 ****
    DECL_FIELD_CONTEXT (field) = class_type;
    DECL_FCONTEXT (field) = fcontext;
-   DECL_SAVED_INSNS (field) = 0;
    DECL_ALIGN (field) = TYPE_ALIGN (type);
  
--- 4109,4112 ----
*************** check_methods (t)
*** 4448,4452 ****
  	continue;
  
-       DECL_SAVED_INSNS (x) = 0;
        check_for_override (x, t);
        if (DECL_PURE_VIRTUAL_P (x) && ! DECL_VINDEX (x))
--- 4445,4448 ----
*** cp/cp-tree.h	2000/03/25 16:38:49	1.427
--- cp/cp-tree.h	2000/03/27 01:00:50
*************** struct lang_decl
*** 2092,2096 ****
  /* In a VAR_DECL for a variable declared in a for statement,
     this is the shadowed (local) variable.  */
! #define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT(VAR_DECL_CHECK (NODE))
  
  /* Points back to the decl which caused this lang_decl to be allocated.  */
--- 2092,2096 ----
  /* In a VAR_DECL for a variable declared in a for statement,
     this is the shadowed (local) variable.  */
! #define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT_FLD(VAR_DECL_CHECK (NODE))
  
  /* Points back to the decl which caused this lang_decl to be allocated.  */
*************** extern int flag_new_for_scope;
*** 2710,2714 ****
     TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE))
  /* For function, method, class-data templates.  */
! #define DECL_TEMPLATE_RESULT(NODE)      DECL_RESULT(NODE)
  /* For a static member variable template, the
     DECL_TEMPLATE_INSTANTIATIONS list contains the explicitly and
--- 2710,2714 ----
     TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE))
  /* For function, method, class-data templates.  */
! #define DECL_TEMPLATE_RESULT(NODE)      DECL_RESULT_FLD(NODE)
  /* For a static member variable template, the
     DECL_TEMPLATE_INSTANTIATIONS list contains the explicitly and
*** cp/decl.c	2000/03/26 03:05:48	1.578
--- cp/decl.c	2000/03/27 01:01:23
*************** pushdecl (x)
*** 4052,4061 ****
  	    {
  	      tree d = oldlocal;
  	      while (oldlocal
  		     && TREE_CODE (oldlocal) == VAR_DECL
  		     && DECL_DEAD_FOR_LOCAL (oldlocal))
! 		{
! 		  oldlocal = DECL_SHADOWED_FOR_VAR (oldlocal);
! 		}
  	      if (oldlocal == NULL_TREE)
  		oldlocal = IDENTIFIER_NAMESPACE_VALUE (DECL_NAME (d));
--- 4052,4061 ----
  	    {
  	      tree d = oldlocal;
+ 
  	      while (oldlocal
  		     && TREE_CODE (oldlocal) == VAR_DECL
  		     && DECL_DEAD_FOR_LOCAL (oldlocal))
! 		oldlocal = DECL_SHADOWED_FOR_VAR (oldlocal);
! 
  	      if (oldlocal == NULL_TREE)
  		oldlocal = IDENTIFIER_NAMESPACE_VALUE (DECL_NAME (d));
*************** push_using_directive (used)
*** 4453,4458 ****
     that name to decide what to do with that list.
  
!    DECL may also be a TEMPLATE_DECL, with a FUNCTION_DECL in its DECL_RESULT
!    slot.  It is dealt with the same way.
  
     FLAGS is a bitwise-or of the following values:
--- 4453,4458 ----
     that name to decide what to do with that list.
  
!    DECL may also be a TEMPLATE_DECL, with a FUNCTION_DECL in its
!    DECL_TEMPLATE_RESULT.  It is dealt with the same way.
  
     FLAGS is a bitwise-or of the following values:
*************** xref_tag (code_type_node, name, globaliz
*** 12437,12441 ****
  	    /* Since GLOBALIZE is true, we're declaring a global
  	       template, so we want this type.  */
! 	    ref = DECL_RESULT (ref);
  
  	  if (ref && TREE_CODE (ref) == TYPE_DECL
--- 12437,12441 ----
  	    /* Since GLOBALIZE is true, we're declaring a global
  	       template, so we want this type.  */
! 	    ref = DECL_TEMPLATE_RESULT (ref);
  
  	  if (ref && TREE_CODE (ref) == TYPE_DECL
*** cp/lex.c	2000/03/23 00:40:59	1.186
--- cp/lex.c	2000/03/27 01:01:31
*************** identifier_type (decl)
*** 3345,3351 ****
  {
    tree t;
    if (TREE_CODE (decl) == TEMPLATE_DECL)
      {
!       if (TREE_CODE (DECL_RESULT (decl)) == TYPE_DECL)
  	return PTYPENAME;
        else if (looking_for_template) 
--- 3345,3352 ----
  {
    tree t;
+ 
    if (TREE_CODE (decl) == TEMPLATE_DECL)
      {
!       if (TREE_CODE (DECL_TEMPLATE_RESULT (decl)) == TYPE_DECL)
  	return PTYPENAME;
        else if (looking_for_template) 
*** cp/pt.c	2000/03/25 16:38:49	1.412
--- cp/pt.c	2000/03/27 01:01:50
*************** determine_specialization (template_id, d
*** 1106,1110 ****
  
    /* It was a specialization of a template.  */
!   targs = DECL_TI_ARGS (DECL_RESULT (TREE_VALUE (templates)));
    if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (targs))
      {
--- 1106,1110 ----
  
    /* It was a specialization of a template.  */
!   targs = DECL_TI_ARGS (DECL_TEMPLATE_RESULT (TREE_VALUE (templates)));
    if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (targs))
      {
*************** lookup_template_class (d1, arglist, in_d
*** 3700,3704 ****
      }
    else if (TREE_CODE (d1) == TEMPLATE_DECL
! 	   && TREE_CODE (DECL_RESULT (d1)) == TYPE_DECL)
      {
        template = d1;
--- 3700,3704 ----
      }
    else if (TREE_CODE (d1) == TEMPLATE_DECL
! 	   && TREE_CODE (DECL_TEMPLATE_RESULT (d1)) == TYPE_DECL)
      {
        template = d1;
*************** tsubst_friend_function (decl, args)
*** 4461,4467 ****
  	  
  	  new_friend_is_defn 
! 	    = DECL_INITIAL (DECL_RESULT (new_friend)) != NULL_TREE;
  	  new_friend_result_template_info
! 	    = DECL_TEMPLATE_INFO (DECL_RESULT (new_friend));
  	}
        else
--- 4461,4467 ----
  	  
  	  new_friend_is_defn 
! 	    = DECL_INITIAL (DECL_TEMPLATE_RESULT (new_friend)) != NULL_TREE;
  	  new_friend_result_template_info
! 	    = DECL_TEMPLATE_INFO (DECL_TEMPLATE_RESULT (new_friend));
  	}
        else
*************** tsubst_friend_function (decl, args)
*** 4536,4540 ****
  		  tree new_friend_args;
  
! 		  DECL_TEMPLATE_INFO (DECL_RESULT (old_decl)) 
  		    = new_friend_result_template_info;
  		    
--- 4536,4540 ----
  		  tree new_friend_args;
  
! 		  DECL_TEMPLATE_INFO (DECL_TEMPLATE_RESULT (old_decl)) 
  		    = new_friend_result_template_info;
  		    
*************** tsubst_decl (t, args, type, in_decl)
*** 5417,5421 ****
  	    tree tmpl_args = DECL_CLASS_TEMPLATE_P (t) 
  	      ? CLASSTYPE_TI_ARGS (TREE_TYPE (t))
! 	      : DECL_TI_ARGS (DECL_RESULT (t));
  	    tree full_args;
  	    
--- 5417,5421 ----
  	    tree tmpl_args = DECL_CLASS_TEMPLATE_P (t) 
  	      ? CLASSTYPE_TI_ARGS (TREE_TYPE (t))
! 	      : DECL_TI_ARGS (DECL_TEMPLATE_RESULT (t));
  	    tree full_args;
  	    
*************** tsubst_decl (t, args, type, in_decl)
*** 5449,5453 ****
  	  {
  	    tree new_decl = tsubst (decl, args, /*complain=*/1, in_decl);
! 	    DECL_RESULT (r) = new_decl;
  	    TREE_TYPE (r) = TREE_TYPE (new_decl);
  	    break;
--- 5449,5453 ----
  	  {
  	    tree new_decl = tsubst (decl, args, /*complain=*/1, in_decl);
! 	    DECL_TEMPLATE_RESULT (r) = new_decl;
  	    TREE_TYPE (r) = TREE_TYPE (new_decl);
  	    break;
*************** tsubst_decl (t, args, type, in_decl)
*** 5470,5474 ****
  	    TREE_TYPE (r) = new_type;
  	    CLASSTYPE_TI_TEMPLATE (new_type) = r;
! 	    DECL_RESULT (r) = TYPE_MAIN_DECL (new_type);
  	    DECL_TI_ARGS (r) = CLASSTYPE_TI_ARGS (new_type);
  	  }
--- 5470,5474 ----
  	    TREE_TYPE (r) = new_type;
  	    CLASSTYPE_TI_TEMPLATE (new_type) = r;
! 	    DECL_TEMPLATE_RESULT (r) = TYPE_MAIN_DECL (new_type);
  	    DECL_TI_ARGS (r) = CLASSTYPE_TI_ARGS (new_type);
  	  }
*************** tsubst_decl (t, args, type, in_decl)
*** 5476,5480 ****
  	  {
  	    tree new_decl = tsubst (decl, args, /*complain=*/1, in_decl);
! 	    DECL_RESULT (r) = new_decl;
  	    DECL_TI_TEMPLATE (new_decl) = r;
  	    TREE_TYPE (r) = TREE_TYPE (new_decl);
--- 5476,5481 ----
  	  {
  	    tree new_decl = tsubst (decl, args, /*complain=*/1, in_decl);
! 
! 	    DECL_TEMPLATE_RESULT (r) = new_decl;
  	    DECL_TI_TEMPLATE (new_decl) = r;
  	    TREE_TYPE (r) = TREE_TYPE (new_decl);
*************** tsubst_decl (t, args, type, in_decl)
*** 5547,5552 ****
  	    spec_args = tsubst (DECL_TI_ARGS (fn), args,
  				/*complain=*/1, in_decl); 
! 	    new_fn = tsubst (DECL_RESULT (most_general_template (fn)), 
! 			     spec_args, /*complain=*/1, in_decl); 
  	    DECL_TI_TEMPLATE (new_fn) = fn;
  	    register_specialization (new_fn, r, 
--- 5548,5554 ----
  	    spec_args = tsubst (DECL_TI_ARGS (fn), args,
  				/*complain=*/1, in_decl); 
! 	    new_fn
! 	      = tsubst (DECL_TEMPLATE_RESULT (most_general_template (fn)), 
! 			spec_args, /*complain=*/1, in_decl); 
  	    DECL_TI_TEMPLATE (new_fn) = fn;
  	    register_specialization (new_fn, r, 
*************** tsubst_decl (t, args, type, in_decl)
*** 5556,5560 ****
  	/* Record this partial instantiation.  */
  	register_specialization (r, t, 
! 				 DECL_TI_ARGS (DECL_RESULT (r)));
  
        }
--- 5558,5562 ----
  	/* Record this partial instantiation.  */
  	register_specialization (r, t, 
! 				 DECL_TI_ARGS (DECL_TEMPLATE_RESULT (r)));
  
        }
*************** tsubst_decl (t, args, type, in_decl)
*** 5700,5704 ****
  				     /*complain=*/1, t);
  	DECL_MAIN_VARIANT (r) = r;
! 	DECL_RESULT (r) = NULL_TREE;
  
  	TREE_STATIC (r) = 0;
--- 5702,5706 ----
  				     /*complain=*/1, t);
  	DECL_MAIN_VARIANT (r) = r;
! 	DECL_TEMPLATE_RESULT (r) = NULL_TREE;
  
  	TREE_STATIC (r) = 0;
*************** instantiate_template (tmpl, targ_ptr)
*** 7435,7439 ****
  
    /* substitute template parameters */
!   fndecl = tsubst (DECL_RESULT (gen_tmpl), targ_ptr, /*complain=*/1, gen_tmpl);
    /* The DECL_TI_TEMPLATE should always be the immediate parent
       template, not the most general template.  */
--- 7437,7442 ----
  
    /* substitute template parameters */
!   fndecl = tsubst (DECL_TEMPLATE_RESULT (gen_tmpl),
! 		   targ_ptr, /*complain=*/1, gen_tmpl);
    /* The DECL_TI_TEMPLATE should always be the immediate parent
       template, not the most general template.  */
*************** resolve_overloaded_unification (tparms, 
*** 7861,7865 ****
  	    continue;
  
! 	  subargs = get_bindings_overload (fn, DECL_RESULT (fn), expl_subargs);
  	  if (subargs)
  	    {
--- 7864,7869 ----
  	    continue;
  
! 	  subargs = get_bindings_overload (fn, DECL_TEMPLATE_RESULT (fn),
! 					   expl_subargs);
  	  if (subargs)
  	    {
*************** more_specialized (pat1, pat2, explicit_a
*** 8702,8710 ****
    int winner = 0;
  
!   targs = get_bindings_overload (pat1, DECL_RESULT (pat2), explicit_args);
    if (targs)
      --winner;
  
!   targs = get_bindings_overload (pat2, DECL_RESULT (pat1), explicit_args);
    if (targs)
      ++winner;
--- 8706,8716 ----
    int winner = 0;
  
!   targs
!     = get_bindings_overload (pat1, DECL_TEMPLATE_RESULT (pat2), explicit_args);
    if (targs)
      --winner;
  
!   targs
!     = get_bindings_overload (pat2, DECL_TEMPLATE_RESULT (pat1), explicit_args);
    if (targs)
      ++winner;
*** cp/semantics.c	2000/03/21 18:10:45	1.131
--- cp/semantics.c	2000/03/27 01:01:59
*************** finish_member_declaration (decl)
*** 1991,1996 ****
    if (TREE_CODE (decl) == TEMPLATE_DECL)
      {
!       TREE_PRIVATE (DECL_RESULT (decl)) = TREE_PRIVATE (decl);
!       TREE_PROTECTED (DECL_RESULT (decl)) = TREE_PROTECTED (decl);
      }
  
--- 1991,1996 ----
    if (TREE_CODE (decl) == TEMPLATE_DECL)
      {
!       TREE_PRIVATE (DECL_TEMPLATE_RESULT (decl)) = TREE_PRIVATE (decl);
!       TREE_PROTECTED (DECL_TEMPLATE_RESULT (decl)) = TREE_PROTECTED (decl);
      }
  
*** cp/typeck.c	2000/03/25 18:34:12	1.271
--- cp/typeck.c	2000/03/27 01:02:15
*************** build_x_function_call (function, params,
*** 2578,2582 ****
         && DECL_STATIC_FUNCTION_P (function))
        || (TREE_CODE (function) == TEMPLATE_DECL
! 	  && DECL_STATIC_FUNCTION_P (DECL_RESULT (function))))
        return build_member_call(DECL_CONTEXT (function), 
  			       template_id 
--- 2578,2582 ----
         && DECL_STATIC_FUNCTION_P (function))
        || (TREE_CODE (function) == TEMPLATE_DECL
! 	  && DECL_STATIC_FUNCTION_P (DECL_TEMPLATE_RESULT (function))))
        return build_member_call(DECL_CONTEXT (function), 
  			       template_id 

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