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]
Other format: [Raw text]

[patch] Expunge SET_TYPE


It appears that we do not use SET_TYPE anywhere in the compiler. The
only note about it is for Pascal in the tree.def file.  I noticed we
removed some other Pascal specific nodes already.

This patch removes all the places dealing with SET_TYPE, which is mainly
a bunch of 'case SET_TYPE: clauses and a couple of large pieces of
object initialization code.

I did not test Ada, 'cos I cannot build it, the one use in Ada is a case
label leading to a /* Don't know how to do these yet.  */ comment.  Well,
now you don't have to :)

booted & tested on i686-pc-linux-gnu, ok?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2004-12-08  Nathan Sidwell  <nathan@codesourcery.com>

	* tree.def (SET_TYPE): Remove.
	(CONSTRUCTOR): Update description.
	* builtins.c (type_to_class) Remove SET_TYPE case.
	* dbxout.c (dbxout_type): Likewise.
	* dwarf2out.c (is_base_type): Likewise.
	(gen_set_type_die): Remove.
	(gen_type_die): Remove SET_TYPE case.
	* expr.c (count_type_elements): Likewise.
	(mostly_zeroes_p): Likewise.
	(store_constructor): Likewise.
	* print_tree.c (print_node): Likewise.
	* stor-layout.c (layout_type): Likewise.
	* tree-browser.c (browse_tree): Likewise.
	* tree-inline.c (remap_type): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* tree.c (type_contains_plaeholder_1, type_hash_eq,
	variably_modified_type_p, initializer_zerop): Likewise.
	* tree.h (SET_OR_ARRAY_CHECK): Remove.
	(AGGREGATE_TYPE_P): Remove SET_TYPE check.
	(TYPE_DOMAIN): Use ARRAY_TYPE_CHECK.
	* typeclass.h (enum type_class): Remove set_type_class.
	* varasm.c (const_hash_1): Remove SET_TYPE case.
	(compare_constant, copy_constant, output_constant): Likewise.
	* config/i386/i386.c (classify_argument): Likewise.
	* config/ia64/ia64.c (hfa_element_mode): Likewise.
	* config/sparc/sparc.c (sparc_type_code): Likewise.

	* ada/decl.c (gnat_substitute_in_type): Remove SET_TYPE case.

Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.408
diff -c -3 -p -r1.408 builtins.c
*** builtins.c	5 Dec 2004 14:18:18 -0000	1.408
--- builtins.c	8 Dec 2004 17:46:30 -0000
*************** type_to_class (tree type)
*** 1475,1481 ****
      case QUAL_UNION_TYPE:  return union_type_class;
      case ARRAY_TYPE:	   return (TYPE_STRING_FLAG (type)
  				   ? string_type_class : array_type_class);
-     case SET_TYPE:	   return set_type_class;
      case FILE_TYPE:	   return file_type_class;
      case LANG_TYPE:	   return lang_type_class;
      default:		   return no_type_class;
--- 1475,1480 ----
Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.215
diff -c -3 -p -r1.215 dbxout.c
*** dbxout.c	3 Nov 2004 03:19:11 -0000	1.215
--- dbxout.c	8 Dec 2004 17:46:38 -0000
*************** dbxout_type (tree type, int full)
*** 1967,1989 ****
  	}
        break;
  
-     case SET_TYPE:
-       if (use_gnu_debug_info_extensions)
- 	{
- 	  have_used_extensions = 1;
- 	  stabstr_S ("@s");
- 	  stabstr_D (BITS_PER_UNIT * int_size_in_bytes (type));
- 	  stabstr_C (';');
- 
- 	  /* Check if a bitstring type, which in Chill is
- 	     different from a [power]set.  */
- 	  if (TYPE_STRING_FLAG (type))
- 	    stabstr_S ("@S;");
- 	}
-       stabstr_C ('S');
-       dbxout_type (TYPE_DOMAIN (type), 0);
-       break;
- 
      case ARRAY_TYPE:
        /* Make arrays of packed bits look like bitstrings for chill.  */
        if (TYPE_PACKED (type) && use_gnu_debug_info_extensions)
--- 1967,1972 ----
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.561
diff -c -3 -p -r1.561 dwarf2out.c
*** dwarf2out.c	26 Nov 2004 19:21:13 -0000	1.561
--- dwarf2out.c	8 Dec 2004 17:47:05 -0000
*************** static tree member_declared_type (tree);
*** 3963,3969 ****
  static const char *decl_start_label (tree);
  #endif
  static void gen_array_type_die (tree, dw_die_ref);
- static void gen_set_type_die (tree, dw_die_ref);
  #if 0
  static void gen_entry_point_die (tree, dw_die_ref);
  #endif
--- 3963,3968 ----
*************** is_base_type (tree type)
*** 8031,8037 ****
      case CHAR_TYPE:
        return 1;
  
-     case SET_TYPE:
      case ARRAY_TYPE:
      case RECORD_TYPE:
      case UNION_TYPE:
