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]

Minor dbxout.c changes


This mostly fixes a bug where we generate tags on variable-length
record that causes objdump to crash, but also does some cleanup
in using host_integerp instead of checking for INTEGER_CST.

Fri May 18 07:26:34 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* dbxout.c (dbxout_type): Use host_integerp and fix typo in testing
	for INTEGER_TYPE.
	(dbxout_symbol, case TYPE_DECL): Don't generate tag for records of
	variable size.

*** dbxout.c	2001/05/17 22:57:36	1.82
--- dbxout.c	2001/05/18 20:17:21
*************** dbxout_type (type, full, show_arg_types)
*** 1070,1074 ****
        if (! full || !COMPLETE_TYPE_P (type)
  	  /* No way in DBX fmt to describe a variable size.  */
! 	  || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
  	return;
        break;
--- 1070,1074 ----
        if (! full || !COMPLETE_TYPE_P (type)
  	  /* No way in DBX fmt to describe a variable size.  */
! 	  || ! host_integerp (TYPE_SIZE (type), 1))
  	return;
        break;
*************** dbxout_type (type, full, show_arg_types)
*** 1095,1099 ****
  	|| !COMPLETE_TYPE_P (type)
  	/* No way in DBX fmt to describe a variable size.  */
! 	|| TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
        {
  	typevec[TYPE_SYMTAB_ADDRESS (type)].status = TYPE_XREF;
--- 1095,1099 ----
  	|| !COMPLETE_TYPE_P (type)
  	/* No way in DBX fmt to describe a variable size.  */
! 	|| ! host_integerp (TYPE_SIZE (type), 1))
        {
  	typevec[TYPE_SYMTAB_ADDRESS (type)].status = TYPE_XREF;
*************** dbxout_type (type, full, show_arg_types)
*** 1147,1151 ****
  	 write it as a subtype.  */
        else if (TREE_TYPE (type) != 0
! 	       && TREE_CODE (TREE_TYPE (type)) == INTEGER_CST)
  	dbxout_range_type (type);
  
--- 1147,1151 ----
  	 write it as a subtype.  */
        else if (TREE_TYPE (type) != 0
! 	       && TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE)
  	dbxout_range_type (type);
  
*************** dbxout_type (type, full, show_arg_types)
*** 1177,1181 ****
  	      && TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST
  	      && (TYPE_PRECISION (type) > TYPE_PRECISION (integer_type_node)
! 		  || (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)
  		      && TREE_UNSIGNED (type))
  		  || TYPE_PRECISION (type) > HOST_BITS_PER_WIDE_INT
--- 1177,1182 ----
  	      && TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST
  	      && (TYPE_PRECISION (type) > TYPE_PRECISION (integer_type_node)
! 		  || ((TYPE_PRECISION (type)
! 		       == TYPE_PRECISION (integer_type_node))
  		      && TREE_UNSIGNED (type))
  		  || TYPE_PRECISION (type) > HOST_BITS_PER_WIDE_INT
*************** dbxout_type (type, full, show_arg_types)
*** 1364,1368 ****
  	    || !COMPLETE_TYPE_P (type)
  	    /* No way in DBX fmt to describe a variable size.  */
! 	    || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
  	  {
  	    /* If the type is just a cross reference, output one
--- 1365,1369 ----
  	    || !COMPLETE_TYPE_P (type)
  	    /* No way in DBX fmt to describe a variable size.  */
! 	    || ! host_integerp (TYPE_SIZE (type), 1))
  	  {
  	    /* If the type is just a cross reference, output one
*************** dbxout_symbol (decl, local)
*** 1811,1815 ****
  		/* Distinguish the implicit typedefs of C++
  		   from explicit ones that might be found in C.  */
!                 && DECL_ARTIFICIAL (decl))
  	      {
  		tree name = TYPE_NAME (type);
--- 1812,1820 ----
  		/* Distinguish the implicit typedefs of C++
  		   from explicit ones that might be found in C.  */
!                 && DECL_ARTIFICIAL (decl)
! 		/* Do not generate a tag for records of variable size,
! 		   since this type can not be properly described in the
! 		   DBX format, and it confuses some tools such as objdump.  */
! 		&& ! host_integerp (TYPE_SIZE (type), 1))
  	      {
  		tree name = TYPE_NAME (type);
*************** dbxout_symbol (decl, local)
*** 1859,1866 ****
  	    did_output = 1;
  	  }
- 
- 	/* Don't output a tag if this is an incomplete type (TYPE_SIZE is
- 	   zero).  This prevents the sun4 Sun OS 4.x dbx from crashing.  */ 
  
  	if (tag_needed && TYPE_NAME (type) != 0
  	    && (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE
--- 1864,1871 ----
  	    did_output = 1;
  	  }
  
+ 	/* Don't output a tag if this is an incomplete type.  This prevents
+ 	   the sun4 Sun OS 4.x dbx from crashing.  */
+ 	
  	if (tag_needed && TYPE_NAME (type) != 0
  	    && (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE


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