--- 8030,8035 ----
*************** gen_array_type_die (tree type, dw_die_re
*** 10813,10828 ****
    add_type_attribute (array_die, element_type, 0, 0, context_die);
  }
  
- static void
- gen_set_type_die (tree type, dw_die_ref context_die)
- {
-   dw_die_ref type_die
-     = new_die (DW_TAG_set_type, scope_die_for (type, context_die), type);
- 
-   equate_type_number_to_die (type, type_die);
-   add_type_attribute (type_die, TREE_TYPE (type), 0, 0, context_die);
- }
- 
  #if 0
  static void
  gen_entry_point_die (tree decl, dw_die_ref context_die)
--- 10811,10816 ----
*************** gen_type_die (tree type, dw_die_ref cont
*** 12091,12101 ****
        gen_ptr_to_mbr_type_die (type, context_die);
        break;
  
-     case SET_TYPE:
-       gen_type_die (TYPE_DOMAIN (type), context_die);
-       gen_set_type_die (type, context_die);
-       break;
- 
      case FILE_TYPE:
        gen_type_die (TREE_TYPE (type), context_die);
        /* No way to represent these in Dwarf yet!  */
--- 12079,12084 ----
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.757
diff -c -3 -p -r1.757 expr.c
*** expr.c	7 Dec 2004 21:23:02 -0000	1.757
--- expr.c	8 Dec 2004 17:47:24 -0000
*************** count_type_elements (tree type)
*** 4371,4377 ****
      case VOID_TYPE:
      case METHOD_TYPE:
      case FILE_TYPE:
-     case SET_TYPE:
      case FUNCTION_TYPE:
      case LANG_TYPE:
      default:
--- 4371,4376 ----
*************** mostly_zeros_p (tree exp)
*** 4389,4398 ****
      {
        HOST_WIDE_INT nz_elts, nc_elts, elts;
  
-       /* If there are no ranges of true bits, it is all zero.  */
-       if (TREE_TYPE (exp) && TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
- 	return CONSTRUCTOR_ELTS (exp) == NULL_TREE;
- 
        categorize_ctor_elements (exp, &nz_elts, &nc_elts);
        elts = count_type_elements (TREE_TYPE (exp));
  
--- 4388,4393 ----
*************** store_constructor (tree exp, rtx target,
*** 5011,5194 ****
  					gen_rtvec_v (n_elts, vector))));
  	break;
        }
! 
!       /* Set constructor assignments.  */
!     case SET_TYPE:
!       {
! 	tree elt = CONSTRUCTOR_ELTS (exp);
! 	unsigned HOST_WIDE_INT nbytes = int_size_in_bytes (type), nbits;
! 	tree domain = TYPE_DOMAIN (type);
! 	tree domain_min, domain_max, bitlength;
! 	
! 	/* The default implementation strategy is to extract the
! 	   constant parts of the constructor, use that to initialize
! 	   the target, and then "or" in whatever non-constant ranges
! 	   we need in addition.
! 
! 	   If a large set is all zero or all ones, it is probably
! 	   better to set it using memset.  Also, if a large set has
! 	   just a single range, it may also be better to first clear
! 	   all the first clear the set (using memset), and set the
! 	   bits we want.  */
! 
! 	/* Check for all zeros.  */
! 	if (elt == NULL_TREE && size > 0)
! 	  {
! 	    if (!cleared)
! 	      clear_storage (target, GEN_INT (size));
! 	    return;
! 	  }
! 	
! 	domain_min = convert (sizetype, TYPE_MIN_VALUE (domain));
! 	domain_max = convert (sizetype, TYPE_MAX_VALUE (domain));
! 	bitlength = size_binop (PLUS_EXPR,
! 				size_diffop (domain_max, domain_min),
! 				ssize_int (1));
! 	
! 	nbits = tree_low_cst (bitlength, 1);
! 
!         /* For "small" sets, or "medium-sized" (up to 32 bytes) sets
! 	   that are "complicated" (more than one range), initialize
! 	   (the constant parts) by copying from a constant.  */
! 	if (GET_MODE (target) != BLKmode || nbits <= 2 * BITS_PER_WORD
! 	    || (nbytes <= 32 && TREE_CHAIN (elt) != NULL_TREE))
! 	  {
! 	    unsigned int set_word_size = TYPE_ALIGN (TREE_TYPE (exp));
! 	    enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1);
! 	    char *bit_buffer = alloca (nbits);
! 	    HOST_WIDE_INT word = 0;
! 	    unsigned int bit_pos = 0;
! 	    unsigned int ibit = 0;
! 	    unsigned int offset = 0;  /* In bytes from beginning of set.  */
! 	    
! 	    elt = get_set_constructor_bits (exp, bit_buffer, nbits);
! 	    for (;;)
! 	      {
! 		if (bit_buffer[ibit])
! 		  {
! 		    if (BYTES_BIG_ENDIAN)
! 		      word |= (1 << (set_word_size - 1 - bit_pos));
! 		    else
! 		      word |= 1 << bit_pos;
! 		  }
! 		
! 		bit_pos++;  ibit++;
! 		if (bit_pos >= set_word_size || ibit == nbits)
! 		  {
! 		    if (word != 0 || ! cleared)
! 		      {
! 			rtx datum = gen_int_mode (word, mode);
! 			rtx to_rtx;
! 			
! 			/* The assumption here is that it is safe to
! 			   use XEXP if the set is multi-word, but not
! 			   if it's single-word.  */
! 			if (MEM_P (target))
! 			  to_rtx = adjust_address (target, mode, offset);
! 			else
! 			  {
! 			    gcc_assert (!offset);
! 			    to_rtx = target;
! 			  }
! 			emit_move_insn (to_rtx, datum);
! 		      }
! 		    
! 		    if (ibit == nbits)
! 		      break;
! 		    word = 0;
! 		    bit_pos = 0;
! 		    offset += set_word_size / BITS_PER_UNIT;
! 		  }
! 	      }
! 	  }
! 	else if (!cleared)
! 	  /* Don't bother clearing storage if the set is all ones.  */
! 	  if (TREE_CHAIN (elt) != NULL_TREE
! 	      || (TREE_PURPOSE (elt) == NULL_TREE
! 		  ? nbits != 1
! 		  : ( ! host_integerp (TREE_VALUE (elt), 0)
! 		      || ! host_integerp (TREE_PURPOSE (elt), 0)
! 		      || (tree_low_cst (TREE_VALUE (elt), 0)
! 			  - tree_low_cst (TREE_PURPOSE (elt), 0) + 1
! 			  != (HOST_WIDE_INT) nbits))))
! 	    clear_storage (target, expr_size (exp));
! 	
! 	for (; elt != NULL_TREE; elt = TREE_CHAIN (elt))
! 	  {
! 	    /* Start of range of element or NULL.  */
! 	    tree startbit = TREE_PURPOSE (elt);
!  	    /* End of range of element, or element value.  */
! 	    tree endbit   = TREE_VALUE (elt);
! 	    HOST_WIDE_INT startb, endb;
! 	    rtx bitlength_rtx, startbit_rtx, endbit_rtx, targetx;
! 	    
! 	    bitlength_rtx = expand_expr (bitlength,
! 					 NULL_RTX, MEM, EXPAND_CONST_ADDRESS);
! 	    
! 	    /* Handle non-range tuple element like [ expr ].  */
! 	    if (startbit == NULL_TREE)
! 	      {
! 		startbit = save_expr (endbit);
! 		endbit = startbit;
! 	      }
! 	    
! 	    startbit = convert (sizetype, startbit);
! 	    endbit = convert (sizetype, endbit);
! 	    if (! integer_zerop (domain_min))
! 	      {
! 		startbit = size_binop (MINUS_EXPR, startbit, domain_min);
! 		endbit = size_binop (MINUS_EXPR, endbit, domain_min);
! 	      }
! 	    startbit_rtx = expand_expr (startbit, NULL_RTX, MEM,
! 					EXPAND_CONST_ADDRESS);
! 	    endbit_rtx = expand_expr (endbit, NULL_RTX, MEM,
! 				      EXPAND_CONST_ADDRESS);
! 	    
! 	    if (REG_P (target))
! 	      {
! 		targetx
! 		  = assign_temp
! 		  ((build_qualified_type (lang_hooks.types.type_for_mode
! 					  (GET_MODE (target), 0),
! 					  TYPE_QUAL_CONST)),
! 		   0, 1, 1);
! 		emit_move_insn (targetx, target);
! 	      }
! 	    
! 	    else
! 	      {
! 		gcc_assert (MEM_P (target));
! 		targetx = target;
! 	      }
! 
! 	    /* Optimization:  If startbit and endbit are constants divisible
! 	       by BITS_PER_UNIT, call memset instead.  */
! 	    if (TREE_CODE (startbit) == INTEGER_CST
! 		&& TREE_CODE (endbit) == INTEGER_CST
! 		&& (startb = TREE_INT_CST_LOW (startbit)) % BITS_PER_UNIT == 0
! 		&& (endb = TREE_INT_CST_LOW (endbit) + 1) % BITS_PER_UNIT == 0)
! 	      {
! 		emit_library_call (memset_libfunc, LCT_NORMAL,
! 				   VOIDmode, 3,
! 				   plus_constant (XEXP (targetx, 0),
! 						  startb / BITS_PER_UNIT),
! 				   Pmode,
! 				   constm1_rtx, TYPE_MODE (integer_type_node),
! 				   GEN_INT ((endb - startb) / BITS_PER_UNIT),
! 				   TYPE_MODE (sizetype));
! 	      }
! 	    else
! 	      emit_library_call (setbits_libfunc, LCT_NORMAL,
! 				 VOIDmode, 4, XEXP (targetx, 0),
! 				 Pmode, bitlength_rtx, TYPE_MODE (sizetype),
! 				 startbit_rtx, TYPE_MODE (sizetype),
! 				 endbit_rtx, TYPE_MODE (sizetype));
! 	    
! 	    if (REG_P (target))
! 	      emit_move_insn (target, targetx);
! 	  }
! 	break;
!       }
      default:
        gcc_unreachable ();
      }
--- 5006,5012 ----
  					gen_rtvec_v (n_elts, vector))));
  	break;
        }
!       
      default:
        gcc_unreachable ();
      }
Index: print-tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/print-tree.c,v
retrieving revision 1.96
diff -c -3 -p -r1.96 print-tree.c
*** print-tree.c	8 Dec 2004 06:39:00 -0000	1.96
--- print-tree.c	8 Dec 2004 17:47:25 -0000
*************** print_node (FILE *file, const char *pref
*** 537,543 ****
  
        if (TREE_CODE (node) == ENUMERAL_TYPE)
  	print_node (file, "values", TYPE_VALUES (node), indent + 4);
!       else if (TREE_CODE (node) == ARRAY_TYPE || TREE_CODE (node) == SET_TYPE)
  	print_node (file, "domain", TYPE_DOMAIN (node), indent + 4);
        else if (TREE_CODE (node) == VECTOR_TYPE)
  	fprintf (file, " nunits %d", (int) TYPE_VECTOR_SUBPARTS (node));
--- 537,543 ----
  
        if (TREE_CODE (node) == ENUMERAL_TYPE)
  	print_node (file, "values", TYPE_VALUES (node), indent + 4);
!       else if (TREE_CODE (node) == ARRAY_TYPE)
  	print_node (file, "domain", TYPE_DOMAIN (node), indent + 4);
        else if (TREE_CODE (node) == VECTOR_TYPE)
  	fprintf (file, " nunits %d", (int) TYPE_VECTOR_SUBPARTS (node));
Index: stor-layout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stor-layout.c,v
retrieving revision 1.217
diff -c -3 -p -r1.217 stor-layout.c
*** stor-layout.c	20 Oct 2004 13:14:01 -0000	1.217
--- stor-layout.c	8 Dec 2004 17:47:31 -0000
*************** layout_type (tree type)
*** 1763,1802 ****
        }
        break;
  
-     case SET_TYPE:  /* Used by Chill and Pascal.  */
-       {
- 	unsigned int alignment;
- 	HOST_WIDE_INT size_in_bits;
- 	HOST_WIDE_INT rounded_size;
- 
- 	gcc_assert (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
- 		    == INTEGER_CST);
- 	gcc_assert (TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (type)))
- 		    == INTEGER_CST);
- 
- #ifndef SET_WORD_SIZE
- #define SET_WORD_SIZE BITS_PER_WORD
- #endif
- 	alignment = set_alignment ? set_alignment : SET_WORD_SIZE;
- 	size_in_bits
- 	  = (tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 0)
- 	     - tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0) + 1);
- 	rounded_size
- 	  = ((size_in_bits + alignment - 1) / alignment) * alignment;
- 
- 	if (rounded_size > (int) alignment)
- 	  TYPE_MODE (type) = BLKmode;
- 	else
- 	  TYPE_MODE (type) = mode_for_size (alignment, MODE_INT, 1);
- 
- 	TYPE_SIZE (type) = bitsize_int (rounded_size);
- 	TYPE_SIZE_UNIT (type) = size_int (rounded_size / BITS_PER_UNIT);
- 	TYPE_ALIGN (type) = alignment;
- 	TYPE_USER_ALIGN (type) = 0;
- 	TYPE_PRECISION (type) = size_in_bits;
-       }
-       break;
- 
      case FILE_TYPE:
        /* The size may vary in different languages, so the language front end
  	 should fill in the size.  */
--- 1763,1768 ----
Index: tree-browser.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-browser.c,v
retrieving revision 2.3
diff -c -3 -p -r2.3 tree-browser.c
*** tree-browser.c	17 Sep 2004 21:54:37 -0000	2.3
--- tree-browser.c	8 Dec 2004 17:47:32 -0000
*************** browse_tree (tree begin)
*** 309,316 ****
  	  break;
  
  	case TB_DOMAIN:
! 	  if (head && (TREE_CODE (head) == ARRAY_TYPE
! 		       || TREE_CODE (head) == SET_TYPE))
  	    TB_SET_HEAD (TYPE_DOMAIN (head));
  	  else
  	    TB_WF;
--- 309,315 ----
  	  break;
  
  	case TB_DOMAIN:
! 	  if (head && TREE_CODE (head) == ARRAY_TYPE)
  	    TB_SET_HEAD (TYPE_DOMAIN (head));
  	  else
  	    TB_WF;
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.154
diff -c -3 -p -r1.154 tree-inline.c
*** tree-inline.c	7 Dec 2004 21:23:04 -0000	1.154
--- tree-inline.c	8 Dec 2004 17:47:37 -0000
*************** remap_type (tree type, inline_data *id)
*** 323,329 ****
        break;
  
      case FILE_TYPE:
-     case SET_TYPE:
      case OFFSET_TYPE:
      default:
        /* Shouldn't have been thought variable sized.  */
--- 323,328 ----
Index: tree-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-pretty-print.c,v
retrieving revision 2.51
diff -c -3 -p -r2.51 tree-pretty-print.c
*** tree-pretty-print.c	8 Dec 2004 02:04:57 -0000	2.51
--- tree-pretty-print.c	8 Dec 2004 17:47:41 -0000
*************** dump_generic_node (pretty_printer *buffe
*** 461,470 ****
  	break;
        }
  
-     case SET_TYPE:
-       NIY;
-       break;
- 
      case RECORD_TYPE:
      case UNION_TYPE:
      case QUAL_UNION_TYPE:
--- 461,466 ----
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.455
diff -c -3 -p -r1.455 tree.c
*** tree.c	8 Dec 2004 06:39:00 -0000	1.455
--- tree.c	8 Dec 2004 17:47:53 -0000
*************** type_contains_placeholder_1 (tree type)
*** 1888,1894 ****
  	      || CONTAINS_PLACEHOLDER_P (TYPE_MAX_VALUE (type)));
  
      case ARRAY_TYPE:
-     case SET_TYPE:
      case VECTOR_TYPE:
        /* We're already checked the component type (TREE_TYPE), so just check
  	 the index type.  */
--- 1888,1893 ----
*************** type_hash_eq (const void *va, const void
*** 3475,3481 ****
  					  TYPE_ARG_TYPES (b->type)))));
  
      case ARRAY_TYPE:
-     case SET_TYPE:
        return TYPE_DOMAIN (a->type) == TYPE_DOMAIN (b->type);
  
      case RECORD_TYPE:
--- 3474,3479 ----
*************** variably_modified_type_p (tree type, tre
*** 4984,4990 ****
      case POINTER_TYPE:
      case REFERENCE_TYPE:
      case ARRAY_TYPE:
-     case SET_TYPE:
      case VECTOR_TYPE:
        if (variably_modified_type_p (TREE_TYPE (type), fn))
  	return true;
--- 4982,4987 ----
*************** initializer_zerop (tree init)
*** 5871,5880 ****
        if (elt == NULL_TREE)
  	return true;
  
-       /* A set is empty only if it has no elements.  */
-       if (TREE_CODE (TREE_TYPE (init)) == SET_TYPE)
- 	return false;
- 
        for (; elt ; elt = TREE_CHAIN (elt))
  	if (! initializer_zerop (TREE_VALUE (elt)))
  	  return false;
--- 5868,5873 ----
Index: tree.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.def,v
retrieving revision 1.104
diff -c -3 -p -r1.104 tree.def
*** tree.def	24 Nov 2004 11:41:33 -0000	1.104
--- tree.def	8 Dec 2004 17:47:56 -0000
*************** DEFTREECODE (FILE_TYPE, "file_type", tcc
*** 200,211 ****
  /* Array types in C or Pascal */
  DEFTREECODE (ARRAY_TYPE, "array_type", tcc_type, 0)
  
- /* Types of sets for Pascal.  Special fields are the same as
-    in an array type.  The target type is always a boolean type.
-    Used for both bitstrings and powersets in Chill;
-    TYPE_STRING_FLAG indicates a bitstring.  */
- DEFTREECODE (SET_TYPE, "set_type", tcc_type, 0)
- 
  /* Struct in C, or record in Pascal.  */
  /* Special fields:
     TYPE_FIELDS  chain of FIELD_DECLs for the fields of the struct,
--- 200,205 ----
*************** DEFTREECODE (FILTER_EXPR, "filter_expr",
*** 409,415 ****
  
  /* Constructor: return an aggregate value made from specified components.
     In C, this is used only for structure and array initializers.
-    Also used for SET_TYPE in Chill (and potentially Pascal).
     The operand is a list of component values made out of a chain of
     TREE_LIST nodes.
  
--- 403,408 ----
*************** DEFTREECODE (FILTER_EXPR, "filter_expr",
*** 421,432 ****
     value in a SAVE_EXPR if you want to evaluate side effects only once.)
  
     For RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE:
!    The TREE_PURPOSE of each node is a FIELD_DECL.
! 
!    For SET_TYPE:
!    The TREE_VALUE specifies a value (index) in the set that is true.
!    If TREE_PURPOSE is non-NULL, it specifies the lower limit of a
!    range of true values.  Elements not listed are false (not in the set).  */
  DEFTREECODE (CONSTRUCTOR, "constructor", tcc_expression, 1)
  
  /* The expression types are mostly straightforward, with the fourth argument
--- 414,420 ----
     value in a SAVE_EXPR if you want to evaluate side effects only once.)
  
     For RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE:
!    The TREE_PURPOSE of each node is a FIELD_DECL.  */
  DEFTREECODE (CONSTRUCTOR, "constructor", tcc_expression, 1)
  
  /* The expression types are mostly straightforward, with the fourth argument
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.664
diff -c -3 -p -r1.664 tree.h
*** tree.h	7 Dec 2004 21:23:04 -0000	1.664
--- tree.h	8 Dec 2004 17:48:06 -0000
*************** extern void tree_operand_check_failed (i
*** 648,656 ****
  #define FUNC_OR_METHOD_CHECK(T)	TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE)
  #define PTR_OR_REF_CHECK(T)	TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE)
  
- #define SET_OR_ARRAY_CHECK(T) \
-   TREE_CHECK2 (T, ARRAY_TYPE, SET_TYPE)
- 
  #define RECORD_OR_UNION_CHECK(T)	\
    TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
  #define NOT_RECORD_OR_UNION_CHECK(T) \
--- 648,653 ----
*************** extern void tree_operand_check_failed (i
*** 773,780 ****
  
  #define AGGREGATE_TYPE_P(TYPE) \
    (TREE_CODE (TYPE) == ARRAY_TYPE || TREE_CODE (TYPE) == RECORD_TYPE \
!    || TREE_CODE (TYPE) == UNION_TYPE || TREE_CODE (TYPE) == QUAL_UNION_TYPE \
!    || TREE_CODE (TYPE) == SET_TYPE)
  
  /* Nonzero if TYPE represents a pointer or reference type.
     (It should be renamed to INDIRECT_TYPE_P.)  */
--- 770,776 ----
  
  #define AGGREGATE_TYPE_P(TYPE) \
    (TREE_CODE (TYPE) == ARRAY_TYPE || TREE_CODE (TYPE) == RECORD_TYPE \
!    || TREE_CODE (TYPE) == UNION_TYPE || TREE_CODE (TYPE) == QUAL_UNION_TYPE)
  
  /* Nonzero if TYPE represents a pointer or reference type.
     (It should be renamed to INDIRECT_TYPE_P.)  */
*************** struct tree_block GTY(())
*** 1476,1482 ****
  #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
  #define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
  #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
! #define TYPE_DOMAIN(NODE) (SET_OR_ARRAY_CHECK (NODE)->type.values)
  #define TYPE_FIELDS(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.values)
  #define TYPE_CACHED_VALUES(NODE) (TYPE_CHECK(NODE)->type.values)
  #define TYPE_ORIG_SIZE_TYPE(NODE)			\
--- 1472,1478 ----
  #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
  #define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
  #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
! #define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type.values)
  #define TYPE_FIELDS(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.values)
  #define TYPE_CACHED_VALUES(NODE) (TYPE_CHECK(NODE)->type.values)
  #define TYPE_ORIG_SIZE_TYPE(NODE)			\
Index: typeclass.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/typeclass.h,v
retrieving revision 1.4
diff -c -3 -p -r1.4 typeclass.h
*** typeclass.h	11 Jun 2004 05:31:09 -0000	1.4
--- typeclass.h	8 Dec 2004 17:48:06 -0000
*************** enum type_class
*** 39,45 ****
    real_type_class, complex_type_class,
    function_type_class, method_type_class,
    record_type_class, union_type_class,
!   array_type_class, string_type_class, set_type_class, file_type_class,
    lang_type_class
  };
  
--- 39,45 ----
    real_type_class, complex_type_class,
    function_type_class, method_type_class,
    record_type_class, union_type_class,
!   array_type_class, string_type_class, file_type_class,
    lang_type_class
  };
  
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.466
diff -c -3 -p -r1.466 varasm.c
*** varasm.c	2 Dec 2004 19:56:26 -0000	1.466
--- varasm.c	8 Dec 2004 17:48:15 -0000
*************** const_hash_1 (const tree exp)
*** 2258,2285 ****
  	      + const_hash_1 (TREE_IMAGPART (exp)));
  
      case CONSTRUCTOR:
!       if (TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
! 	{
! 	  char *tmp;
! 
! 	  len = int_size_in_bytes (TREE_TYPE (exp));
! 	  tmp = alloca (len);
! 	  get_set_constructor_bytes (exp, (unsigned char *) tmp, len);
! 	  p = tmp;
! 	  break;
! 	}
!       else
! 	{
! 	  tree link;
! 
! 	  hi = 5 + int_size_in_bytes (TREE_TYPE (exp));
! 
! 	  for (link = CONSTRUCTOR_ELTS (exp); link; link = TREE_CHAIN (link))
! 	    if (TREE_VALUE (link))
! 	      hi = hi * 603 + const_hash_1 (TREE_VALUE (link));
! 
! 	  return hi;
! 	}
  
      case ADDR_EXPR:
      case FDESC_EXPR:
--- 2258,2274 ----
  	      + const_hash_1 (TREE_IMAGPART (exp)));
  
      case CONSTRUCTOR:
!       {
! 	tree link;
! 	
! 	hi = 5 + int_size_in_bytes (TREE_TYPE (exp));
! 	
! 	for (link = CONSTRUCTOR_ELTS (exp); link; link = TREE_CHAIN (link))
! 	  if (TREE_VALUE (link))
! 	    hi = hi * 603 + const_hash_1 (TREE_VALUE (link));
! 	
! 	return hi;
!       }
  
      case ADDR_EXPR:
      case FDESC_EXPR:
*************** compare_constant (const tree t1, const t
*** 2378,2449 ****
  	      && compare_constant (TREE_IMAGPART (t1), TREE_IMAGPART (t2)));
  
      case CONSTRUCTOR:
!       typecode = TREE_CODE (TREE_TYPE (t1));
!       if (typecode != TREE_CODE (TREE_TYPE (t2)))
! 	return 0;
! 
!       if (typecode == SET_TYPE)
! 	{
! 	  int len = int_size_in_bytes (TREE_TYPE (t2));
! 	  unsigned char *tmp1, *tmp2;
! 
! 	  if (int_size_in_bytes (TREE_TYPE (t1)) != len)
! 	    return 0;
! 
! 	  tmp1 = alloca (len);
! 	  tmp2 = alloca (len);
! 
! 	  if (get_set_constructor_bytes (t1, tmp1, len) != NULL_TREE)
! 	    return 0;
! 	  if (get_set_constructor_bytes (t2, tmp2, len) != NULL_TREE)
! 	    return 0;
! 
! 	  return memcmp (tmp1, tmp2, len) == 0;
! 	}
!       else
! 	{
! 	  tree l1, l2;
! 
! 	  if (typecode == ARRAY_TYPE)
! 	    {
! 	      HOST_WIDE_INT size_1 = int_size_in_bytes (TREE_TYPE (t1));
! 	      /* For arrays, check that the sizes all match.  */
! 	      if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2))
! 		  || size_1 == -1
! 		  || size_1 != int_size_in_bytes (TREE_TYPE (t2)))
! 		return 0;
! 	    }
! 	  else
! 	    {
! 	      /* For record and union constructors, require exact type
!                  equality.  */
! 	      if (TREE_TYPE (t1) != TREE_TYPE (t2))
! 		return 0;
! 	    }
  
! 	  for (l1 = CONSTRUCTOR_ELTS (t1), l2 = CONSTRUCTOR_ELTS (t2);
! 	       l1 && l2;
! 	       l1 = TREE_CHAIN (l1), l2 = TREE_CHAIN (l2))
! 	    {
! 	      /* Check that each value is the same...  */
! 	      if (! compare_constant (TREE_VALUE (l1), TREE_VALUE (l2)))
! 		return 0;
! 	      /* ... and that they apply to the same fields!  */
! 	      if (typecode == ARRAY_TYPE)
! 		{
! 		  if (! compare_constant (TREE_PURPOSE (l1),
! 					  TREE_PURPOSE (l2)))
! 		    return 0;
! 		}
! 	      else
! 		{
! 		  if (TREE_PURPOSE (l1) != TREE_PURPOSE (l2))
! 		    return 0;
! 		}
! 	    }
  
! 	  return l1 == NULL_TREE && l2 == NULL_TREE;
! 	}
  
      case ADDR_EXPR:
      case FDESC_EXPR:
--- 2367,2419 ----
  	      && compare_constant (TREE_IMAGPART (t1), TREE_IMAGPART (t2)));
  
      case CONSTRUCTOR:
!       {
! 	tree l1, l2;
! 	
! 	typecode = TREE_CODE (TREE_TYPE (t1));
! 	if (typecode != TREE_CODE (TREE_TYPE (t2)))
! 	  return 0;
  
! 	if (typecode == ARRAY_TYPE)
! 	  {
! 	    HOST_WIDE_INT size_1 = int_size_in_bytes (TREE_TYPE (t1));
! 	    /* For arrays, check that the sizes all match.  */
! 	    if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2))
! 		|| size_1 == -1
! 		|| size_1 != int_size_in_bytes (TREE_TYPE (t2)))
! 	      return 0;
! 	  }
! 	else
! 	  {
! 	    /* For record and union constructors, require exact type
!                equality.  */
! 	    if (TREE_TYPE (t1) != TREE_TYPE (t2))
! 	      return 0;
! 	  }
  
! 	for (l1 = CONSTRUCTOR_ELTS (t1), l2 = CONSTRUCTOR_ELTS (t2);
! 	     l1 && l2;
! 	     l1 = TREE_CHAIN (l1), l2 = TREE_CHAIN (l2))
! 	  {
! 	    /* Check that each value is the same...  */
! 	    if (! compare_constant (TREE_VALUE (l1), TREE_VALUE (l2)))
! 	      return 0;
! 	    /* ... and that they apply to the same fields!  */
! 	    if (typecode == ARRAY_TYPE)
! 	      {
! 		if (! compare_constant (TREE_PURPOSE (l1),
! 					TREE_PURPOSE (l2)))
! 		  return 0;
! 	      }
! 	    else
! 	      {
! 		if (TREE_PURPOSE (l1) != TREE_PURPOSE (l2))
! 		  return 0;
! 	      }
! 	  }
! 	
! 	return l1 == NULL_TREE && l2 == NULL_TREE;
!       }
  
      case ADDR_EXPR:
      case FDESC_EXPR:
*************** copy_constant (tree exp)
*** 2533,2541 ****
  	CONSTRUCTOR_ELTS (copy) = list;
  	for (tail = list; tail; tail = TREE_CHAIN (tail))
  	  TREE_VALUE (tail) = copy_constant (TREE_VALUE (tail));
- 	if (TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
- 	  for (tail = list; tail; tail = TREE_CHAIN (tail))
- 	    TREE_PURPOSE (tail) = copy_constant (TREE_PURPOSE (tail));
  
  	return copy;
        }
--- 2503,2508 ----
*************** output_constant (tree exp, unsigned HOST
*** 3798,3819 ****
  	abort ();
        return;
  
-     case SET_TYPE:
-       if (TREE_CODE (exp) == INTEGER_CST)
- 	assemble_integer (expand_expr (exp, NULL_RTX,
- 				       VOIDmode, EXPAND_INITIALIZER),
- 			  thissize, align, 1);
-       else if (TREE_CODE (exp) == CONSTRUCTOR)
- 	{
- 	  unsigned char *buffer = alloca (thissize);
- 	  if (get_set_constructor_bytes (exp, buffer, thissize))
- 	    abort ();
- 	  assemble_string ((char *) buffer, thissize);
- 	}
-       else
- 	error ("unknown set constructor type");
-       return;
- 
      case ERROR_MARK:
        return;
  
--- 3765,3770 ----
Index: ada/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/decl.c,v
retrieving revision 1.62
diff -c -3 -p -r1.62 decl.c
*** ada/decl.c	8 Dec 2004 11:26:19 -0000	1.62
--- ada/decl.c	8 Dec 2004 17:48:33 -0000
*************** gnat_substitute_in_type (tree t, tree f,
*** 6276,6282 ****
      case OFFSET_TYPE:
      case METHOD_TYPE:
      case FILE_TYPE:
-     case SET_TYPE:
      case FUNCTION_TYPE:
      case LANG_TYPE:
        /* Don't know how to do these yet.  */
--- 6276,6281 ----
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.750
diff -c -3 -p -r1.750 i386.c
*** config/i386/i386.c	8 Dec 2004 07:54:43 -0000	1.750
--- config/i386/i386.c	8 Dec 2004 17:49:10 -0000
*************** classify_argument (enum machine_mode mod
*** 2255,2285 ****
  		}
  	    }
  	}
-       else if (TREE_CODE (type) == SET_TYPE)
- 	{
- 	  if (bytes <= 4)
- 	    {
- 	      classes[0] = X86_64_INTEGERSI_CLASS;
- 	      return 1;
- 	    }
- 	  else if (bytes <= 8)
- 	    {
- 	      classes[0] = X86_64_INTEGER_CLASS;
- 	      return 1;
- 	    }
- 	  else if (bytes <= 12)
- 	    {
- 	      classes[0] = X86_64_INTEGER_CLASS;
- 	      classes[1] = X86_64_INTEGERSI_CLASS;
- 	      return 2;
- 	    }
- 	  else
- 	    {
- 	      classes[0] = X86_64_INTEGER_CLASS;
- 	      classes[1] = X86_64_INTEGER_CLASS;
- 	      return 2;
- 	    }
- 	}
        else
  	abort ();
  
--- 2255,2260 ----
Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.333
diff -c -3 -p -r1.333 ia64.c
*** config/ia64/ia64.c	8 Dec 2004 00:20:49 -0000	1.333
--- config/ia64/ia64.c	8 Dec 2004 17:49:27 -0000
*************** hfa_element_mode (tree type, int nested)
*** 2975,2982 ****
      case VOID_TYPE:	case INTEGER_TYPE:	case ENUMERAL_TYPE:
      case BOOLEAN_TYPE:	case CHAR_TYPE:		case POINTER_TYPE:
      case OFFSET_TYPE:	case REFERENCE_TYPE:	case METHOD_TYPE:
!     case FILE_TYPE:	case SET_TYPE:		case LANG_TYPE:
!     case FUNCTION_TYPE:
        return VOIDmode;
  
        /* Fortran complex types are supposed to be HFAs, so we need to handle
--- 2975,2981 ----
      case VOID_TYPE:	case INTEGER_TYPE:	case ENUMERAL_TYPE:
      case BOOLEAN_TYPE:	case CHAR_TYPE:		case POINTER_TYPE:
      case OFFSET_TYPE:	case REFERENCE_TYPE:	case METHOD_TYPE:
!     case FILE_TYPE:	case LANG_TYPE:		case FUNCTION_TYPE:
        return VOIDmode;
  
        /* Fortran complex types are supposed to be HFAs, so we need to handle
Index: config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.347
diff -c -3 -p -r1.347 sparc.c
*** config/sparc/sparc.c	26 Nov 2004 19:21:15 -0000	1.347
--- config/sparc/sparc.c	8 Dec 2004 17:49:46 -0000
*************** sparc_type_code (register tree type)
*** 7709,7715 ****
  	case CHAR_TYPE:		/* GNU Pascal CHAR type.  Not used in C.  */
  	case BOOLEAN_TYPE:	/* GNU Fortran BOOLEAN type.  */
  	case FILE_TYPE:		/* GNU Pascal FILE type.  */
- 	case SET_TYPE:		/* GNU Pascal SET type.  */
  	case LANG_TYPE:		/* ? */
  	  return qualifiers;
    
--- 7709,7714 ----

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