First part of TREE_UNSIGNED cleanup

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Thu Apr 1 03:58:00 GMT 2004


This changes most uses of TREE_UNSIGNED to TYPE_UNSIGNED and makes some
small related changes to that.

Tested on x86_64-linux.

2004-03-31  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* builtins.c, c-aux-info.c, c-common.c, c-cppbuiltin.c, c-decl.c:
	Change most occurrences of TREE_UNSIGNED to TYPE_UNSIGNED.
	* c-format.c, c-opts.c, c-pretty-print.c, c-typeck.c: Likewise.
	* calls.c, convert.c, dbxout.c, dojump.c, dwarf2out.c: Likewise.
	* expmed.c, expr.c, fold-const.c, function.c, integrate.c: Likewise.
	* optabs.c, sdbout.c, stmt.c, stor-layout.c, tree-dump.c: Likewise.
	* tree.c, config/iq2000/iq2000.c, config/m32r/m32r.c: Likewise.
	* config/mips/mips.c, config/rs6000/rs6000.c: Likewise.
	* config/s390/s390.c, config/sparc/sparc.c, objc/objc-act.c: Likewise.
	* expr.c (expand_expr_real): Check unsigned after sure not ERROR_MARK.
	* fold-const.c (operand_equal_p): Test for ERROR_MARK.
	* stor-layout.c (layout_type, case COMPLEX_TYPE): Test for
	REAL_TYPE, not INTEGER_TYPE.
	(layout_type, case VECTOR_TYPE): Simplify code.
	* tree.c (build_vector_type_for_mode): Remove dup unsigned setting.
	* tree.h: Update comments.
	(STRIP_NOPS): Use TYPE_UNSIGNED.
	(TYPE_UNSIGNED): New macro.
	(TYPE_TRAP_SIGNED): Remove now redundant check.
	(SAVE_EXPR_NOPLACEHOLDER): Don't use TREE_UNSIGNED.

	* cp/call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
	* cp/class.c (check_bitfield_decl): Likewise.
	* cp/cvt.c (type_promotes_to): Likewise.
	* cp/decl.c (finish_enum): Likewise.
	* cp/mangle.c (write_builtin_type): Likewise.
	* cp/semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
	* cp/typeck.c (type_after_usual_arithmetic_conversions): Likewise.
	(build_binary_op): Likewise.

	* f/com.c (ffecom_arrayref_): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
	(ffecom_expr_): Likewise.

	* java/jcf-write.c (generate_bytecode_insns): Use TYPE_UNSIGNED.

	* treelang/treetree.c (tree_lang_signed_or_unsigned_type):
	Use TYPE_UNSIGNED, not TREE_UNSIGNED.

	* ada/decl.c (gnat_to_gnu_entity, make_type_from_size):
	Use TYPE_UNSIGNED, not TREE_UNSIGNED.
	* ada/trans.c (tree_transform, convert_with_check): Likewise.
	* ada/utils.c (gnat_signed_or_unsigned_type): Likewise.
	(build_vms_descriptor, unchecked_convert): Likewise.
	* ada/utils2.c (nonbinary_modular_operation): Likewise.

*** builtins.c	26 Mar 2004 00:29:25 -0000	1.300
--- builtins.c	31 Mar 2004 20:43:27 -0000
*************** expand_builtin_memcmp (tree exp ATTRIBUT
*** 3167,3171 ****
  			       XEXP (arg2_rtx, 0), Pmode,
  			       convert_to_mode (TYPE_MODE (sizetype), arg3_rtx,
! 						TREE_UNSIGNED (sizetype)),
  			       TYPE_MODE (sizetype));
  
--- 3167,3171 ----
  			       XEXP (arg2_rtx, 0), Pmode,
  			       convert_to_mode (TYPE_MODE (sizetype), arg3_rtx,
! 						TYPE_UNSIGNED (sizetype)),
  			       TYPE_MODE (sizetype));
  
*** c-aux-info.c	28 Mar 2004 00:31:38 -0000	1.27
--- c-aux-info.c	31 Mar 2004 20:43:28 -0000
*************** gen_type (const char *ret_val, tree t, f
*** 431,435 ****
            /* Normally, `unsigned' is part of the deal.  Not so if it comes
  	     with a type qualifier.  */
!           if (TREE_UNSIGNED (t) && TYPE_QUALS (t))
  	    data_type = concat ("unsigned ", data_type, NULL);
  	  break;
--- 431,435 ----
            /* Normally, `unsigned' is part of the deal.  Not so if it comes
  	     with a type qualifier.  */
!           if (TYPE_UNSIGNED (t) && TYPE_QUALS (t))
  	    data_type = concat ("unsigned ", data_type, NULL);
  	  break;
*** c-common.c	23 Mar 2004 20:43:38 -0000	1.493
--- c-common.c	31 Mar 2004 20:43:32 -0000
*************** unsigned_conversion_warning (tree result
*** 1249,1253 ****
    if (TREE_CODE (operand) == INTEGER_CST
        && TREE_CODE (type) == INTEGER_TYPE
!       && TREE_UNSIGNED (type)
        && skip_evaluation == 0
        && !int_fits_type_p (operand, type))
--- 1249,1253 ----
    if (TREE_CODE (operand) == INTEGER_CST
        && TREE_CODE (type) == INTEGER_TYPE
!       && TYPE_UNSIGNED (type)
        && skip_evaluation == 0
        && !int_fits_type_p (operand, type))
*************** convert_and_check (tree type, tree expr)
*** 1293,1297 ****
  
  	  /* No warning for converting 0x80000000 to int.  */
! 	  if (!(TREE_UNSIGNED (type) < TREE_UNSIGNED (TREE_TYPE (expr))
  		&& TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE
  		&& TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (expr))))
--- 1293,1297 ----
  
  	  /* No warning for converting 0x80000000 to int.  */
! 	  if (!(TYPE_UNSIGNED (type) < TYPE_UNSIGNED (TREE_TYPE (expr))
  		&& TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE
  		&& TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (expr))))
*************** convert_and_check (tree type, tree expr)
*** 1299,1303 ****
  	       don't warn unless pedantic.  */
  	    if ((pedantic
! 		 || TREE_UNSIGNED (type)
  		 || ! constant_fits_type_p (expr,
  					    c_common_unsigned_type (type)))
--- 1299,1303 ----
  	       don't warn unless pedantic.  */
  	    if ((pedantic
! 		 || TYPE_UNSIGNED (type)
  		 || ! constant_fits_type_p (expr,
  					    c_common_unsigned_type (type)))
*************** c_common_signed_or_unsigned_type (int un
*** 1964,1968 ****
  {
    if (! INTEGRAL_TYPE_P (type)
!       || TREE_UNSIGNED (type) == unsignedp)
      return type;
  
--- 1964,1968 ----
  {
    if (! INTEGRAL_TYPE_P (type)
!       || TYPE_UNSIGNED (type) == unsignedp)
      return type;
  
*************** shorten_compare (tree *op0_ptr, tree *op
*** 2149,2155 ****
  
    if (op0 == primop0 && TREE_TYPE (op0) != *restype_ptr)
!     unsignedp0 = TREE_UNSIGNED (TREE_TYPE (op0));
    if (op1 == primop1 && TREE_TYPE (op1) != *restype_ptr)
!     unsignedp1 = TREE_UNSIGNED (TREE_TYPE (op1));
  
    /* If one of the operands must be floated, we cannot optimize.  */
--- 2149,2155 ----
  
    if (op0 == primop0 && TREE_TYPE (op0) != *restype_ptr)
!     unsignedp0 = TYPE_UNSIGNED (TREE_TYPE (op0));
    if (op1 == primop1 && TREE_TYPE (op1) != *restype_ptr)
!     unsignedp1 = TYPE_UNSIGNED (TREE_TYPE (op1));
  
    /* If one of the operands must be floated, we cannot optimize.  */
*************** shorten_compare (tree *op0_ptr, tree *op
*** 2223,2227 ****
        tree maxval, minval;
        /* 1 if comparison is nominally unsigned.  */
!       int unsignedp = TREE_UNSIGNED (*restype_ptr);
        tree val;
  
--- 2223,2227 ----
        tree maxval, minval;
        /* 1 if comparison is nominally unsigned.  */
!       int unsignedp = TYPE_UNSIGNED (*restype_ptr);
        tree val;
  
*************** shorten_compare (tree *op0_ptr, tree *op
*** 2380,2384 ****
        type = common_type (TREE_TYPE (primop0), TREE_TYPE (primop1));
        type = c_common_signed_or_unsigned_type (unsignedp0
! 					       || TREE_UNSIGNED (*restype_ptr),
  					       type);
        /* Make sure shorter operand is extended the right way
--- 2380,2384 ----
        type = common_type (TREE_TYPE (primop0), TREE_TYPE (primop1));
        type = c_common_signed_or_unsigned_type (unsignedp0
! 					       || TYPE_UNSIGNED (*restype_ptr),
  					       type);
        /* Make sure shorter operand is extended the right way
*************** shorten_compare (tree *op0_ptr, tree *op
*** 2402,2406 ****
  
        if (!real1 && !real2 && integer_zerop (primop1)
! 	  && TREE_UNSIGNED (*restype_ptr))
  	{
  	  tree value = 0;
--- 2402,2406 ----
  
        if (!real1 && !real2 && integer_zerop (primop1)
! 	  && TYPE_UNSIGNED (*restype_ptr))
  	{
  	  tree value = 0;
*************** pointer_int_sum (enum tree_code resultco
*** 2503,2507 ****
  	 then we must skip this optimization.  This is because it could cause
  	 an overflow error if the constant is negative but INTOP is not.  */
!       && (! TREE_UNSIGNED (TREE_TYPE (intop))
  	  || (TYPE_PRECISION (TREE_TYPE (intop))
  	      == TYPE_PRECISION (TREE_TYPE (ptrop)))))
--- 2503,2507 ----
  	 then we must skip this optimization.  This is because it could cause
  	 an overflow error if the constant is negative but INTOP is not.  */
!       && (! TYPE_UNSIGNED (TREE_TYPE (intop))
  	  || (TYPE_PRECISION (TREE_TYPE (intop))
  	      == TYPE_PRECISION (TREE_TYPE (ptrop)))))
*************** pointer_int_sum (enum tree_code resultco
*** 2523,2529 ****
  
    if (TYPE_PRECISION (TREE_TYPE (intop)) != TYPE_PRECISION (sizetype)
!       || TREE_UNSIGNED (TREE_TYPE (intop)) != TREE_UNSIGNED (sizetype))
      intop = convert (c_common_type_for_size (TYPE_PRECISION (sizetype),
! 					     TREE_UNSIGNED (sizetype)), intop);
  
    /* Replace the integer argument with a suitable product by the object size.
--- 2523,2529 ----
  
    if (TYPE_PRECISION (TREE_TYPE (intop)) != TYPE_PRECISION (sizetype)
!       || TYPE_UNSIGNED (TREE_TYPE (intop)) != TYPE_UNSIGNED (sizetype))
      intop = convert (c_common_type_for_size (TYPE_PRECISION (sizetype),
! 					     TYPE_UNSIGNED (sizetype)), intop);
  
    /* Replace the integer argument with a suitable product by the object size.
*************** c_common_get_alias_set (tree t)
*** 2822,2826 ****
       unsigned variants of the same type.  We treat the signed
       variant as canonical.  */
!   if (TREE_CODE (t) == INTEGER_TYPE && TREE_UNSIGNED (t))
      {
        tree t1 = c_common_signed_type (t);
--- 2822,2826 ----
       unsigned variants of the same type.  We treat the signed
       variant as canonical.  */
!   if (TREE_CODE (t) == INTEGER_TYPE && TYPE_UNSIGNED (t))
      {
        tree t1 = c_common_signed_type (t);
*************** c_common_nodes_and_builtins (void)
*** 3221,3225 ****
    if (c_dialect_cxx ())
      {
!       if (TREE_UNSIGNED (wchar_type_node))
  	wchar_type_node = make_unsigned_type (wchar_type_size);
        else
--- 3221,3225 ----
    if (c_dialect_cxx ())
      {
!       if (TYPE_UNSIGNED (wchar_type_node))
  	wchar_type_node = make_unsigned_type (wchar_type_size);
        else
*************** handle_mode_attribute (tree *node, tree 
*** 4609,4613 ****
  	}
  
!       typefm = lang_hooks.types.type_for_mode (mode, TREE_UNSIGNED (type));
        if (typefm == NULL_TREE)
  	error ("no data type for mode `%s'", p);
--- 4609,4613 ----
  	}
  
!       typefm = lang_hooks.types.type_for_mode (mode, TYPE_UNSIGNED (type));
        if (typefm == NULL_TREE)
  	error ("no data type for mode `%s'", p);
*** c-cppbuiltin.c	4 Mar 2004 10:23:23 -0000	1.18
--- c-cppbuiltin.c	31 Mar 2004 20:43:32 -0000
*************** c_cpp_builtins (cpp_reader *pfile)
*** 402,406 ****
      cpp_define (pfile, "__CHAR_UNSIGNED__");
  
!   if (c_dialect_cxx () && TREE_UNSIGNED (wchar_type_node))
      cpp_define (pfile, "__WCHAR_UNSIGNED__");
  
--- 402,406 ----
      cpp_define (pfile, "__CHAR_UNSIGNED__");
  
!   if (c_dialect_cxx () && TYPE_UNSIGNED (wchar_type_node))
      cpp_define (pfile, "__WCHAR_UNSIGNED__");
  
*************** builtin_define_type_max (const char *mac
*** 582,587 ****
      }
  
!   value = values[idx + TREE_UNSIGNED (type)];
!   suffix = suffixes[is_long * 2 + TREE_UNSIGNED (type)];
  
    buf = alloca (strlen (macro) + 1 + strlen (value) + strlen (suffix) + 1);
--- 582,587 ----
      }
  
!   value = values[idx + TYPE_UNSIGNED (type)];
!   suffix = suffixes[is_long * 2 + TYPE_UNSIGNED (type)];
  
    buf = alloca (strlen (macro) + 1 + strlen (value) + strlen (suffix) + 1);
*** c-decl.c	30 Mar 2004 19:18:48 -0000	1.492
--- c-decl.c	31 Mar 2004 20:43:36 -0000
*************** check_bitfield_type_and_width (tree *typ
*** 3296,3301 ****
  
    if (TREE_CODE (*type) == ENUMERAL_TYPE
!       && (w < min_precision (TYPE_MIN_VALUE (*type), TREE_UNSIGNED (*type))
! 	  || w < min_precision (TYPE_MAX_VALUE (*type), TREE_UNSIGNED (*type))))
      warning ("`%s' is narrower than values of its type", name);
  }
--- 3296,3302 ----
  
    if (TREE_CODE (*type) == ENUMERAL_TYPE
!       && (w < min_precision (TYPE_MIN_VALUE (*type), TYPE_UNSIGNED (*type))
! 	  || w < min_precision (TYPE_MAX_VALUE (*type),
! 				TYPE_UNSIGNED (*type))))
      warning ("`%s' is narrower than values of its type", name);
  }
*************** xref_tag (enum tree_code code, tree name
*** 4911,4915 ****
        TYPE_ALIGN (ref) = TYPE_ALIGN (unsigned_type_node);
        TYPE_USER_ALIGN (ref) = 0;
!       TREE_UNSIGNED (ref) = 1;
        TYPE_PRECISION (ref) = TYPE_PRECISION (unsigned_type_node);
        TYPE_MIN_VALUE (ref) = TYPE_MIN_VALUE (unsigned_type_node);
--- 4912,4916 ----
        TYPE_ALIGN (ref) = TYPE_ALIGN (unsigned_type_node);
        TYPE_USER_ALIGN (ref) = 0;
!       TYPE_UNSIGNED (ref) = 1;
        TYPE_PRECISION (ref) = TYPE_PRECISION (unsigned_type_node);
        TYPE_MIN_VALUE (ref) = TYPE_MIN_VALUE (unsigned_type_node);
*************** finish_enum (tree enumtype, tree values,
*** 5428,5432 ****
    TYPE_MAX_VALUE (enumtype) = maxnode;
    TYPE_PRECISION (enumtype) = precision;
!   TREE_UNSIGNED (enumtype) = unsign;
    TYPE_SIZE (enumtype) = 0;
    layout_type (enumtype);
--- 5429,5433 ----
    TYPE_MAX_VALUE (enumtype) = maxnode;
    TYPE_PRECISION (enumtype) = precision;
!   TYPE_UNSIGNED (enumtype) = unsign;
    TYPE_SIZE (enumtype) = 0;
    layout_type (enumtype);
*************** finish_enum (tree enumtype, tree values,
*** 5480,5484 ****
        TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype);
        TYPE_USER_ALIGN (tem) = TYPE_USER_ALIGN (enumtype);
!       TREE_UNSIGNED (tem) = TREE_UNSIGNED (enumtype);
      }
  
--- 5481,5485 ----
        TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype);
        TYPE_USER_ALIGN (tem) = TYPE_USER_ALIGN (enumtype);
!       TYPE_UNSIGNED (tem) = TYPE_UNSIGNED (enumtype);
      }
  
*************** build_enumerator (tree name, tree value)
*** 5552,5556 ****
  				 (TYPE_PRECISION (type)
  				  >= TYPE_PRECISION (integer_type_node)
! 				  && TREE_UNSIGNED (type)));
  
    decl = build_decl (CONST_DECL, name, type);
--- 5553,5557 ----
  				 (TYPE_PRECISION (type)
  				  >= TYPE_PRECISION (integer_type_node)
! 				  && TYPE_UNSIGNED (type)));
  
    decl = build_decl (CONST_DECL, name, type);
*************** start_function (tree declspecs, tree dec
*** 5771,5775 ****
      {
        /* It retains unsignedness if not really getting wider.  */
!       if (TREE_UNSIGNED (restype)
  	  && (TYPE_PRECISION (restype)
  		  == TYPE_PRECISION (integer_type_node)))
--- 5772,5776 ----
      {
        /* It retains unsignedness if not really getting wider.  */
!       if (TYPE_UNSIGNED (restype)
  	  && (TYPE_PRECISION (restype)
  		  == TYPE_PRECISION (integer_type_node)))
*** c-format.c	14 Mar 2004 22:26:00 -0000	1.52
--- c-format.c	31 Mar 2004 20:43:38 -0000
*************** check_format_types (int *status, format_
*** 2391,2395 ****
  	  && TREE_CODE (cur_type) == INTEGER_TYPE
  	  && (! pedantic || i == 0 || (i == 1 && char_type_flag))
! 	  && (TREE_UNSIGNED (wanted_type)
  	      ? wanted_type == c_common_unsigned_type (cur_type)
  	      : wanted_type == c_common_signed_type (cur_type)))
--- 2391,2395 ----
  	  && TREE_CODE (cur_type) == INTEGER_TYPE
  	  && (! pedantic || i == 0 || (i == 1 && char_type_flag))
! 	  && (TYPE_UNSIGNED (wanted_type)
  	      ? wanted_type == c_common_unsigned_type (cur_type)
  	      : wanted_type == c_common_signed_type (cur_type)))
*** c-opts.c	23 Mar 2004 23:47:35 -0000	1.108
--- c-opts.c	31 Mar 2004 20:43:39 -0000
*************** c_common_init (void)
*** 1194,1198 ****
    cpp_opts->int_precision = TYPE_PRECISION (integer_type_node);
    cpp_opts->wchar_precision = TYPE_PRECISION (wchar_type_node);
!   cpp_opts->unsigned_wchar = TREE_UNSIGNED (wchar_type_node);
    cpp_opts->bytes_big_endian = BYTES_BIG_ENDIAN;
  
--- 1194,1198 ----
    cpp_opts->int_precision = TYPE_PRECISION (integer_type_node);
    cpp_opts->wchar_precision = TYPE_PRECISION (wchar_type_node);
!   cpp_opts->unsigned_wchar = TYPE_UNSIGNED (wchar_type_node);
    cpp_opts->bytes_big_endian = BYTES_BIG_ENDIAN;
  
*** c-pretty-print.c	20 Mar 2004 05:21:41 -0000	1.39
--- c-pretty-print.c	31 Mar 2004 20:43:41 -0000
*************** pp_c_type_specifier (c_pretty_printer *p
*** 292,296 ****
          t = TYPE_NAME (t);
        else
!         t = c_common_type_for_mode (TYPE_MODE (t), TREE_UNSIGNED (t));
        pp_c_type_specifier (pp, t);
        break;
--- 292,296 ----
          t = TYPE_NAME (t);
        else
!         t = c_common_type_for_mode (TYPE_MODE (t), TYPE_UNSIGNED (t));
        pp_c_type_specifier (pp, t);
        break;
*************** pp_c_integer_constant (c_pretty_printer 
*** 768,772 ****
        pp_string (pp, pp_buffer (pp)->digit_buffer);
      }
!   if (TREE_UNSIGNED (type))
      pp_character (pp, 'u');
    if (type == long_integer_type_node || type == long_unsigned_type_node)
--- 768,772 ----
        pp_string (pp, pp_buffer (pp)->digit_buffer);
      }
!   if (TYPE_UNSIGNED (type))
      pp_character (pp, 'u');
    if (type == long_integer_type_node || type == long_unsigned_type_node)
*************** pp_c_character_constant (c_pretty_printe
*** 786,791 ****
      pp_character (pp, 'L'); 
    pp_quote (pp);
!   if (host_integerp (c, TREE_UNSIGNED (type)))
!     pp_c_char (pp, tree_low_cst (c, TREE_UNSIGNED (type)));
    else
      pp_scalar (pp, "\\x%x", (unsigned) TREE_INT_CST_LOW (c));
--- 786,791 ----
      pp_character (pp, 'L'); 
    pp_quote (pp);
!   if (host_integerp (c, TYPE_UNSIGNED (type)))
!     pp_c_char (pp, tree_low_cst (c, TYPE_UNSIGNED (type)));
    else
      pp_scalar (pp, "\\x%x", (unsigned) TREE_INT_CST_LOW (c));
*** c-typeck.c	28 Mar 2004 00:31:38 -0000	1.298
--- c-typeck.c	31 Mar 2004 20:43:46 -0000
*************** c_type_promotes_to (tree type)
*** 181,185 ****
      {
        /* Preserve unsignedness if not really getting any wider.  */
!       if (TREE_UNSIGNED (type)
            && (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)))
          return unsigned_type_node;
--- 181,185 ----
      {
        /* Preserve unsignedness if not really getting any wider.  */
!       if (TYPE_UNSIGNED (type)
            && (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)))
          return unsigned_type_node;
*************** common_type (tree t1, tree t2)
*** 287,291 ****
  	  /* But preserve unsignedness from the other type,
  	     since long cannot hold all the values of an unsigned int.  */
! 	  if (TREE_UNSIGNED (t1) || TREE_UNSIGNED (t2))
  	     t1 = long_unsigned_type_node;
  	  else
--- 287,291 ----
  	  /* But preserve unsignedness from the other type,
  	     since long cannot hold all the values of an unsigned int.  */
! 	  if (TYPE_UNSIGNED (t1) || TYPE_UNSIGNED (t2))
  	     t1 = long_unsigned_type_node;
  	  else
*************** common_type (tree t1, tree t2)
*** 302,306 ****
        /* Otherwise prefer the unsigned one.  */
  
!       if (TREE_UNSIGNED (t1))
  	return build_type_attribute_variant (t1, attributes);
        else
--- 302,306 ----
        /* Otherwise prefer the unsigned one.  */
  
!       if (TYPE_UNSIGNED (t1))
  	return build_type_attribute_variant (t1, attributes);
        else
*************** comptypes (tree type1, tree type2, int f
*** 478,484 ****
  
    if (TREE_CODE (t1) == ENUMERAL_TYPE && TREE_CODE (t2) != ENUMERAL_TYPE)
!     t1 = c_common_type_for_size (TYPE_PRECISION (t1), TREE_UNSIGNED (t1));
    else if (TREE_CODE (t2) == ENUMERAL_TYPE && TREE_CODE (t1) != ENUMERAL_TYPE)
!     t2 = c_common_type_for_size (TYPE_PRECISION (t2), TREE_UNSIGNED (t2));
  
    if (t1 == t2)
--- 478,484 ----
  
    if (TREE_CODE (t1) == ENUMERAL_TYPE && TREE_CODE (t2) != ENUMERAL_TYPE)
!     t1 = c_common_type_for_size (TYPE_PRECISION (t1), TYPE_UNSIGNED (t1));
    else if (TREE_CODE (t2) == ENUMERAL_TYPE && TREE_CODE (t1) != ENUMERAL_TYPE)
!     t2 = c_common_type_for_size (TYPE_PRECISION (t2), TYPE_UNSIGNED (t2));
  
    if (t1 == t2)
*************** default_conversion (tree exp)
*** 1190,1194 ****
  				     ((TYPE_PRECISION (type)
  				       >= TYPE_PRECISION (integer_type_node))
! 				      && TREE_UNSIGNED (type)));
  
        return convert (type, exp);
--- 1190,1194 ----
  				     ((TYPE_PRECISION (type)
  				       >= TYPE_PRECISION (integer_type_node))
! 				      && TYPE_UNSIGNED (type)));
  
        return convert (type, exp);
*************** default_conversion (tree exp)
*** 1206,1210 ****
      {
        /* Preserve unsignedness if not really getting any wider.  */
!       if (TREE_UNSIGNED (type)
  	  && TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
  	return convert (unsigned_type_node, exp);
--- 1206,1210 ----
      {
        /* Preserve unsignedness if not really getting any wider.  */
!       if (TYPE_UNSIGNED (type)
  	  && TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
  	return convert (unsigned_type_node, exp);
*************** convert_arguments (tree typelist, tree v
*** 1909,1913 ****
  		      else if (formal_prec != TYPE_PRECISION (type1))
  			warn_for_assignment ("%s with different width due to prototype", (char *) 0, name, parmnum + 1);
! 		      else if (TREE_UNSIGNED (type) == TREE_UNSIGNED (type1))
  			;
  		      /* Don't complain if the formal parameter type
--- 1909,1913 ----
  		      else if (formal_prec != TYPE_PRECISION (type1))
  			warn_for_assignment ("%s with different width due to prototype", (char *) 0, name, parmnum + 1);
! 		      else if (TYPE_UNSIGNED (type) == TYPE_UNSIGNED (type1))
  			;
  		      /* Don't complain if the formal parameter type
*************** convert_arguments (tree typelist, tree v
*** 1931,1937 ****
  			 certainly is the same either way.  */
  		      else if (TYPE_PRECISION (TREE_TYPE (val)) < TYPE_PRECISION (type)
! 			       && TREE_UNSIGNED (TREE_TYPE (val)))
  			;
! 		      else if (TREE_UNSIGNED (type))
  			warn_for_assignment ("%s as unsigned due to prototype", (char *) 0, name, parmnum + 1);
  		      else
--- 1931,1937 ----
  			 certainly is the same either way.  */
  		      else if (TYPE_PRECISION (TREE_TYPE (val)) < TYPE_PRECISION (type)
! 			       && TYPE_UNSIGNED (TREE_TYPE (val)))
  			;
! 		      else if (TYPE_UNSIGNED (type))
  			warn_for_assignment ("%s as unsigned due to prototype", (char *) 0, name, parmnum + 1);
  		      else
*************** build_conditional_expr (tree ifexp, tree
*** 2702,2707 ****
        if (warn_sign_compare && !skip_evaluation)
  	{
! 	  int unsigned_op1 = TREE_UNSIGNED (TREE_TYPE (orig_op1));
! 	  int unsigned_op2 = TREE_UNSIGNED (TREE_TYPE (orig_op2));
  
  	  if (unsigned_op1 ^ unsigned_op2)
--- 2702,2707 ----
        if (warn_sign_compare && !skip_evaluation)
  	{
! 	  int unsigned_op1 = TYPE_UNSIGNED (TREE_TYPE (orig_op1));
! 	  int unsigned_op2 = TYPE_UNSIGNED (TREE_TYPE (orig_op2));
  
  	  if (unsigned_op1 ^ unsigned_op2)
*************** build_conditional_expr (tree ifexp, tree
*** 2710,2714 ****
  		 signed type will only be chosen if it can represent
  		 all the values of the unsigned type.  */
! 	      if (! TREE_UNSIGNED (result_type))
  		/* OK */;
  	      /* Do not warn if the signed quantity is an unsuffixed
--- 2710,2714 ----
  		 signed type will only be chosen if it can represent
  		 all the values of the unsigned type.  */
! 	      if (! TYPE_UNSIGNED (result_type))
  		/* OK */;
  	      /* Do not warn if the signed quantity is an unsuffixed
*************** set_nonincremental_init_from_string (tre
*** 5282,5286 ****
  	}
  
!       if (!TREE_UNSIGNED (type))
  	{
  	  bitpos = ((wchar_bytes - 1) * charwidth) + HOST_BITS_PER_CHAR;
--- 5282,5286 ----
  	}
  
!       if (!TYPE_UNSIGNED (type))
  	{
  	  bitpos = ((wchar_bytes - 1) * charwidth) + HOST_BITS_PER_CHAR;
*************** build_binary_op (enum tree_code code, tr
*** 6513,6517 ****
  	       computation mode.  We shorten only if unsigned or if
  	       dividing by something we know != -1.  */
! 	    shorten = (TREE_UNSIGNED (TREE_TYPE (orig_op0))
  		       || (TREE_CODE (op1) == INTEGER_CST
  			   && ! integer_all_onesp (op1)));
--- 6513,6517 ----
  	       computation mode.  We shorten only if unsigned or if
  	       dividing by something we know != -1.  */
! 	    shorten = (TYPE_UNSIGNED (TREE_TYPE (orig_op0))
  		       || (TREE_CODE (op1) == INTEGER_CST
  			   && ! integer_all_onesp (op1)));
*************** build_binary_op (enum tree_code code, tr
*** 6540,6544 ****
  	     quotient can't be represented in the computation mode.  We shorten
  	     only if unsigned or if dividing by something we know != -1.  */
! 	  shorten = (TREE_UNSIGNED (TREE_TYPE (orig_op0))
  		     || (TREE_CODE (op1) == INTEGER_CST
  			 && ! integer_all_onesp (op1)));
--- 6540,6544 ----
  	     quotient can't be represented in the computation mode.  We shorten
  	     only if unsigned or if dividing by something we know != -1.  */
! 	  shorten = (TYPE_UNSIGNED (TREE_TYPE (orig_op0))
  		     || (TREE_CODE (op1) == INTEGER_CST
  			 && ! integer_all_onesp (op1)));
*************** build_binary_op (enum tree_code code, tr
*** 6829,6833 ****
  	  tree arg1 = get_narrower (op1, &unsigned1);
  	  /* UNS is 1 if the operation to be done is an unsigned one.  */
! 	  int uns = TREE_UNSIGNED (result_type);
  	  tree type;
  
--- 6829,6833 ----
  	  tree arg1 = get_narrower (op1, &unsigned1);
  	  /* UNS is 1 if the operation to be done is an unsigned one.  */
! 	  int uns = TYPE_UNSIGNED (result_type);
  	  tree type;
  
*************** build_binary_op (enum tree_code code, tr
*** 6840,6848 ****
  	       == TYPE_PRECISION (TREE_TYPE (arg0)))
  	      && TREE_TYPE (op0) != final_type)
! 	    unsigned0 = TREE_UNSIGNED (TREE_TYPE (op0));
  	  if ((TYPE_PRECISION (TREE_TYPE (op1))
  	       == TYPE_PRECISION (TREE_TYPE (arg1)))
  	      && TREE_TYPE (op1) != final_type)
! 	    unsigned1 = TREE_UNSIGNED (TREE_TYPE (op1));
  
  	  /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE.  */
--- 6840,6848 ----
  	       == TYPE_PRECISION (TREE_TYPE (arg0)))
  	      && TREE_TYPE (op0) != final_type)
! 	    unsigned0 = TYPE_UNSIGNED (TREE_TYPE (op0));
  	  if ((TYPE_PRECISION (TREE_TYPE (op1))
  	       == TYPE_PRECISION (TREE_TYPE (arg1)))
  	      && TREE_TYPE (op1) != final_type)
! 	    unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1));
  
  	  /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE.  */
*************** build_binary_op (enum tree_code code, tr
*** 6899,6903 ****
  
  	  if (arg0 == op0 && final_type == TREE_TYPE (op0))
! 	    unsigned_arg = TREE_UNSIGNED (TREE_TYPE (op0));
  
  	  if (TYPE_PRECISION (TREE_TYPE (arg0)) < TYPE_PRECISION (result_type)
--- 6899,6903 ----
  
  	  if (arg0 == op0 && final_type == TREE_TYPE (op0))
! 	    unsigned_arg = TYPE_UNSIGNED (TREE_TYPE (op0));
  
  	  if (TYPE_PRECISION (TREE_TYPE (arg0)) < TYPE_PRECISION (result_type)
*************** build_binary_op (enum tree_code code, tr
*** 6906,6910 ****
  	      && compare_tree_int (op1, TYPE_PRECISION (TREE_TYPE (arg0))) < 0
  	      /* We cannot drop an unsigned shift after sign-extension.  */
! 	      && (!TREE_UNSIGNED (final_type) || unsigned_arg))
  	    {
  	      /* Do an unsigned shift if the operand was zero-extended.  */
--- 6906,6910 ----
  	      && compare_tree_int (op1, TYPE_PRECISION (TREE_TYPE (arg0))) < 0
  	      /* We cannot drop an unsigned shift after sign-extension.  */
! 	      && (!TYPE_UNSIGNED (final_type) || unsigned_arg))
  	    {
  	      /* Do an unsigned shift if the operand was zero-extended.  */
*************** build_binary_op (enum tree_code code, tr
*** 6942,6947 ****
  	  if (warn_sign_compare && skip_evaluation == 0)
  	    {
! 	      int op0_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op0));
! 	      int op1_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op1));
  	      int unsignedp0, unsignedp1;
  	      tree primop0 = get_narrower (op0, &unsignedp0);
--- 6942,6947 ----
  	  if (warn_sign_compare && skip_evaluation == 0)
  	    {
! 	      int op0_signed = ! TYPE_UNSIGNED (TREE_TYPE (orig_op0));
! 	      int op1_signed = ! TYPE_UNSIGNED (TREE_TYPE (orig_op1));
  	      int unsignedp0, unsignedp1;
  	      tree primop0 = get_narrower (op0, &unsignedp0);
*************** build_binary_op (enum tree_code code, tr
*** 6962,6966 ****
  		 since the signed type will only be chosen if it can represent
  		 all the values of the unsigned type.  */
! 	      if (! TREE_UNSIGNED (result_type))
  		/* OK */;
                /* Do not warn if both operands are the same signedness.  */
--- 6962,6966 ----
  		 since the signed type will only be chosen if it can represent
  		 all the values of the unsigned type.  */
! 	      if (! TYPE_UNSIGNED (result_type))
  		/* OK */;
                /* Do not warn if both operands are the same signedness.  */
*** calls.c	20 Mar 2004 04:52:51 -0000	1.327
--- calls.c	31 Mar 2004 20:43:49 -0000
*************** initialize_argument_information (int num
*** 1196,1200 ****
  
        mode = TYPE_MODE (type);
!       unsignedp = TREE_UNSIGNED (type);
  
        if (targetm.calls.promote_function_args (fndecl ? TREE_TYPE (fndecl) : 0))
--- 1196,1200 ----
  
        mode = TYPE_MODE (type);
!       unsignedp = TYPE_UNSIGNED (type);
  
        if (targetm.calls.promote_function_args (fndecl ? TREE_TYPE (fndecl) : 0))
*************** expand_call (tree exp, rtx target, int i
*** 3347,3351 ****
  	{
  	  tree type = TREE_TYPE (exp);
! 	  int unsignedp = TREE_UNSIGNED (type);
  	  int offset = 0;
  
--- 3347,3351 ----
  	{
  	  tree type = TREE_TYPE (exp);
! 	  int unsignedp = TYPE_UNSIGNED (type);
  	  int offset = 0;
  
*** convert.c	19 Mar 2004 03:21:46 -0000	1.42
--- convert.c	31 Mar 2004 20:43:52 -0000
*************** convert_to_integer (tree type, tree expr
*** 398,402 ****
  	     the signed-to-unsigned case the high-order bits have to
  	     be cleared.  */
! 	  if (TREE_UNSIGNED (type) != TREE_UNSIGNED (TREE_TYPE (expr))
  	      && (TYPE_PRECISION (TREE_TYPE (expr))
  		  != GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (expr)))))
--- 398,402 ----
  	     the signed-to-unsigned case the high-order bits have to
  	     be cleared.  */
! 	  if (TYPE_UNSIGNED (type) != TYPE_UNSIGNED (TREE_TYPE (expr))
  	      && (TYPE_PRECISION (TREE_TYPE (expr))
  		  != GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (expr)))))
*************** convert_to_integer (tree type, tree expr
*** 416,420 ****
  	return build1 (NOP_EXPR, type,
  		       convert (lang_hooks.types.type_for_mode
! 				(TYPE_MODE (type), TREE_UNSIGNED (type)),
  				expr));
  
--- 416,420 ----
  	return build1 (NOP_EXPR, type,
  		       convert (lang_hooks.types.type_for_mode
! 				(TYPE_MODE (type), TYPE_UNSIGNED (type)),
  				expr));
  
*************** convert_to_integer (tree type, tree expr
*** 457,461 ****
  	  if (TREE_CODE (TREE_OPERAND (expr, 1)) == INTEGER_CST
  	      && tree_int_cst_sgn (TREE_OPERAND (expr, 1)) >= 0
! 	      && TREE_UNSIGNED (type)
  	      && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST)
  	    {
--- 457,461 ----
  	  if (TREE_CODE (TREE_OPERAND (expr, 1)) == INTEGER_CST
  	      && tree_int_cst_sgn (TREE_OPERAND (expr, 1)) >= 0
! 	      && TYPE_UNSIGNED (type)
  	      && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST)
  	    {
*************** convert_to_integer (tree type, tree expr
*** 499,504 ****
  		/* If signedness of arg0 and arg1 don't match,
  		   we can't necessarily find a type to compare them in.  */
! 		&& (TREE_UNSIGNED (TREE_TYPE (arg0))
! 		    == TREE_UNSIGNED (TREE_TYPE (arg1))))
  	      goto trunc1;
  	    break;
--- 499,504 ----
  		/* If signedness of arg0 and arg1 don't match,
  		   we can't necessarily find a type to compare them in.  */
! 		&& (TYPE_UNSIGNED (TREE_TYPE (arg0))
! 		    == TYPE_UNSIGNED (TREE_TYPE (arg1))))
  	      goto trunc1;
  	    break;
*************** convert_to_integer (tree type, tree expr
*** 528,532 ****
  		if (TREE_CODE (typex) == ENUMERAL_TYPE)
  		  typex = lang_hooks.types.type_for_size
! 		    (TYPE_PRECISION (typex), TREE_UNSIGNED (typex));
  
  		/* But now perhaps TYPEX is as wide as INPREC.
--- 528,532 ----
  		if (TREE_CODE (typex) == ENUMERAL_TYPE)
  		  typex = lang_hooks.types.type_for_size
! 		    (TYPE_PRECISION (typex), TYPE_UNSIGNED (typex));
  
  		/* But now perhaps TYPEX is as wide as INPREC.
*************** convert_to_integer (tree type, tree expr
*** 546,552 ****
  		       And we may need to do it as unsigned
  		       if we truncate to the original size.  */
! 		    if (TREE_UNSIGNED (TREE_TYPE (expr))
! 			|| (TREE_UNSIGNED (TREE_TYPE (arg0))
! 			    && (TREE_UNSIGNED (TREE_TYPE (arg1))
  				|| ex_form == LSHIFT_EXPR
  				|| ex_form == RSHIFT_EXPR
--- 546,552 ----
  		       And we may need to do it as unsigned
  		       if we truncate to the original size.  */
! 		    if (TYPE_UNSIGNED (TREE_TYPE (expr))
! 			|| (TYPE_UNSIGNED (TREE_TYPE (arg0))
! 			    && (TYPE_UNSIGNED (TREE_TYPE (arg1))
  				|| ex_form == LSHIFT_EXPR
  				|| ex_form == RSHIFT_EXPR
*************** convert_to_integer (tree type, tree expr
*** 577,581 ****
  	    if (TREE_CODE (typex) == ENUMERAL_TYPE)
  	      typex = lang_hooks.types.type_for_size
! 		(TYPE_PRECISION (typex), TREE_UNSIGNED (typex));
  
  	    /* But now perhaps TYPEX is as wide as INPREC.
--- 577,581 ----
  	    if (TREE_CODE (typex) == ENUMERAL_TYPE)
  	      typex = lang_hooks.types.type_for_size
! 		(TYPE_PRECISION (typex), TYPE_UNSIGNED (typex));
  
  	    /* But now perhaps TYPEX is as wide as INPREC.
*************** convert_to_integer (tree type, tree expr
*** 586,590 ****
  		/* Don't do unsigned arithmetic where signed was wanted,
  		   or vice versa.  */
! 		if (TREE_UNSIGNED (TREE_TYPE (expr)))
  		  typex = lang_hooks.types.unsigned_type (typex);
  		else
--- 586,590 ----
  		/* Don't do unsigned arithmetic where signed was wanted,
  		   or vice versa.  */
! 		if (TYPE_UNSIGNED (TREE_TYPE (expr)))
  		  typex = lang_hooks.types.unsigned_type (typex);
  		else
*** dbxout.c	25 Mar 2004 17:04:38 -0000	1.182
--- dbxout.c	31 Mar 2004 20:43:53 -0000
*************** dbxout_type (tree type, int full)
*** 1385,1389 ****
  
      case INTEGER_TYPE:
!       if (type == char_type_node && ! TREE_UNSIGNED (type))
  	{
  	  /* Output the type `char' as a subrange of itself!
--- 1385,1389 ----
  
      case INTEGER_TYPE:
!       if (type == char_type_node && ! TYPE_UNSIGNED (type))
  	{
  	  /* Output the type `char' as a subrange of itself!
*************** dbxout_type (tree type, int full)
*** 1493,1497 ****
  	  CHARS (1);
  	  dbxout_type_index (char_type_node);
! 	  fprintf (asmfile, ";0;%d;", TREE_UNSIGNED (type) ? 255 : 127);
  	  CHARS (7);
  	}
--- 1493,1497 ----
  	  CHARS (1);
  	  dbxout_type_index (char_type_node);
! 	  fprintf (asmfile, ";0;%d;", TYPE_UNSIGNED (type) ? 255 : 127);
  	  CHARS (7);
  	}
*************** print_int_cst_bounds_in_octal_p (tree ty
*** 1915,1922 ****
        && (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
  	  || (TYPE_PRECISION (type) == HOST_BITS_PER_WIDE_INT
! 	      && TREE_UNSIGNED (type))))
      return TRUE;
    else
--- 1915,1922 ----
        && (TYPE_PRECISION (type) > TYPE_PRECISION (integer_type_node)
  	  || ((TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
! 	      && TYPE_UNSIGNED (type))
  	  || TYPE_PRECISION (type) > HOST_BITS_PER_WIDE_INT
  	  || (TYPE_PRECISION (type) == HOST_BITS_PER_WIDE_INT
! 	      && TYPE_UNSIGNED (type))))
      return TRUE;
    else
*** dojump.c	21 Mar 2004 18:09:16 -0000	1.14
--- dojump.c	31 Mar 2004 20:43:56 -0000
*************** do_jump (tree exp, rtx if_false_label, r
*** 643,647 ****
  	    }
  	  do_compare_rtx_and_jump (temp, CONST0_RTX (GET_MODE (temp)),
! 				   NE, TREE_UNSIGNED (TREE_TYPE (exp)),
  				   GET_MODE (temp), NULL_RTX,
  				   if_false_label, if_true_label);
--- 643,647 ----
  	    }
  	  do_compare_rtx_and_jump (temp, CONST0_RTX (GET_MODE (temp)),
! 				   NE, TYPE_UNSIGNED (TREE_TYPE (exp)),
  				   GET_MODE (temp), NULL_RTX,
  				   if_false_label, if_true_label);
*************** do_jump_by_parts_greater (tree exp, int 
*** 673,679 ****
    rtx op1 = expand_expr (TREE_OPERAND (exp, !swap), NULL_RTX, VOIDmode, 0);
    enum machine_mode mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
!   int unsignedp = TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)));
  
!   do_jump_by_parts_greater_rtx (mode, unsignedp, op0, op1, if_false_label, if_true_label);
  }
  
--- 673,680 ----
    rtx op1 = expand_expr (TREE_OPERAND (exp, !swap), NULL_RTX, VOIDmode, 0);
    enum machine_mode mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
!   int unsignedp = TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)));
  
!   do_jump_by_parts_greater_rtx (mode, unsignedp, op0, op1, if_false_label,
! 				if_true_label);
  }
  
*************** do_jump_by_parts_equality (tree exp, rtx
*** 748,752 ****
      do_compare_rtx_and_jump (operand_subword_force (op0, i, mode),
                               operand_subword_force (op1, i, mode),
!                              EQ, TREE_UNSIGNED (TREE_TYPE (exp)),
                               word_mode, NULL_RTX, if_false_label, NULL_RTX);
  
--- 749,753 ----
      do_compare_rtx_and_jump (operand_subword_force (op0, i, mode),
                               operand_subword_force (op1, i, mode),
!                              EQ, TYPE_UNSIGNED (TREE_TYPE (exp)),
                               word_mode, NULL_RTX, if_false_label, NULL_RTX);
  
*************** do_compare_and_jump (tree exp, enum rtx_
*** 1018,1022 ****
        mode = TYPE_MODE (type);
      }
!   unsignedp = TREE_UNSIGNED (type);
    code = unsignedp ? unsigned_code : signed_code;
  
--- 1019,1023 ----
        mode = TYPE_MODE (type);
      }
!   unsignedp = TYPE_UNSIGNED (type);
    code = unsignedp ? unsigned_code : signed_code;
  
*** dwarf2out.c	30 Mar 2004 19:18:49 -0000	1.510
--- dwarf2out.c	31 Mar 2004 20:44:04 -0000
*************** base_type_die (tree type)
*** 7854,7858 ****
  		 || ! strcmp (type_name, "unsigned char"))))
  	{
! 	  if (TREE_UNSIGNED (type))
  	    encoding = DW_ATE_unsigned;
  	  else
--- 7854,7858 ----
  		 || ! strcmp (type_name, "unsigned char"))))
  	{
! 	  if (TYPE_UNSIGNED (type))
  	    encoding = DW_ATE_unsigned;
  	  else
*************** base_type_die (tree type)
*** 7864,7868 ****
      case CHAR_TYPE:
        /* GNU Pascal/Ada CHAR type.  Not used in C.  */
!       if (TREE_UNSIGNED (type))
  	encoding = DW_ATE_unsigned_char;
        else
--- 7864,7868 ----
      case CHAR_TYPE:
        /* GNU Pascal/Ada CHAR type.  Not used in C.  */
!       if (TYPE_UNSIGNED (type))
  	encoding = DW_ATE_unsigned_char;
        else
*************** loc_descriptor_from_tree (tree loc, int 
*** 8730,8734 ****
    dw_loc_descr_ref ret, ret1;
    int indirect_p = 0;
!   int unsignedp = TREE_UNSIGNED (TREE_TYPE (loc));
    enum dwarf_location_atom op;
  
--- 8730,8734 ----
    dw_loc_descr_ref ret, ret1;
    int indirect_p = 0;
!   int unsignedp = TYPE_UNSIGNED (TREE_TYPE (loc));
    enum dwarf_location_atom op;
  
*************** loc_descriptor_from_tree (tree loc, int 
*** 8989,8993 ****
  
      case LE_EXPR:
!       if (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (loc, 0))))
  	return 0;
  
--- 8989,8993 ----
  
      case LE_EXPR:
!       if (TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (loc, 0))))
  	return 0;
  
*************** loc_descriptor_from_tree (tree loc, int 
*** 8996,9000 ****
  
      case GE_EXPR:
!       if (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (loc, 0))))
  	return 0;
  
--- 8996,9000 ----
  
      case GE_EXPR:
!       if (TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (loc, 0))))
  	return 0;
  
*************** loc_descriptor_from_tree (tree loc, int 
*** 9003,9007 ****
  
      case LT_EXPR:
!       if (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (loc, 0))))
  	return 0;
  
--- 9003,9007 ----
  
      case LT_EXPR:
!       if (TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (loc, 0))))
  	return 0;
  
*************** loc_descriptor_from_tree (tree loc, int 
*** 9010,9014 ****
  
      case GT_EXPR:
!       if (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (loc, 0))))
  	return 0;
  
--- 9010,9014 ----
  
      case GT_EXPR:
!       if (TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (loc, 0))))
  	return 0;
  
*************** gen_enumeration_type_die (tree type, dw_
*** 10905,10909 ****
  			      IDENTIFIER_POINTER (TREE_PURPOSE (link)));
  
! 	  if (host_integerp (value, TREE_UNSIGNED (TREE_TYPE (value))))
  	    /* DWARF2 does not provide a way of indicating whether or
  	       not enumeration constants are signed or unsigned.  GDB
--- 10905,10909 ----
  			      IDENTIFIER_POINTER (TREE_PURPOSE (link)));
  
! 	  if (host_integerp (value, TYPE_UNSIGNED (TREE_TYPE (value))))
  	    /* DWARF2 does not provide a way of indicating whether or
  	       not enumeration constants are signed or unsigned.  GDB
*** expmed.c	21 Mar 2004 19:31:29 -0000	1.154
--- expmed.c	31 Mar 2004 20:44:08 -0000
*************** make_tree (tree type, rtx x)
*** 4177,4182 ****
      case CONST_INT:
        t = build_int_2 (INTVAL (x),
! 		       (TREE_UNSIGNED (type)
! 			&& (GET_MODE_BITSIZE (TYPE_MODE (type)) < HOST_BITS_PER_WIDE_INT))
  		       || INTVAL (x) >= 0 ? 0 : -1);
        TREE_TYPE (t) = type;
--- 4177,4183 ----
      case CONST_INT:
        t = build_int_2 (INTVAL (x),
! 		       (TYPE_UNSIGNED (type)
! 			&& (GET_MODE_BITSIZE (TYPE_MODE (type))
! 			    < HOST_BITS_PER_WIDE_INT))
  		       || INTVAL (x) >= 0 ? 0 : -1);
        TREE_TYPE (t) = type;
*** expr.c	27 Mar 2004 16:15:59 -0000	1.636
--- expr.c	1 Apr 2004 00:08:02 -0000
*************** copy_blkmode_from_reg (rtx tgtblk, rtx s
*** 2152,2156 ****
    if (GET_MODE (srcreg) != BLKmode
        && GET_MODE_SIZE (GET_MODE (srcreg)) < UNITS_PER_WORD)
!     srcreg = convert_to_mode (word_mode, srcreg, TREE_UNSIGNED (type));
  
    /* If the structure doesn't take up a whole number of words, see whether
--- 2152,2156 ----
    if (GET_MODE (srcreg) != BLKmode
        && GET_MODE_SIZE (GET_MODE (srcreg)) < UNITS_PER_WORD)
!     srcreg = convert_to_mode (word_mode, srcreg, TYPE_UNSIGNED (type));
  
    /* If the structure doesn't take up a whole number of words, see whether
*************** expand_assignment (tree to, tree from, i
*** 3882,3886 ****
  					  TYPE_MODE (TREE_TYPE (from)),
  					  result,
! 					  TREE_UNSIGNED (TREE_TYPE (to)))
  	      : NULL_RTX);
      }
--- 3882,3886 ----
  					  TYPE_MODE (TREE_TYPE (from)),
  					  result,
! 					  TYPE_UNSIGNED (TREE_TYPE (to)))
  	      : NULL_RTX);
      }
*************** expand_assignment (tree to, tree from, i
*** 3972,3976 ****
  			   XEXP (from_rtx, 0), Pmode,
  			   convert_to_mode (TYPE_MODE (sizetype),
! 					    size, TREE_UNSIGNED (sizetype)),
  			   TYPE_MODE (sizetype));
        else
--- 3972,3976 ----
  			   XEXP (from_rtx, 0), Pmode,
  			   convert_to_mode (TYPE_MODE (sizetype),
! 					    size, TYPE_UNSIGNED (sizetype)),
  			   TYPE_MODE (sizetype));
        else
*************** expand_assignment (tree to, tree from, i
*** 3980,3984 ****
  			   convert_to_mode (TYPE_MODE (integer_type_node),
  					    size,
! 					    TREE_UNSIGNED (integer_type_node)),
  			   TYPE_MODE (integer_type_node));
  
--- 3980,3984 ----
  			   convert_to_mode (TYPE_MODE (integer_type_node),
  					    size,
! 					    TYPE_UNSIGNED (integer_type_node)),
  			   TYPE_MODE (integer_type_node));
  
*************** store_expr (tree exp, rtx target, int wa
*** 4150,4154 ****
  	  && TREE_TYPE (TREE_TYPE (exp)) == 0)
  	{
! 	  if (TREE_UNSIGNED (TREE_TYPE (exp))
  	      != SUBREG_PROMOTED_UNSIGNED_P (target))
  	    exp = convert
--- 4150,4154 ----
  	  && TREE_TYPE (TREE_TYPE (exp)) == 0)
  	{
! 	  if (TYPE_UNSIGNED (TREE_TYPE (exp))
  	      != SUBREG_PROMOTED_UNSIGNED_P (target))
  	    exp = convert
*************** store_expr (tree exp, rtx target, int wa
*** 4239,4243 ****
        && GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp)))
      temp = convert_modes (GET_MODE (target), TYPE_MODE (TREE_TYPE (exp)),
! 			  temp, TREE_UNSIGNED (TREE_TYPE (exp)));
  
    /* If value was not generated in the target, store it there.
--- 4239,4243 ----
        && GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp)))
      temp = convert_modes (GET_MODE (target), TYPE_MODE (TREE_TYPE (exp)),
! 			  temp, TYPE_UNSIGNED (TREE_TYPE (exp)));
  
    /* If value was not generated in the target, store it there.
*************** store_expr (tree exp, rtx target, int wa
*** 4280,4284 ****
  	  && GET_MODE (temp) != VOIDmode)
  	{
! 	  int unsignedp = TREE_UNSIGNED (TREE_TYPE (exp));
  	  if (dont_return_target)
  	    {
--- 4280,4284 ----
  	  && GET_MODE (temp) != VOIDmode)
  	{
! 	  int unsignedp = TYPE_UNSIGNED (TREE_TYPE (exp));
  	  if (dont_return_target)
  	    {
*************** store_expr (tree exp, rtx target, int wa
*** 4321,4325 ****
  	      /* Copy that much.  */
  	      copy_size_rtx = convert_to_mode (ptr_mode, copy_size_rtx,
! 					       TREE_UNSIGNED (sizetype));
  	      emit_block_move (target, temp, copy_size_rtx,
  			       (want_value & 2
--- 4321,4325 ----
  	      /* Copy that much.  */
  	      copy_size_rtx = convert_to_mode (ptr_mode, copy_size_rtx,
! 					       TYPE_UNSIGNED (sizetype));
  	      emit_block_move (target, temp, copy_size_rtx,
  			       (want_value & 2
*************** store_expr (tree exp, rtx target, int wa
*** 4343,4347 ****
  		  if (GET_MODE (copy_size_rtx) != Pmode)
  		    copy_size_rtx = convert_to_mode (Pmode, copy_size_rtx,
! 						     TREE_UNSIGNED (sizetype));
  #endif
  
--- 4343,4347 ----
  		  if (GET_MODE (copy_size_rtx) != Pmode)
  		    copy_size_rtx = convert_to_mode (Pmode, copy_size_rtx,
! 						     TYPE_UNSIGNED (sizetype));
  #endif
  
*************** store_constructor (tree exp, rtx target,
*** 4686,4690 ****
  		{
  		  type = lang_hooks.types.type_for_size
! 		    (BITS_PER_WORD, TREE_UNSIGNED (type));
  		  value = convert (type, value);
  		}
--- 4686,4690 ----
  		{
  		  type = lang_hooks.types.type_for_size
! 		    (BITS_PER_WORD, TYPE_UNSIGNED (type));
  		  value = convert (type, value);
  		}
*************** store_constructor (tree exp, rtx target,
*** 4849,4853 ****
  	    continue;
  
! 	  unsignedp = TREE_UNSIGNED (elttype);
  	  mode = TYPE_MODE (elttype);
  	  if (mode == BLKmode)
--- 4849,4853 ----
  	    continue;
  
! 	  unsignedp = TYPE_UNSIGNED (elttype);
  	  mode = TYPE_MODE (elttype);
  	  if (mode == BLKmode)
*************** store_constructor (tree exp, rtx target,
*** 4907,4911 ****
  		  loop_end = gen_label_rtx ();
  
! 		  unsignedp = TREE_UNSIGNED (domain);
  
  		  index = build_decl (VAR_DECL, NULL_TREE, domain);
--- 4907,4911 ----
  		  loop_end = gen_label_rtx ();
  
! 		  unsignedp = TYPE_UNSIGNED (domain);
  
  		  index = build_decl (VAR_DECL, NULL_TREE, domain);
*************** get_inner_reference (tree exp, HOST_WIDE
*** 5451,5455 ****
      {
        mode = TYPE_MODE (TREE_TYPE (exp));
!       *punsignedp = TREE_UNSIGNED (TREE_TYPE (exp));
  
        if (mode == BLKmode)
--- 5451,5455 ----
      {
        mode = TYPE_MODE (TREE_TYPE (exp));
!       *punsignedp = TYPE_UNSIGNED (TREE_TYPE (exp));
  
        if (mode == BLKmode)
*************** expand_expr_real (tree exp, rtx target, 
*** 6161,6165 ****
    rtx op0, op1, temp;
    tree type = TREE_TYPE (exp);
!   int unsignedp = TREE_UNSIGNED (type);
    enum machine_mode mode;
    enum tree_code code = TREE_CODE (exp);
--- 6161,6165 ----
    rtx op0, op1, temp;
    tree type = TREE_TYPE (exp);
!   int unsignedp;
    enum machine_mode mode;
    enum tree_code code = TREE_CODE (exp);
*************** expand_expr_real (tree exp, rtx target, 
*** 6179,6182 ****
--- 6179,6184 ----
  
    mode = TYPE_MODE (type);
+   unsignedp = TYPE_UNSIGNED (type);
+ 
    /* Use subtarget as the target for operand 0 of a binary operation.  */
    subtarget = get_subtarget (target);
*************** expand_expr_real (tree exp, rtx target, 
*** 6919,6923 ****
  		      = TYPE_MODE (TREE_TYPE (TREE_PURPOSE (elt)));
  
! 		    if (TREE_UNSIGNED (TREE_TYPE (TREE_PURPOSE (elt))))
  		      {
  			op1 = GEN_INT (((HOST_WIDE_INT) 1 << bitsize) - 1);
--- 6921,6925 ----
  		      = TYPE_MODE (TREE_TYPE (TREE_PURPOSE (elt)));
  
! 		    if (TYPE_UNSIGNED (TREE_TYPE (TREE_PURPOSE (elt))))
  		      {
  			op1 = GEN_INT (((HOST_WIDE_INT) 1 << bitsize) - 1);
*************** expand_expr_real (tree exp, rtx target, 
*** 7278,7282 ****
  	tree set = TREE_OPERAND (exp, 0);
  	tree index = TREE_OPERAND (exp, 1);
! 	int iunsignedp = TREE_UNSIGNED (TREE_TYPE (index));
  	tree set_type = TREE_TYPE (set);
  	tree set_low_bound = TYPE_MIN_VALUE (TYPE_DOMAIN (set_type));
--- 7280,7284 ----
  	tree set = TREE_OPERAND (exp, 0);
  	tree index = TREE_OPERAND (exp, 1);
! 	int iunsignedp = TYPE_UNSIGNED (TREE_TYPE (index));
  	tree set_type = TREE_TYPE (set);
  	tree set_low_bound = TYPE_MIN_VALUE (TYPE_DOMAIN (set_type));
*************** expand_expr_real (tree exp, rtx target, 
*** 7476,7480 ****
  	     a promoted SUBREG, clear that indication since we now
  	     have to do the proper extension.  */
! 	  if (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))) != unsignedp
  	      && GET_CODE (op0) == SUBREG)
  	    SUBREG_PROMOTED_VAR_P (op0) = 0;
--- 7478,7482 ----
  	     a promoted SUBREG, clear that indication since we now
  	     have to do the proper extension.  */
! 	  if (TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))) != unsignedp
  	      && GET_CODE (op0) == SUBREG)
  	    SUBREG_PROMOTED_VAR_P (op0) = 0;
*************** expand_expr_real (tree exp, rtx target, 
*** 7499,7503 ****
  	  else
  	    return convert_modes (mode, inner_mode, op0,
! 				  TREE_UNSIGNED (inner_type));
  	}
  
--- 7501,7505 ----
  	  else
  	    return convert_modes (mode, inner_mode, op0,
! 				  TYPE_UNSIGNED (inner_type));
  	}
  
*************** expand_expr_real (tree exp, rtx target, 
*** 7508,7515 ****
  	return
  	  convert_to_mode (mode, op0,
! 			   TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))));
        else
  	convert_move (target, op0,
! 		      TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))));
        return target;
  
--- 7510,7517 ----
  	return
  	  convert_to_mode (mode, op0,
! 			   TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))));
        else
  	convert_move (target, op0,
! 		      TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))));
        return target;
  
*************** expand_expr_real (tree exp, rtx target, 
*** 7805,7820 ****
  	      ||
  	      (TREE_CODE (TREE_OPERAND (exp, 1)) == NOP_EXPR
! 	       && (TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (exp, 1), 0)))
! 		   ==
! 		   TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))))
  	       /* If both operands are extended, they must either both
  		  be zero-extended or both be sign-extended.  */
! 	       && (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (exp, 1), 0)))
! 		   ==
! 		   TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)))))))
  	{
  	  tree op0type = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0));
  	  enum machine_mode innermode = TYPE_MODE (op0type);
! 	  bool zextend_p = TREE_UNSIGNED (op0type);
  	  optab other_optab = zextend_p ? smul_widen_optab : umul_widen_optab;
  	  this_optab = zextend_p ? umul_widen_optab : smul_widen_optab;
--- 7807,7826 ----
  	      ||
  	      (TREE_CODE (TREE_OPERAND (exp, 1)) == NOP_EXPR
! 	       && (TYPE_PRECISION (TREE_TYPE
! 				   (TREE_OPERAND (TREE_OPERAND (exp, 1), 0)))
! 		   == TYPE_PRECISION (TREE_TYPE
! 				      (TREE_OPERAND
! 				       (TREE_OPERAND (exp, 0), 0))))
  	       /* If both operands are extended, they must either both
  		  be zero-extended or both be sign-extended.  */
! 	       && (TYPE_UNSIGNED (TREE_TYPE
! 				  (TREE_OPERAND (TREE_OPERAND (exp, 1), 0)))
! 		   == TYPE_UNSIGNED (TREE_TYPE
! 				     (TREE_OPERAND
! 				      (TREE_OPERAND (exp, 0), 0)))))))
  	{
  	  tree op0type = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0));
  	  enum machine_mode innermode = TYPE_MODE (op0type);
! 	  bool zextend_p = TYPE_UNSIGNED (op0type);
  	  optab other_optab = zextend_p ? smul_widen_optab : umul_widen_optab;
  	  this_optab = zextend_p ? umul_widen_optab : smul_widen_optab;
*************** expand_expr_real (tree exp, rtx target, 
*** 7925,7929 ****
  				op0);
        expand_float (target, op0,
! 		    TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))));
        return target;
  
--- 7931,7935 ----
  				op0);
        expand_float (target, op0,
! 		    TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))));
        return target;
  
*************** expand_expr_real (tree exp, rtx target, 
*** 7952,7956 ****
        /* Unsigned abs is simply the operand.  Testing here means we don't
  	 risk generating incorrect code below.  */
!       if (TREE_UNSIGNED (type))
  	return op0;
  
--- 7958,7962 ----
        /* Unsigned abs is simply the operand.  Testing here means we don't
  	 risk generating incorrect code below.  */
!       if (TYPE_UNSIGNED (type))
  	return op0;
  
*************** expand_increment (tree exp, int post, in
*** 9287,9291 ****
    /* Increment however we can.  */
    op1 = expand_binop (mode, this_optab, value, op1, op0,
! 		      TREE_UNSIGNED (TREE_TYPE (exp)), OPTAB_LIB_WIDEN);
  
    /* Make sure the value is stored into OP0.  */
--- 9293,9297 ----
    /* Increment however we can.  */
    op1 = expand_binop (mode, this_optab, value, op1, op0,
! 		      TYPE_UNSIGNED (TREE_TYPE (exp)), OPTAB_LIB_WIDEN);
  
    /* Make sure the value is stored into OP0.  */
*************** do_store_flag (tree exp, rtx target, enu
*** 9347,9351 ****
    type = TREE_TYPE (arg0);
    operand_mode = TYPE_MODE (type);
!   unsignedp = TREE_UNSIGNED (type);
  
    /* We won't bother with BLKmode store-flag operations because it would mean
--- 9353,9357 ----
    type = TREE_TYPE (arg0);
    operand_mode = TYPE_MODE (type);
!   unsignedp = TYPE_UNSIGNED (type);
  
    /* We won't bother with BLKmode store-flag operations because it would mean
*************** try_casesi (tree index_type, tree index_
*** 9620,9624 ****
    op_mode = insn_data[(int) CODE_FOR_casesi].operand[1].mode;
    op1 = convert_modes (op_mode, TYPE_MODE (TREE_TYPE (minval)),
! 		       op1, TREE_UNSIGNED (TREE_TYPE (minval)));
    if (! (*insn_data[(int) CODE_FOR_casesi].operand[1].predicate)
        (op1, op_mode))
--- 9626,9630 ----
    op_mode = insn_data[(int) CODE_FOR_casesi].operand[1].mode;
    op1 = convert_modes (op_mode, TYPE_MODE (TREE_TYPE (minval)),
! 		       op1, TYPE_UNSIGNED (TREE_TYPE (minval)));
    if (! (*insn_data[(int) CODE_FOR_casesi].operand[1].predicate)
        (op1, op_mode))
*************** try_casesi (tree index_type, tree index_
*** 9629,9633 ****
    op_mode = insn_data[(int) CODE_FOR_casesi].operand[2].mode;
    op2 = convert_modes (op_mode, TYPE_MODE (TREE_TYPE (range)),
! 		       op2, TREE_UNSIGNED (TREE_TYPE (range)));
    if (! (*insn_data[(int) CODE_FOR_casesi].operand[2].predicate)
        (op2, op_mode))
--- 9635,9639 ----
    op_mode = insn_data[(int) CODE_FOR_casesi].operand[2].mode;
    op2 = convert_modes (op_mode, TYPE_MODE (TREE_TYPE (range)),
! 		       op2, TYPE_UNSIGNED (TREE_TYPE (range)));
    if (! (*insn_data[(int) CODE_FOR_casesi].operand[2].predicate)
        (op2, op_mode))
*************** try_tablejump (tree index_type, tree ind
*** 9743,9747 ****
  			       expand_expr (range, NULL_RTX,
  					    VOIDmode, 0),
! 			       TREE_UNSIGNED (TREE_TYPE (range))),
  		table_label, default_label);
    return 1;
--- 9749,9753 ----
  			       expand_expr (range, NULL_RTX,
  					    VOIDmode, 0),
! 			       TYPE_UNSIGNED (TREE_TYPE (range))),
  		table_label, default_label);
    return 1;
*** fold-const.c	30 Mar 2004 20:00:23 -0000	1.361
--- fold-const.c	1 Apr 2004 00:07:56 -0000
*************** force_fit_type (tree t, int overflow)
*** 225,229 ****
    /* Unsigned types do not suffer sign extension or overflow unless they
       are a sizetype.  */
!   if (TREE_UNSIGNED (TREE_TYPE (t))
        && ! (TREE_CODE (TREE_TYPE (t)) == INTEGER_TYPE
  	    && TYPE_IS_SIZETYPE (TREE_TYPE (t))))
--- 225,229 ----
    /* Unsigned types do not suffer sign extension or overflow unless they
       are a sizetype.  */
!   if (TYPE_UNSIGNED (TREE_TYPE (t))
        && ! (TREE_CODE (TREE_TYPE (t)) == INTEGER_TYPE
  	    && TYPE_IS_SIZETYPE (TREE_TYPE (t))))
*************** negate_expr_p (tree t)
*** 854,858 ****
      {
      case INTEGER_CST:
!       if (TREE_UNSIGNED (type) || ! flag_trapv)
  	return true;
  
--- 854,858 ----
      {
      case INTEGER_CST:
!       if (TYPE_UNSIGNED (type) || ! flag_trapv)
  	return true;
  
*************** negate_expr_p (tree t)
*** 898,902 ****
  
      case MULT_EXPR:
!       if (TREE_UNSIGNED (TREE_TYPE (t)))
          break;
  
--- 898,902 ----
  
      case MULT_EXPR:
!       if (TYPE_UNSIGNED (TREE_TYPE (t)))
          break;
  
*************** negate_expr (tree t)
*** 963,967 ****
        tem = fold_negate_const (t, type);
        if (! TREE_OVERFLOW (tem)
! 	  || TREE_UNSIGNED (type)
  	  || ! flag_trapv)
  	return tem;
--- 963,967 ----
        tem = fold_negate_const (t, type);
        if (! TREE_OVERFLOW (tem)
! 	  || TYPE_UNSIGNED (type)
  	  || ! flag_trapv)
  	return tem;
*************** negate_expr (tree t)
*** 1022,1026 ****
  
      case MULT_EXPR:
!       if (TREE_UNSIGNED (TREE_TYPE (t)))
          break;
  
--- 1022,1026 ----
  
      case MULT_EXPR:
!       if (TYPE_UNSIGNED (TREE_TYPE (t)))
          break;
  
*************** negate_expr (tree t)
*** 1078,1082 ****
  		 == TREE_INT_CST_LOW (op1))
  	    {
! 	      tree ntype = TREE_UNSIGNED (type)
  			   ? lang_hooks.types.signed_type (type)
  			   : lang_hooks.types.unsigned_type (type);
--- 1078,1082 ----
  		 == TREE_INT_CST_LOW (op1))
  	    {
! 	      tree ntype = TYPE_UNSIGNED (type)
  			   ? lang_hooks.types.signed_type (type)
  			   : lang_hooks.types.unsigned_type (type);
*************** int_const_binop (enum tree_code code, tr
*** 1242,1246 ****
    tree t;
    tree type = TREE_TYPE (arg1);
!   int uns = TREE_UNSIGNED (type);
    int is_sizetype
      = (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type));
--- 1242,1246 ----
    tree t;
    tree type = TREE_TYPE (arg1);
!   int uns = TYPE_UNSIGNED (type);
    int is_sizetype
      = (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type));
*************** size_diffop (tree arg0, tree arg1)
*** 1683,1687 ****
  
    /* If the type is already signed, just do the simple thing.  */
!   if (! TREE_UNSIGNED (type))
      return size_binop (MINUS_EXPR, arg0, arg1);
  
--- 1683,1687 ----
  
    /* If the type is already signed, just do the simple thing.  */
!   if (!TYPE_UNSIGNED (type))
      return size_binop (MINUS_EXPR, arg0, arg1);
  
*************** fold_convert_const (enum tree_code code,
*** 1752,1757 ****
  	    = ((force_fit_type (t,
  				(TREE_INT_CST_HIGH (arg1) < 0
! 				 && (TREE_UNSIGNED (type)
! 				    < TREE_UNSIGNED (TREE_TYPE (arg1)))))
  		&& ! POINTER_TYPE_P (TREE_TYPE (arg1)))
  	       || TREE_OVERFLOW (arg1));
--- 1752,1757 ----
  	    = ((force_fit_type (t,
  				(TREE_INT_CST_HIGH (arg1) < 0
! 				 && (TYPE_UNSIGNED (type)
! 				    < TYPE_UNSIGNED (TREE_TYPE (arg1)))))
  		&& ! POINTER_TYPE_P (TREE_TYPE (arg1)))
  	       || TREE_OVERFLOW (arg1));
*************** operand_equal_p (tree arg0, tree arg1, i
*** 2160,2167 ****
    tree fndecl;
  
    /* If both types don't have the same signedness, then we can't consider
       them equal.  We must check this before the STRIP_NOPS calls
       because they may change the signedness of the arguments.  */
!   if (TREE_UNSIGNED (TREE_TYPE (arg0)) != TREE_UNSIGNED (TREE_TYPE (arg1)))
      return 0;
  
--- 2160,2171 ----
    tree fndecl;
  
+   /* If either is ERROR_MARK, they aren't equal.  */
+   if (TREE_CODE (arg0) == ERROR_MARK || TREE_CODE (arg1) == ERROR_MARK)
+     return 0;
+ 
    /* If both types don't have the same signedness, then we can't consider
       them equal.  We must check this before the STRIP_NOPS calls
       because they may change the signedness of the arguments.  */
!   if (TYPE_UNSIGNED (TREE_TYPE (arg0)) != TYPE_UNSIGNED (TREE_TYPE (arg1)))
      return 0;
  
*************** operand_equal_p (tree arg0, tree arg1, i
*** 2254,2259 ****
        /* Two conversions are equal only if signedness and modes match.  */
        if ((TREE_CODE (arg0) == NOP_EXPR || TREE_CODE (arg0) == CONVERT_EXPR)
! 	  && (TREE_UNSIGNED (TREE_TYPE (arg0))
! 	      != TREE_UNSIGNED (TREE_TYPE (arg1))))
  	return 0;
  
--- 2258,2263 ----
        /* Two conversions are equal only if signedness and modes match.  */
        if ((TREE_CODE (arg0) == NOP_EXPR || TREE_CODE (arg0) == CONVERT_EXPR)
! 	  && (TYPE_UNSIGNED (TREE_TYPE (arg0))
! 	      != TYPE_UNSIGNED (TREE_TYPE (arg1))))
  	return 0;
  
*************** decode_field_reference (tree exp, HOST_W
*** 3058,3062 ****
       (in case of a small bitfield) the signedness is unchanged.  */
    if (outer_type && *pbitsize == tree_low_cst (TYPE_SIZE (outer_type), 1))
!     *punsignedp = TREE_UNSIGNED (outer_type);
  
    /* Compute the mask to access the bitfield.  */
--- 3062,3066 ----
       (in case of a small bitfield) the signedness is unchanged.  */
    if (outer_type && *pbitsize == tree_low_cst (TYPE_SIZE (outer_type), 1))
!     *punsignedp = TYPE_UNSIGNED (outer_type);
  
    /* Compute the mask to access the bitfield.  */
*************** make_range (tree exp, int *pin_p, tree *
*** 3378,3382 ****
  	     on that fact, so we record it here so we can parse existing
  	     range tests.  */
! 	  if (TREE_UNSIGNED (type) && (low == 0 || high == 0))
  	    {
  	      if (! merge_ranges (&n_in_p, &n_low, &n_high, in_p, low, high,
--- 3382,3386 ----
  	     on that fact, so we record it here so we can parse existing
  	     range tests.  */
! 	  if (TYPE_UNSIGNED (type) && (low == 0 || high == 0))
  	    {
  	      if (! merge_ranges (&n_in_p, &n_low, &n_high, in_p, low, high,
*************** make_range (tree exp, int *pin_p, tree *
*** 3482,3486 ****
  	     So we have to make sure that the original unsigned value will
  	     be interpreted as positive.  */
! 	  if (TREE_UNSIGNED (type) && ! TREE_UNSIGNED (TREE_TYPE (exp)))
  	    {
  	      tree equiv_type = lang_hooks.types.type_for_mode
--- 3486,3490 ----
  	     So we have to make sure that the original unsigned value will
  	     be interpreted as positive.  */
! 	  if (TYPE_UNSIGNED (type) && ! TYPE_UNSIGNED (TREE_TYPE (exp)))
  	    {
  	      tree equiv_type = lang_hooks.types.type_for_mode
*************** build_range_check (tree type, tree exp, 
*** 3583,3587 ****
    if (integer_zerop (low))
      {
!       if (! TREE_UNSIGNED (etype))
  	{
  	  etype = lang_hooks.types.unsigned_type (etype);
--- 3587,3591 ----
    if (integer_zerop (low))
      {
!       if (! TYPE_UNSIGNED (etype))
  	{
  	  etype = lang_hooks.types.unsigned_type (etype);
*************** build_range_check (tree type, tree exp, 
*** 3613,3617 ****
        if (TREE_INT_CST_HIGH (high) == hi && TREE_INT_CST_LOW (high) == lo)
  	{
! 	  if (TREE_UNSIGNED (etype))
  	    {
  	      etype = lang_hooks.types.signed_type (etype);
--- 3617,3621 ----
        if (TREE_INT_CST_HIGH (high) == hi && TREE_INT_CST_LOW (high) == lo)
  	{
! 	  if (TYPE_UNSIGNED (etype))
  	    {
  	      etype = lang_hooks.types.signed_type (etype);
*************** unextend (tree c, int p, int unsignedp, 
*** 3867,3871 ****
       zero or one, and the conversion to a signed type can never overflow.
       We could get an overflow if this conversion is done anywhere else.  */
!   if (TREE_UNSIGNED (type))
      temp = fold_convert (lang_hooks.types.signed_type (type), temp);
  
--- 3871,3875 ----
       zero or one, and the conversion to a signed type can never overflow.
       We could get an overflow if this conversion is done anywhere else.  */
!   if (TYPE_UNSIGNED (type))
      temp = fold_convert (lang_hooks.types.signed_type (type), temp);
  
*************** unextend (tree c, int p, int unsignedp, 
*** 3876,3880 ****
  			fold_convert (TREE_TYPE (c), mask), 0);
    /* If necessary, convert the type back to match the type of C.  */
!   if (TREE_UNSIGNED (type))
      temp = fold_convert (type, temp);
  
--- 3880,3884 ----
  			fold_convert (TREE_TYPE (c), mask), 0);
    /* If necessary, convert the type back to match the type of C.  */
!   if (TYPE_UNSIGNED (type))
      temp = fold_convert (type, temp);
  
*************** extract_muldiv_1 (tree t, tree c, enum t
*** 4505,4509 ****
  	  /* ... and is unsigned, and its type is smaller than ctype,
  	     then we cannot pass through as widening.  */
! 	  && ((TREE_UNSIGNED (TREE_TYPE (op0))
  	       && ! (TREE_CODE (TREE_TYPE (op0)) == INTEGER_TYPE
  		     && TYPE_IS_SIZETYPE (TREE_TYPE (op0)))
--- 4509,4513 ----
  	  /* ... and is unsigned, and its type is smaller than ctype,
  	     then we cannot pass through as widening.  */
! 	  && ((TYPE_UNSIGNED (TREE_TYPE (op0))
  	       && ! (TREE_CODE (TREE_TYPE (op0)) == INTEGER_TYPE
  		     && TYPE_IS_SIZETYPE (TREE_TYPE (op0)))
*************** extract_muldiv_1 (tree t, tree c, enum t
*** 4517,4522 ****
  		 then we cannot pass through this conversion.  */
  	      || (code != MULT_EXPR
! 		  && (TREE_UNSIGNED (ctype)
! 		      != TREE_UNSIGNED (TREE_TYPE (op0))))))
  	break;
  
--- 4521,4526 ----
  		 then we cannot pass through this conversion.  */
  	      || (code != MULT_EXPR
! 		  && (TYPE_UNSIGNED (ctype)
! 		      != TYPE_UNSIGNED (TREE_TYPE (op0))))))
  	break;
  
*************** extract_muldiv_1 (tree t, tree c, enum t
*** 4541,4545 ****
        /* If widening the type changes the signedness, then we can't perform
  	 this optimization as that changes the result.  */
!       if (TREE_UNSIGNED (ctype) != TREE_UNSIGNED (type))
  	break;
  
--- 4545,4549 ----
        /* If widening the type changes the signedness, then we can't perform
  	 this optimization as that changes the result.  */
!       if (TYPE_UNSIGNED (ctype) != TYPE_UNSIGNED (type))
  	break;
  
*************** extract_muldiv_1 (tree t, tree c, enum t
*** 4632,4636 ****
  	 the operation since it will change the result if the original
  	 computation overflowed.  */
!       if (TREE_UNSIGNED (ctype)
  	  && ! (TREE_CODE (ctype) == INTEGER_TYPE && TYPE_IS_SIZETYPE (ctype))
  	  && ctype != type)
--- 4636,4640 ----
  	 the operation since it will change the result if the original
  	 computation overflowed.  */
!       if (TYPE_UNSIGNED (ctype)
  	  && ! (TREE_CODE (ctype) == INTEGER_TYPE && TYPE_IS_SIZETYPE (ctype))
  	  && ctype != type)
*************** extract_muldiv_1 (tree t, tree c, enum t
*** 4697,4701 ****
  	 this since it will change the result if the original computation
  	 overflowed.  */
!       if ((! TREE_UNSIGNED (ctype)
  	   || (TREE_CODE (ctype) == INTEGER_TYPE && TYPE_IS_SIZETYPE (ctype)))
  	  && ! flag_wrapv
--- 4701,4705 ----
  	 this since it will change the result if the original computation
  	 overflowed.  */
!       if ((! TYPE_UNSIGNED (ctype)
  	   || (TREE_CODE (ctype) == INTEGER_TYPE && TYPE_IS_SIZETYPE (ctype)))
  	  && ! flag_wrapv
*************** fold (tree expr)
*** 5632,5646 ****
  	  int inside_float = FLOAT_TYPE_P (inside_type);
  	  unsigned int inside_prec = TYPE_PRECISION (inside_type);
! 	  int inside_unsignedp = TREE_UNSIGNED (inside_type);
  	  int inter_int = INTEGRAL_TYPE_P (inter_type);
  	  int inter_ptr = POINTER_TYPE_P (inter_type);
  	  int inter_float = FLOAT_TYPE_P (inter_type);
  	  unsigned int inter_prec = TYPE_PRECISION (inter_type);
! 	  int inter_unsignedp = TREE_UNSIGNED (inter_type);
  	  int final_int = INTEGRAL_TYPE_P (type);
  	  int final_ptr = POINTER_TYPE_P (type);
  	  int final_float = FLOAT_TYPE_P (type);
  	  unsigned int final_prec = TYPE_PRECISION (type);
! 	  int final_unsignedp = TREE_UNSIGNED (type);
  
  	  /* In addition to the cases of two conversions in a row
--- 5636,5650 ----
  	  int inside_float = FLOAT_TYPE_P (inside_type);
  	  unsigned int inside_prec = TYPE_PRECISION (inside_type);
! 	  int inside_unsignedp = TYPE_UNSIGNED (inside_type);
  	  int inter_int = INTEGRAL_TYPE_P (inter_type);
  	  int inter_ptr = POINTER_TYPE_P (inter_type);
  	  int inter_float = FLOAT_TYPE_P (inter_type);
  	  unsigned int inter_prec = TYPE_PRECISION (inter_type);
! 	  int inter_unsignedp = TYPE_UNSIGNED (inter_type);
  	  int final_int = INTEGRAL_TYPE_P (type);
  	  int final_ptr = POINTER_TYPE_P (type);
  	  int final_float = FLOAT_TYPE_P (type);
  	  unsigned int final_prec = TYPE_PRECISION (type);
! 	  int final_unsignedp = TYPE_UNSIGNED (type);
  
  	  /* In addition to the cases of two conversions in a row
*************** fold (tree expr)
*** 5734,5738 ****
  	  int change = 0;
  
! 	  if (TREE_UNSIGNED (TREE_TYPE (and))
  	      || (TYPE_PRECISION (type)
  		  <= TYPE_PRECISION (TREE_TYPE (and))))
--- 5738,5742 ----
  	  int change = 0;
  
! 	  if (TYPE_UNSIGNED (TREE_TYPE (and))
  	      || (TYPE_PRECISION (type)
  		  <= TYPE_PRECISION (TREE_TYPE (and))))
*************** fold (tree expr)
*** 6088,6092 ****
  	    && operand_equal_p (TREE_OPERAND (arg0, 0),
  			        TREE_OPERAND (arg1, 0), 0)
! 	    && TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (arg0, 0))))
  	  {
  	    tree tree01, tree11;
--- 6092,6096 ----
  	    && operand_equal_p (TREE_OPERAND (arg0, 0),
  			        TREE_OPERAND (arg1, 0), 0)
! 	    && TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (arg0, 0))))
  	  {
  	    tree tree01, tree11;
*************** fold (tree expr)
*** 6669,6673 ****
        /* Simplify ((int)c & 0377) into (int)c, if c is unsigned char.  */
        if (TREE_CODE (arg1) == INTEGER_CST && TREE_CODE (arg0) == NOP_EXPR
! 	  && TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (arg0, 0))))
  	{
  	  unsigned int prec
--- 6673,6677 ----
        /* Simplify ((int)c & 0377) into (int)c, if c is unsigned char.  */
        if (TREE_CODE (arg1) == INTEGER_CST && TREE_CODE (arg0) == NOP_EXPR
! 	  && TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (arg0, 0))))
  	{
  	  unsigned int prec
*************** fold (tree expr)
*** 6939,6943 ****
      case RSHIFT_EXPR:
        /* Optimize -1 >> x for arithmetic right shifts.  */
!       if (integer_all_onesp (arg0) && ! TREE_UNSIGNED (type))
  	return omit_one_operand (type, arg0, arg1);
        /* ... fall through ...  */
--- 6943,6947 ----
      case RSHIFT_EXPR:
        /* Optimize -1 >> x for arithmetic right shifts.  */
!       if (integer_all_onesp (arg0) && !TYPE_UNSIGNED (type))
  	return omit_one_operand (type, arg0, arg1);
        /* ... fall through ...  */
*************** fold (tree expr)
*** 7414,7418 ****
  	    signed_max = ((unsigned HOST_WIDE_INT) 1 << (width - 1)) - 1;
  
! 	    if (TREE_UNSIGNED (TREE_TYPE (arg1)))
  	      {
  	        max = ((unsigned HOST_WIDE_INT) 2 << (width - 1)) - 1;
--- 7418,7422 ----
  	    signed_max = ((unsigned HOST_WIDE_INT) 1 << (width - 1)) - 1;
  
! 	    if (TYPE_UNSIGNED (TREE_TYPE (arg1)))
  	      {
  	        max = ((unsigned HOST_WIDE_INT) 2 << (width - 1)) - 1;
*************** fold (tree expr)
*** 7503,7507 ****
  	    else if (TREE_INT_CST_HIGH (arg1) == 0
  		     && TREE_INT_CST_LOW (arg1) == signed_max
! 		     && TREE_UNSIGNED (TREE_TYPE (arg1))
  		     /* signed_type does not work on pointer types.  */
  		     && INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
--- 7507,7511 ----
  	    else if (TREE_INT_CST_HIGH (arg1) == 0
  		     && TREE_INT_CST_LOW (arg1) == signed_max
! 		     && TYPE_UNSIGNED (TREE_TYPE (arg1))
  		     /* signed_type does not work on pointer types.  */
  		     && INTEGRAL_TYPE_P (TREE_TYPE (arg1)))
*************** fold (tree expr)
*** 7560,7565 ****
  	       && (tem = get_unwidened (arg0, NULL_TREE)) != arg0
  	       && (code == EQ_EXPR || code == NE_EXPR
! 		   || TREE_UNSIGNED (TREE_TYPE (arg0))
! 		      == TREE_UNSIGNED (TREE_TYPE (tem)))
  	       && (t1 = get_unwidened (arg1, TREE_TYPE (tem))) != 0
  	       && (TREE_TYPE (t1) == TREE_TYPE (tem)
--- 7564,7569 ----
  	       && (tem = get_unwidened (arg0, NULL_TREE)) != arg0
  	       && (code == EQ_EXPR || code == NE_EXPR
! 		   || TYPE_UNSIGNED (TREE_TYPE (arg0))
! 		      == TYPE_UNSIGNED (TREE_TYPE (tem)))
  	       && (t1 = get_unwidened (arg1, TREE_TYPE (tem))) != 0
  	       && (TREE_TYPE (t1) == TREE_TYPE (tem)
*************** fold (tree expr)
*** 7632,7636 ****
        if ((code == NE_EXPR || code == EQ_EXPR)
  	  && integer_zerop (arg1)
! 	  && ! TREE_UNSIGNED (TREE_TYPE (arg0))
  	  && (TREE_CODE (arg0) == TRUNC_MOD_EXPR
  	      || TREE_CODE (arg0) == CEIL_MOD_EXPR
--- 7636,7640 ----
        if ((code == NE_EXPR || code == EQ_EXPR)
  	  && integer_zerop (arg1)
! 	  && !TYPE_UNSIGNED (TREE_TYPE (arg0))
  	  && (TREE_CODE (arg0) == TRUNC_MOD_EXPR
  	      || TREE_CODE (arg0) == CEIL_MOD_EXPR
*************** fold (tree expr)
*** 7707,7711 ****
  	 and similarly for >= into !=.  */
        if ((code == LT_EXPR || code == GE_EXPR)
! 	  && TREE_UNSIGNED (TREE_TYPE (arg0))
  	  && TREE_CODE (arg1) == LSHIFT_EXPR
  	  && integer_onep (TREE_OPERAND (arg1, 0)))
--- 7711,7715 ----
  	 and similarly for >= into !=.  */
        if ((code == LT_EXPR || code == GE_EXPR)
! 	  && TYPE_UNSIGNED (TREE_TYPE (arg0))
  	  && TREE_CODE (arg1) == LSHIFT_EXPR
  	  && integer_onep (TREE_OPERAND (arg1, 0)))
*************** fold (tree expr)
*** 7716,7720 ****
  
        else if ((code == LT_EXPR || code == GE_EXPR)
! 	       && TREE_UNSIGNED (TREE_TYPE (arg0))
  	       && (TREE_CODE (arg1) == NOP_EXPR
  		   || TREE_CODE (arg1) == CONVERT_EXPR)
--- 7720,7724 ----
  
        else if ((code == LT_EXPR || code == GE_EXPR)
! 	       && TYPE_UNSIGNED (TREE_TYPE (arg0))
  	       && (TREE_CODE (arg1) == NOP_EXPR
  		   || TREE_CODE (arg1) == CONVERT_EXPR)
*************** fold (tree expr)
*** 8002,8006 ****
  	      case GE_EXPR:
  	      case GT_EXPR:
! 		if (TREE_UNSIGNED (TREE_TYPE (arg1)))
  		  arg1 = fold_convert (lang_hooks.types.signed_type
  				       (TREE_TYPE (arg1)), arg1);
--- 8006,8010 ----
  	      case GE_EXPR:
  	      case GT_EXPR:
! 		if (TYPE_UNSIGNED (TREE_TYPE (arg1)))
  		  arg1 = fold_convert (lang_hooks.types.signed_type
  				       (TREE_TYPE (arg1)), arg1);
*************** fold (tree expr)
*** 8009,8013 ****
  	      case LE_EXPR:
  	      case LT_EXPR:
! 		if (TREE_UNSIGNED (TREE_TYPE (arg1)))
  		  arg1 = fold_convert (lang_hooks.types.signed_type
  				       (TREE_TYPE (arg1)), arg1);
--- 8013,8017 ----
  	      case LE_EXPR:
  	      case LT_EXPR:
! 		if (TYPE_UNSIGNED (TREE_TYPE (arg1)))
  		  arg1 = fold_convert (lang_hooks.types.signed_type
  				       (TREE_TYPE (arg1)), arg1);
*************** multiple_of_p (tree type, tree top, tree
*** 8656,8660 ****
      case INTEGER_CST:
        if (TREE_CODE (bottom) != INTEGER_CST
! 	  || (TREE_UNSIGNED (type)
  	      && (tree_int_cst_sgn (top) < 0
  		  || tree_int_cst_sgn (bottom) < 0)))
--- 8660,8664 ----
      case INTEGER_CST:
        if (TREE_CODE (bottom) != INTEGER_CST
! 	  || (TYPE_UNSIGNED (type)
  	      && (tree_int_cst_sgn (top) < 0
  		  || tree_int_cst_sgn (bottom) < 0)))
*************** tree_expr_nonnegative_p (tree t)
*** 8697,8702 ****
  	  tree inner1 = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 0), 0));
  	  tree inner2 = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 1), 0));
! 	  if (TREE_CODE (inner1) == INTEGER_TYPE && TREE_UNSIGNED (inner1)
! 	      && TREE_CODE (inner2) == INTEGER_TYPE && TREE_UNSIGNED (inner2))
  	    {
  	      unsigned int prec = MAX (TYPE_PRECISION (inner1),
--- 8701,8706 ----
  	  tree inner1 = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 0), 0));
  	  tree inner2 = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 1), 0));
! 	  if (TREE_CODE (inner1) == INTEGER_TYPE && TYPE_UNSIGNED (inner1)
! 	      && TREE_CODE (inner2) == INTEGER_TYPE && TYPE_UNSIGNED (inner2))
  	    {
  	      unsigned int prec = MAX (TYPE_PRECISION (inner1),
*************** tree_expr_nonnegative_p (tree t)
*** 8725,8730 ****
  	  tree inner1 = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 0), 0));
  	  tree inner2 = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 1), 0));
! 	  if (TREE_CODE (inner1) == INTEGER_TYPE && TREE_UNSIGNED (inner1)
! 	      && TREE_CODE (inner2) == INTEGER_TYPE && TREE_UNSIGNED (inner2))
  	    return TYPE_PRECISION (inner1) + TYPE_PRECISION (inner2)
  		   < TYPE_PRECISION (TREE_TYPE (t));
--- 8729,8734 ----
  	  tree inner1 = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 0), 0));
  	  tree inner2 = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 1), 0));
! 	  if (TREE_CODE (inner1) == INTEGER_TYPE && TYPE_UNSIGNED (inner1)
! 	      && TREE_CODE (inner2) == INTEGER_TYPE && TYPE_UNSIGNED (inner2))
  	    return TYPE_PRECISION (inner1) + TYPE_PRECISION (inner2)
  		   < TYPE_PRECISION (TREE_TYPE (t));
*************** tree_expr_nonnegative_p (tree t)
*** 8768,8772 ****
  	    if (TREE_CODE (inner_type) == INTEGER_TYPE)
  	      {
! 		if (TREE_UNSIGNED (inner_type))
  		  return 1;
  		return tree_expr_nonnegative_p (TREE_OPERAND (t, 0));
--- 8772,8776 ----
  	    if (TREE_CODE (inner_type) == INTEGER_TYPE)
  	      {
! 		if (TYPE_UNSIGNED (inner_type))
  		  return 1;
  		return tree_expr_nonnegative_p (TREE_OPERAND (t, 0));
*************** tree_expr_nonnegative_p (tree t)
*** 8779,8783 ****
  	    if (TREE_CODE (inner_type) == INTEGER_TYPE)
  	      return TYPE_PRECISION (inner_type) < TYPE_PRECISION (outer_type)
! 		      && TREE_UNSIGNED (inner_type);
  	  }
        }
--- 8783,8787 ----
  	    if (TREE_CODE (inner_type) == INTEGER_TYPE)
  	      return TYPE_PRECISION (inner_type) < TYPE_PRECISION (outer_type)
! 		      && TYPE_UNSIGNED (inner_type);
  	  }
        }
*************** tree_expr_nonzero_p (tree t)
*** 8917,8921 ****
      {
      case ABS_EXPR:
!       if (!TREE_UNSIGNED (type) && !flag_wrapv)
  	return tree_expr_nonzero_p (TREE_OPERAND (t, 0));
  
--- 8921,8925 ----
      {
      case ABS_EXPR:
!       if (!TYPE_UNSIGNED (type) && !flag_wrapv)
  	return tree_expr_nonzero_p (TREE_OPERAND (t, 0));
  
*************** tree_expr_nonzero_p (tree t)
*** 8924,8928 ****
  
      case PLUS_EXPR:
!       if (!TREE_UNSIGNED (type) && !flag_wrapv)
  	{
  	  /* With the presence of negative values it is hard
--- 8928,8932 ----
  
      case PLUS_EXPR:
!       if (!TYPE_UNSIGNED (type) && !flag_wrapv)
  	{
  	  /* With the presence of negative values it is hard
*************** tree_expr_nonzero_p (tree t)
*** 8938,8942 ****
  
      case MULT_EXPR:
!       if (!TREE_UNSIGNED (type) && !flag_wrapv)
  	{
  	  return (tree_expr_nonzero_p (TREE_OPERAND (t, 0))
--- 8942,8946 ----
  
      case MULT_EXPR:
!       if (!TYPE_UNSIGNED (type) && !flag_wrapv)
  	{
  	  return (tree_expr_nonzero_p (TREE_OPERAND (t, 0))
*************** fold_negate_const (tree arg0, tree type)
*** 9069,9073 ****
        TREE_OVERFLOW (t)
  	= (TREE_OVERFLOW (arg0)
! 	   | force_fit_type (t, overflow && !TREE_UNSIGNED (type)));
        TREE_CONSTANT_OVERFLOW (t)
  	= TREE_OVERFLOW (t) | TREE_CONSTANT_OVERFLOW (arg0);
--- 9073,9077 ----
        TREE_OVERFLOW (t)
  	= (TREE_OVERFLOW (arg0)
! 	   | force_fit_type (t, overflow && !TYPE_UNSIGNED (type)));
        TREE_CONSTANT_OVERFLOW (t)
  	= TREE_OVERFLOW (t) | TREE_CONSTANT_OVERFLOW (arg0);
*************** fold_abs_const (tree arg0, tree type)
*** 9097,9101 ****
        /* If the value is unsigned, then the absolute value is
  	 the same as the ordinary value.  */
!       if (TREE_UNSIGNED (type))
  	return arg0;
        /* Similarly, if the value is non-negative.  */
--- 9101,9105 ----
        /* If the value is unsigned, then the absolute value is
  	 the same as the ordinary value.  */
!       if (TYPE_UNSIGNED (type))
  	return arg0;
        /* Similarly, if the value is non-negative.  */
*************** fold_relational_const (enum tree_code co
*** 9181,9185 ****
          tem = build_int_2 (tree_int_cst_equal (op0, op1), 0);
        else
!         tem = build_int_2 ((TREE_UNSIGNED (TREE_TYPE (op0))
  			    ? INT_CST_LT_UNSIGNED (op0, op1)
  			    : INT_CST_LT (op0, op1)),
--- 9185,9189 ----
          tem = build_int_2 (tree_int_cst_equal (op0, op1), 0);
        else
!         tem = build_int_2 ((TYPE_UNSIGNED (TREE_TYPE (op0))
  			    ? INT_CST_LT_UNSIGNED (op0, op1)
  			    : INT_CST_LT (op0, op1)),
*** function.c	31 Mar 2004 18:13:50 -0000	1.508
--- function.c	31 Mar 2004 20:44:28 -0000
*************** assign_temp (tree type_or_decl, int keep
*** 853,857 ****
    mode = TYPE_MODE (type);
  #ifndef PROMOTE_FOR_CALL_ONLY
!   unsignedp = TREE_UNSIGNED (type);
  #endif
  
--- 853,857 ----
    mode = TYPE_MODE (type);
  #ifndef PROMOTE_FOR_CALL_ONLY
!   unsignedp = TYPE_UNSIGNED (type);
  #endif
  
*************** schedule_fixup_var_refs (struct function
*** 1489,1493 ****
  			 enum machine_mode promoted_mode, htab_t ht)
  {
!   int unsigned_p = type ? TREE_UNSIGNED (type) : 0;
  
    if (function != 0)
--- 1489,1493 ----
  			 enum machine_mode promoted_mode, htab_t ht)
  {
!   int unsigned_p = type ? TYPE_UNSIGNED (type) : 0;
  
    if (function != 0)
*************** gen_mem_addressof (rtx reg, tree decl, i
*** 2883,2887 ****
        if (rescan
  	  && (TREE_USED (decl) || (DECL_P (decl) && DECL_INITIAL (decl) != 0)))
! 	fixup_var_refs (reg, GET_MODE (reg), TREE_UNSIGNED (type), reg, 0);
      }
    else if (rescan)
--- 2883,2887 ----
        if (rescan
  	  && (TREE_USED (decl) || (DECL_P (decl) && DECL_INITIAL (decl) != 0)))
! 	fixup_var_refs (reg, GET_MODE (reg), TYPE_UNSIGNED (type), reg, 0);
      }
    else if (rescan)
*************** assign_parms (tree fndecl)
*** 4477,4482 ****
  	{
  	  /* Compute the mode in which the arg is actually extended to.  */
! 	  unsignedp = TREE_UNSIGNED (passed_type);
! 	  promoted_mode = promote_mode (passed_type, promoted_mode, &unsignedp, 1);
  	}
  
--- 4477,4483 ----
  	{
  	  /* Compute the mode in which the arg is actually extended to.  */
! 	  unsignedp = TYPE_UNSIGNED (passed_type);
! 	  promoted_mode = promote_mode (passed_type, promoted_mode,
! 					&unsignedp, 1);
  	}
  
*************** assign_parms (tree fndecl)
*** 4902,4906 ****
  	  unsigned int regno, regnoi = 0, regnor = 0;
  
! 	  unsignedp = TREE_UNSIGNED (TREE_TYPE (parm));
  
  	  promoted_nominal_mode
--- 4903,4907 ----
  	  unsigned int regno, regnoi = 0, regnor = 0;
  
! 	  unsignedp = TYPE_UNSIGNED (TREE_TYPE (parm));
  
  	  promoted_nominal_mode
*************** assign_parms (tree fndecl)
*** 5002,5006 ****
  		{
  		  rtx tempreg = gen_reg_rtx (GET_MODE (DECL_RTL (parm)));
! 		  int unsigned_p = TREE_UNSIGNED (TREE_TYPE (parm));
  		  push_to_sequence (conversion_insns);
  		  emit_move_insn (tempreg, DECL_RTL (parm));
--- 5003,5007 ----
  		{
  		  rtx tempreg = gen_reg_rtx (GET_MODE (DECL_RTL (parm)));
! 		  int unsigned_p = TYPE_UNSIGNED (TREE_TYPE (parm));
  		  push_to_sequence (conversion_insns);
  		  emit_move_insn (tempreg, DECL_RTL (parm));
*************** assign_parms (tree fndecl)
*** 5195,5199 ****
  	      push_to_sequence (conversion_insns);
  	      entry_parm = convert_to_mode (nominal_mode, tempreg,
! 					    TREE_UNSIGNED (TREE_TYPE (parm)));
  	      if (stack_parm)
  		/* ??? This may need a big-endian conversion on sparc64.  */
--- 5196,5200 ----
  	      push_to_sequence (conversion_insns);
  	      entry_parm = convert_to_mode (nominal_mode, tempreg,
! 					    TYPE_UNSIGNED (TREE_TYPE (parm)));
  	      if (stack_parm)
  		/* ??? This may need a big-endian conversion on sparc64.  */
*************** promoted_input_arg (unsigned int regno, 
*** 5443,5447 ****
        {
  	enum machine_mode mode = TYPE_MODE (TREE_TYPE (arg));
! 	int unsignedp = TREE_UNSIGNED (TREE_TYPE (arg));
  
  	mode = promote_mode (TREE_TYPE (arg), mode, &unsignedp, 1);
--- 5444,5448 ----
        {
  	enum machine_mode mode = TYPE_MODE (TREE_TYPE (arg));
! 	int unsignedp = TYPE_UNSIGNED (TREE_TYPE (arg));
  
  	mode = promote_mode (TREE_TYPE (arg), mode, &unsignedp, 1);
*************** expand_function_end (void)
*** 7136,7140 ****
  	  if (GET_MODE (real_decl_rtl) != GET_MODE (decl_rtl))
  	    {
! 	      int unsignedp = TREE_UNSIGNED (TREE_TYPE (decl_result));
  
  	      if (targetm.calls.promote_function_return (TREE_TYPE (current_function_decl)))
--- 7137,7141 ----
  	  if (GET_MODE (real_decl_rtl) != GET_MODE (decl_rtl))
  	    {
! 	      int unsignedp = TYPE_UNSIGNED (TREE_TYPE (decl_result));
  
  	      if (targetm.calls.promote_function_return (TREE_TYPE (current_function_decl)))
*** integrate.c	22 Mar 2004 02:57:27 -0000	1.253
--- integrate.c	31 Mar 2004 20:44:30 -0000
*************** expand_inline_function (tree fndecl, tre
*** 762,766 ****
  	  if (GET_MODE (loc) != TYPE_MODE (TREE_TYPE (arg)))
  	    {
! 	      int unsignedp = TREE_UNSIGNED (TREE_TYPE (formal));
  	      enum machine_mode pmode = TYPE_MODE (TREE_TYPE (formal));
  
--- 762,766 ----
  	  if (GET_MODE (loc) != TYPE_MODE (TREE_TYPE (arg)))
  	    {
! 	      int unsignedp = TYPE_UNSIGNED (TREE_TYPE (formal));
  	      enum machine_mode pmode = TYPE_MODE (TREE_TYPE (formal));
  
*** optabs.c	23 Mar 2004 21:54:36 -0000	1.212
--- optabs.c	31 Mar 2004 20:44:33 -0000
*************** prepare_cmp_insn (rtx *px, rtx *py, enum
*** 3645,3649 ****
        cmp_mode = TYPE_MODE (length_type);
        size = convert_to_mode (TYPE_MODE (length_type), size,
! 			      TREE_UNSIGNED (length_type));
  
        result = emit_library_call_value (libfunc, 0, LCT_PURE_MAKE_BLOCK,
--- 3645,3649 ----
        cmp_mode = TYPE_MODE (length_type);
        size = convert_to_mode (TYPE_MODE (length_type), size,
! 			      TYPE_UNSIGNED (length_type));
  
        result = emit_library_call_value (libfunc, 0, LCT_PURE_MAKE_BLOCK,
*** sdbout.c	19 Feb 2004 17:21:14 -0000	1.88
--- sdbout.c	31 Mar 2004 20:44:36 -0000
*************** plain_type_1 (tree type, int level)
*** 539,551 ****
  
  	if (size == INT_TYPE_SIZE)
! 	  return (TREE_UNSIGNED (type) ? T_UINT : T_INT);
  	if (size == CHAR_TYPE_SIZE)
! 	  return (TREE_UNSIGNED (type) ? T_UCHAR : T_CHAR);
  	if (size == SHORT_TYPE_SIZE)
! 	  return (TREE_UNSIGNED (type) ? T_USHORT : T_SHORT);
  	if (size == LONG_TYPE_SIZE)
! 	  return (TREE_UNSIGNED (type) ? T_ULONG : T_LONG);
  	if (size == LONG_LONG_TYPE_SIZE)	/* better than nothing */
! 	  return (TREE_UNSIGNED (type) ? T_ULONG : T_LONG);
  	return 0;
        }
--- 539,551 ----
  
  	if (size == INT_TYPE_SIZE)
! 	  return (TYPE_UNSIGNED (type) ? T_UINT : T_INT);
  	if (size == CHAR_TYPE_SIZE)
! 	  return (TYPE_UNSIGNED (type) ? T_UCHAR : T_CHAR);
  	if (size == SHORT_TYPE_SIZE)
! 	  return (TYPE_UNSIGNED (type) ? T_USHORT : T_SHORT);
  	if (size == LONG_TYPE_SIZE)
! 	  return (TYPE_UNSIGNED (type) ? T_ULONG : T_LONG);
  	if (size == LONG_LONG_TYPE_SIZE)	/* better than nothing */
! 	  return (TYPE_UNSIGNED (type) ? T_ULONG : T_LONG);
  	return 0;
        }
*** stmt.c	25 Mar 2004 16:16:41 -0000	1.351
--- stmt.c	31 Mar 2004 20:44:39 -0000
*************** expand_value_return (rtx val)
*** 3003,3007 ****
        if (targetm.calls.promote_function_return (TREE_TYPE (current_function_decl)))
        {
! 	int unsignedp = TREE_UNSIGNED (type);
  	enum machine_mode old_mode
  	  = DECL_MODE (DECL_RESULT (current_function_decl));
--- 3003,3007 ----
        if (targetm.calls.promote_function_return (TREE_TYPE (current_function_decl)))
        {
! 	int unsignedp = TYPE_UNSIGNED (type);
  	enum machine_mode old_mode
  	  = DECL_MODE (DECL_RESULT (current_function_decl));
*************** tail_recursion_args (tree actuals, tree 
*** 3360,3364 ****
  	{
  	  rtx tmp = argvec[i];
! 	  int unsignedp = TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a)));
  	  promote_mode(TREE_TYPE (TREE_VALUE (a)), GET_MODE (tmp),
  		       &unsignedp, 0);
--- 3360,3364 ----
  	{
  	  rtx tmp = argvec[i];
! 	  int unsignedp = TYPE_UNSIGNED (TREE_TYPE (TREE_VALUE (a)));
  	  promote_mode(TREE_TYPE (TREE_VALUE (a)), GET_MODE (tmp),
  		       &unsignedp, 0);
*************** expand_decl (tree decl)
*** 3946,3950 ****
      {
        /* Automatic variable that can go in a register.  */
!       int unsignedp = TREE_UNSIGNED (type);
        enum machine_mode reg_mode
  	= promote_mode (type, DECL_MODE (decl), &unsignedp, 0);
--- 3946,3950 ----
      {
        /* Automatic variable that can go in a register.  */
!       int unsignedp = TYPE_UNSIGNED (type);
        enum machine_mode reg_mode
  	= promote_mode (type, DECL_MODE (decl), &unsignedp, 0);
*************** expand_end_case_type (tree orig_index, t
*** 5345,5349 ****
    index_expr = thiscase->data.case_stmt.index_expr;
    index_type = TREE_TYPE (index_expr);
!   unsignedp = TREE_UNSIGNED (index_type);
    if (orig_type == NULL)
      orig_type = TREE_TYPE (orig_index);
--- 5345,5349 ----
    index_expr = thiscase->data.case_stmt.index_expr;
    index_type = TREE_TYPE (index_expr);
!   unsignedp = TYPE_UNSIGNED (index_type);
    if (orig_type == NULL)
      orig_type = TREE_TYPE (orig_index);
*************** emit_case_nodes (rtx index, case_node_pt
*** 6146,6150 ****
  {
    /* If INDEX has an unsigned type, we must make unsigned branches.  */
!   int unsignedp = TREE_UNSIGNED (index_type);
    enum machine_mode mode = GET_MODE (index);
    enum machine_mode imode = TYPE_MODE (index_type);
--- 6146,6150 ----
  {
    /* If INDEX has an unsigned type, we must make unsigned branches.  */
!   int unsignedp = TYPE_UNSIGNED (index_type);
    enum machine_mode mode = GET_MODE (index);
    enum machine_mode imode = TYPE_MODE (index_type);
*** stor-layout.c	20 Mar 2004 16:50:36 -0000	1.183
--- stor-layout.c	31 Mar 2004 20:44:41 -0000
*************** layout_decl (tree decl, unsigned int kno
*** 365,369 ****
       don't set it again since we can be called twice for FIELD_DECLs.  */
  
!   TREE_UNSIGNED (decl) = TREE_UNSIGNED (type);
    if (DECL_MODE (decl) == VOIDmode)
      DECL_MODE (decl) = TYPE_MODE (type);
--- 365,369 ----
       don't set it again since we can be called twice for FIELD_DECLs.  */
  
!   TREE_UNSIGNED (decl) = TYPE_UNSIGNED (type);
    if (DECL_MODE (decl) == VOIDmode)
      DECL_MODE (decl) = TYPE_MODE (type);
*************** layout_type (tree type)
*** 1530,1534 ****
        if (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST
  	  && tree_int_cst_sgn (TYPE_MIN_VALUE (type)) >= 0)
! 	TREE_UNSIGNED (type) = 1;
  
        TYPE_MODE (type) = smallest_mode_for_size (TYPE_PRECISION (type),
--- 1530,1534 ----
        if (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST
  	  && tree_int_cst_sgn (TYPE_MIN_VALUE (type)) >= 0)
! 	TYPE_UNSIGNED (type) = 1;
  
        TYPE_MODE (type) = smallest_mode_for_size (TYPE_PRECISION (type),
*************** layout_type (tree type)
*** 1545,1553 ****
  
      case COMPLEX_TYPE:
!       TREE_UNSIGNED (type) = TREE_UNSIGNED (TREE_TYPE (type));
        TYPE_MODE (type)
  	= mode_for_size (2 * TYPE_PRECISION (TREE_TYPE (type)),
! 			 (TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE
! 			  ? MODE_COMPLEX_INT : MODE_COMPLEX_FLOAT),
  			 0);
        TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
--- 1545,1553 ----
  
      case COMPLEX_TYPE:
!       TYPE_UNSIGNED (type) = TYPE_UNSIGNED (TREE_TYPE (type));
        TYPE_MODE (type)
  	= mode_for_size (2 * TYPE_PRECISION (TREE_TYPE (type)),
! 			 (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE
! 			  ? MODE_COMPLEX_FLOAT : MODE_COMPLEX_INT),
  			 0);
        TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
*************** layout_type (tree type)
*** 1556,1567 ****
  
      case VECTOR_TYPE:
!       {
! 	tree subtype;
! 
! 	subtype = TREE_TYPE (type);
! 	TREE_UNSIGNED (type) = TREE_UNSIGNED (subtype);
! 	TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
! 	TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
!       }
        break;
  
--- 1556,1562 ----
  
      case VECTOR_TYPE:
!       TYPE_UNSIGNED (type) = TYPE_UNSIGNED (TREE_TYPE (type));
!       TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
!       TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
        break;
  
*************** layout_type (tree type)
*** 1603,1607 ****
  	TYPE_SIZE (type) = bitsize_int (nbits);
  	TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (mode));
! 	TREE_UNSIGNED (type) = 1;
  	TYPE_PRECISION (type) = nbits;
        }
--- 1598,1602 ----
  	TYPE_SIZE (type) = bitsize_int (nbits);
  	TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (mode));
! 	TYPE_UNSIGNED (type) = 1;
  	TYPE_PRECISION (type) = nbits;
        }
*************** layout_type (tree type)
*** 1653,1657 ****
  	       if *either* bound is non-constant, but this is the best
  	       compromise between C and Ada.  */
! 	    if (! TREE_UNSIGNED (sizetype)
  		&& TREE_CODE (TYPE_MIN_VALUE (index)) != INTEGER_CST
  		&& TREE_CODE (TYPE_MAX_VALUE (index)) != INTEGER_CST)
--- 1648,1652 ----
  	       if *either* bound is non-constant, but this is the best
  	       compromise between C and Ada.  */
! 	    if (!TYPE_UNSIGNED (sizetype)
  		&& TREE_CODE (TYPE_MIN_VALUE (index)) != INTEGER_CST
  		&& TREE_CODE (TYPE_MAX_VALUE (index)) != INTEGER_CST)
*************** initialize_sizetypes (void)
*** 1852,1856 ****
    TYPE_SIZE (t) = build_int_2 (GET_MODE_BITSIZE (SImode), 0);
    TYPE_SIZE_UNIT (t) = build_int_2 (GET_MODE_SIZE (SImode), 0);
!   TREE_UNSIGNED (t) = 1;
    TYPE_PRECISION (t) = GET_MODE_BITSIZE (SImode);
    TYPE_MIN_VALUE (t) = build_int_2 (0, 0);
--- 1847,1851 ----
    TYPE_SIZE (t) = build_int_2 (GET_MODE_BITSIZE (SImode), 0);
    TYPE_SIZE_UNIT (t) = build_int_2 (GET_MODE_SIZE (SImode), 0);
!   TYPE_UNSIGNED (t) = 1;
    TYPE_PRECISION (t) = GET_MODE_BITSIZE (SImode);
    TYPE_MIN_VALUE (t) = build_int_2 (0, 0);
*************** set_sizetype (tree type)
*** 1896,1900 ****
    TYPE_IS_SIZETYPE (bitsizetype) = 1;
  
!   if (TREE_UNSIGNED (type))
      fixup_unsigned_type (bitsizetype);
    else
--- 1891,1895 ----
    TYPE_IS_SIZETYPE (bitsizetype) = 1;
  
!   if (TYPE_UNSIGNED (type))
      fixup_unsigned_type (bitsizetype);
    else
*************** set_sizetype (tree type)
*** 1903,1907 ****
    layout_type (bitsizetype);
  
!   if (TREE_UNSIGNED (type))
      {
        usizetype = sizetype;
--- 1898,1902 ----
    layout_type (bitsizetype);
  
!   if (TYPE_UNSIGNED (type))
      {
        usizetype = sizetype;
*** tree-dump.c	14 Mar 2004 22:26:11 -0000	1.19
--- tree-dump.c	31 Mar 2004 20:44:42 -0000
*************** dequeue_and_dump (dump_info_p di)
*** 410,414 ****
      case ENUMERAL_TYPE:
        dump_int (di, "prec", TYPE_PRECISION (t));
!       if (TREE_UNSIGNED (t))
  	dump_string (di, "unsigned");
        dump_child ("min", TYPE_MIN_VALUE (t));
--- 410,414 ----
      case ENUMERAL_TYPE:
        dump_int (di, "prec", TYPE_PRECISION (t));
!       if (TYPE_UNSIGNED (t))
  	dump_string (di, "unsigned");
        dump_child ("min", TYPE_MIN_VALUE (t));
*** tree.c	23 Mar 2004 23:47:35 -0000	1.362
--- tree.c	31 Mar 2004 20:44:45 -0000
*************** real_value_from_int_cst (tree type, tree
*** 500,504 ****
    real_from_integer (&d, type ? TYPE_MODE (type) : VOIDmode,
  		     TREE_INT_CST_LOW (i), TREE_INT_CST_HIGH (i),
! 		     TREE_UNSIGNED (TREE_TYPE (i)));
    return d;
  }
--- 500,504 ----
    real_from_integer (&d, type ? TYPE_MODE (type) : VOIDmode,
  		     TREE_INT_CST_LOW (i), TREE_INT_CST_HIGH (i),
! 		     TYPE_UNSIGNED (TREE_TYPE (i)));
    return d;
  }
*************** integer_all_onesp (tree expr)
*** 631,635 ****
      return 0;
  
!   uns = TREE_UNSIGNED (TREE_TYPE (expr));
    if (!uns)
      return (TREE_INT_CST_LOW (expr) == ~(unsigned HOST_WIDE_INT) 0
--- 631,635 ----
      return 0;
  
!   uns = TYPE_UNSIGNED (TREE_TYPE (expr));
    if (!uns)
      return (TREE_INT_CST_LOW (expr) == ~(unsigned HOST_WIDE_INT) 0
*************** tree_int_cst_lt (tree t1, tree t2)
*** 3474,3478 ****
      return 0;
  
!   if (TREE_UNSIGNED (TREE_TYPE (t1)) != TREE_UNSIGNED (TREE_TYPE (t2)))
      {
        int t1_sgn = tree_int_cst_sgn (t1);
--- 3474,3478 ----
      return 0;
  
!   if (TYPE_UNSIGNED (TREE_TYPE (t1)) != TYPE_UNSIGNED (TREE_TYPE (t2)))
      {
        int t1_sgn = tree_int_cst_sgn (t1);
*************** tree_int_cst_lt (tree t1, tree t2)
*** 3487,3491 ****
  	 type.  */
      }
!   else if (! TREE_UNSIGNED (TREE_TYPE (t1)))
      return INT_CST_LT (t1, t2);
  
--- 3487,3491 ----
  	 type.  */
      }
!   else if (!TYPE_UNSIGNED (TREE_TYPE (t1)))
      return INT_CST_LT (t1, t2);
  
*************** host_integerp (tree t, int pos)
*** 3520,3524 ****
  	      || (! pos && TREE_INT_CST_HIGH (t) == -1
  		  && (HOST_WIDE_INT) TREE_INT_CST_LOW (t) < 0
! 		  && ! TREE_UNSIGNED (TREE_TYPE (t)))
  	      || (pos && TREE_INT_CST_HIGH (t) == 0)));
  }
--- 3520,3524 ----
  	      || (! pos && TREE_INT_CST_HIGH (t) == -1
  		  && (HOST_WIDE_INT) TREE_INT_CST_LOW (t) < 0
! 		  && !TYPE_UNSIGNED (TREE_TYPE (t)))
  	      || (pos && TREE_INT_CST_HIGH (t) == 0)));
  }
*************** tree_int_cst_sgn (tree t)
*** 3563,3567 ****
    if (TREE_INT_CST_LOW (t) == 0 && TREE_INT_CST_HIGH (t) == 0)
      return 0;
!   else if (TREE_UNSIGNED (TREE_TYPE (t)))
      return 1;
    else if (TREE_INT_CST_HIGH (t) < 0)
--- 3563,3567 ----
    if (TREE_INT_CST_LOW (t) == 0 && TREE_INT_CST_HIGH (t) == 0)
      return 0;
!   else if (TYPE_UNSIGNED (TREE_TYPE (t)))
      return 1;
    else if (TREE_INT_CST_HIGH (t) < 0)
*************** get_unwidened (tree op, tree for_type)
*** 4365,4369 ****
      = (for_type != 0 && for_type != type
         && final_prec > TYPE_PRECISION (type)
!        && TREE_UNSIGNED (type));
    tree win = op;
  
--- 4365,4369 ----
      = (for_type != 0 && for_type != type
         && final_prec > TYPE_PRECISION (type)
!        && TYPE_UNSIGNED (type));
    tree win = op;
  
*************** get_unwidened (tree op, tree for_type)
*** 4395,4403 ****
  	  if (! uns || final_prec <= TYPE_PRECISION (TREE_TYPE (op)))
  	    win = op;
! 	  /* TREE_UNSIGNED says whether this is a zero-extension.
  	     Let's avoid computing it if it does not affect WIN
  	     and if UNS will not be needed again.  */
  	  if ((uns || TREE_CODE (op) == NOP_EXPR)
! 	      && TREE_UNSIGNED (TREE_TYPE (op)))
  	    {
  	      uns = 1;
--- 4395,4403 ----
  	  if (! uns || final_prec <= TYPE_PRECISION (TREE_TYPE (op)))
  	    win = op;
! 	  /* TYPE_UNSIGNED says whether this is a zero-extension.
  	     Let's avoid computing it if it does not affect WIN
  	     and if UNS will not be needed again.  */
  	  if ((uns || TREE_CODE (op) == NOP_EXPR)
! 	      && TYPE_UNSIGNED (TREE_TYPE (op)))
  	    {
  	      uns = 1;
*************** get_unwidened (tree op, tree for_type)
*** 4417,4421 ****
  	= tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1);
        int unsignedp = (TREE_UNSIGNED (TREE_OPERAND (op, 1))
! 		       || TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 1))));
        type = lang_hooks.types.type_for_size (innerprec, unsignedp);
  
--- 4417,4421 ----
  	= tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1);
        int unsignedp = (TREE_UNSIGNED (TREE_OPERAND (op, 1))
! 		       || TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 1))));
        type = lang_hooks.types.type_for_size (innerprec, unsignedp);
  
*************** get_narrower (tree op, int *unsignedp_pt
*** 4472,4480 ****
  	     but remember whether it is zero or sign extension.  */
  	  if (first)
! 	    uns = TREE_UNSIGNED (TREE_TYPE (op));
  	  /* Otherwise, if a sign extension has been stripped,
  	     only sign extensions can now be stripped;
  	     if a zero extension has been stripped, only zero-extensions.  */
! 	  else if (uns != TREE_UNSIGNED (TREE_TYPE (op)))
  	    break;
  	  first = 0;
--- 4472,4480 ----
  	     but remember whether it is zero or sign extension.  */
  	  if (first)
! 	    uns = TYPE_UNSIGNED (TREE_TYPE (op));
  	  /* Otherwise, if a sign extension has been stripped,
  	     only sign extensions can now be stripped;
  	     if a zero extension has been stripped, only zero-extensions.  */
! 	  else if (uns != TYPE_UNSIGNED (TREE_TYPE (op)))
  	    break;
  	  first = 0;
*************** get_narrower (tree op, int *unsignedp_pt
*** 4485,4489 ****
  	     preserve the unsignedness.  */
  	  if (first)
! 	    uns = TREE_UNSIGNED (TREE_TYPE (op));
  	  first = 0;
  	  op = TREE_OPERAND (op, 0);
--- 4485,4489 ----
  	     preserve the unsignedness.  */
  	  if (first)
! 	    uns = TYPE_UNSIGNED (TREE_TYPE (op));
  	  first = 0;
  	  op = TREE_OPERAND (op, 0);
*************** get_narrower (tree op, int *unsignedp_pt
*** 4502,4506 ****
  	= tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1);
        int unsignedp = (TREE_UNSIGNED (TREE_OPERAND (op, 1))
! 		       || TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 1))));
        tree type = lang_hooks.types.type_for_size (innerprec, unsignedp);
  
--- 4502,4506 ----
  	= tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1);
        int unsignedp = (TREE_UNSIGNED (TREE_OPERAND (op, 1))
! 		       || TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 1))));
        tree type = lang_hooks.types.type_for_size (innerprec, unsignedp);
  
*************** int_fits_type_p (tree c, tree type)
*** 4543,4550 ****
       even if the bounds are not constant.  First, negative integers never fit
       in unsigned types, */
!   if ((TREE_UNSIGNED (type) && tree_int_cst_sgn (c) < 0)
        /* Also, unsigned integers with top bit set never fit signed types.  */
!       || (! TREE_UNSIGNED (type)
! 	  && TREE_UNSIGNED (TREE_TYPE (c)) && tree_int_cst_msb (c)))
      return 0;
  
--- 4543,4550 ----
       even if the bounds are not constant.  First, negative integers never fit
       in unsigned types, */
!   if ((TYPE_UNSIGNED (type) && tree_int_cst_sgn (c) < 0)
        /* Also, unsigned integers with top bit set never fit signed types.  */
!       || (! TYPE_UNSIGNED (type)
! 	  && TYPE_UNSIGNED (TREE_TYPE (c)) && tree_int_cst_msb (c)))
      return 0;
  
*************** build_vector_type_for_mode (tree innerty
*** 5357,5361 ****
    TREE_TYPE (t) = innertype;
    TYPE_MODE (t) = mode;
-   TREE_UNSIGNED (t) = TREE_UNSIGNED (innertype);
    finish_vector_type (t);
    return t;
--- 5357,5360 ----
*** tree.h	30 Mar 2004 19:18:55 -0000	1.484
--- tree.h	31 Mar 2004 20:44:51 -0000
*************** struct tree_common GTY(())
*** 263,268 ****
     unsigned_flag:
  
         TREE_UNSIGNED in
!            INTEGER_TYPE, ENUMERAL_TYPE, FIELD_DECL
         SAVE_EXPR_NOPLACEHOLDER in
  	   SAVE_EXPR
--- 263,270 ----
     unsigned_flag:
  
+        TYPE_UNSIGNED in
+            all types
         TREE_UNSIGNED in
!            FIELD_DECL
         SAVE_EXPR_NOPLACEHOLDER in
  	   SAVE_EXPR
*************** extern void tree_operand_check_failed (i
*** 517,522 ****
  	 && (TYPE_MODE (TREE_TYPE (EXP))			\
  	     == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0))))	\
! 	 && (TREE_UNSIGNED (TREE_TYPE (EXP))			\
! 	     == TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
      (EXP) = TREE_OPERAND (EXP, 0)
  
--- 519,524 ----
  	 && (TYPE_MODE (TREE_TYPE (EXP))			\
  	     == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0))))	\
! 	 && (TYPE_UNSIGNED (TREE_TYPE (EXP))			\
! 	     == TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
      (EXP) = TREE_OPERAND (EXP, 0)
  
*************** extern void tree_operand_check_failed (i
*** 713,718 ****
  #define TREE_UNSIGNED(NODE) ((NODE)->common.unsigned_flag)
  
  #define TYPE_TRAP_SIGNED(NODE) \
!   (flag_trapv && ! TREE_UNSIGNED (TYPE_CHECK (NODE)))
  
  /* Nonzero in a VAR_DECL means assembler code has been written.
--- 715,723 ----
  #define TREE_UNSIGNED(NODE) ((NODE)->common.unsigned_flag)
  
+ /* In integral and pointer types, means an unsigned type.  */
+ #define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->common.unsigned_flag)
+ 
  #define TYPE_TRAP_SIGNED(NODE) \
!   (flag_trapv && ! TYPE_UNSIGNED (NODE))
  
  /* Nonzero in a VAR_DECL means assembler code has been written.
*************** struct tree_vec GTY(())
*** 904,908 ****
  #define SAVE_EXPR_RTL(NODE) TREE_RTL_OPERAND_CHECK (NODE, SAVE_EXPR, 2)
  
! #define SAVE_EXPR_NOPLACEHOLDER(NODE) TREE_UNSIGNED (SAVE_EXPR_CHECK (NODE))
  /* Nonzero if the SAVE_EXPRs value should be kept, even if it occurs
     both in normal code and in a handler.  (Normally, in a handler, all
--- 909,915 ----
  #define SAVE_EXPR_RTL(NODE) TREE_RTL_OPERAND_CHECK (NODE, SAVE_EXPR, 2)
  
! #define SAVE_EXPR_NOPLACEHOLDER(NODE) \
!   (SAVE_EXPR_CHECK (NODE)->common.unsigned_flag)
! 
  /* Nonzero if the SAVE_EXPRs value should be kept, even if it occurs
     both in normal code and in a handler.  (Normally, in a handler, all
*** config/iq2000/iq2000.c	3 Mar 2004 08:34:59 -0000	1.16
--- config/iq2000/iq2000.c	31 Mar 2004 20:45:13 -0000
*************** iq2000_function_value (tree valtype, tre
*** 2658,2662 ****
    int reg = GP_RETURN;
    enum machine_mode mode = TYPE_MODE (valtype);
!   int unsignedp = TREE_UNSIGNED (valtype);
  
    /* Since we define TARGET_PROMOTE_FUNCTION_RETURN that returns true,
--- 2658,2662 ----
    int reg = GP_RETURN;
    enum machine_mode mode = TYPE_MODE (valtype);
!   int unsignedp = TYPE_UNSIGNED (valtype);
  
    /* Since we define TARGET_PROMOTE_FUNCTION_RETURN that returns true,
*** config/m32r/m32r.c	5 Mar 2004 05:37:20 -0000	1.90
--- config/m32r/m32r.c	31 Mar 2004 20:45:20 -0000
*************** block_move_call (rtx dest_reg, rtx src_r
*** 2759,2763 ****
  		     VOIDmode, 3, dest_reg, Pmode, src_reg, Pmode,
  		     convert_to_mode (TYPE_MODE (sizetype), bytes_rtx,
! 				      TREE_UNSIGNED (sizetype)),
  		     TYPE_MODE (sizetype));
  #else
--- 2759,2763 ----
  		     VOIDmode, 3, dest_reg, Pmode, src_reg, Pmode,
  		     convert_to_mode (TYPE_MODE (sizetype), bytes_rtx,
! 				      TYPE_UNSIGNED (sizetype)),
  		     TYPE_MODE (sizetype));
  #else
*************** block_move_call (rtx dest_reg, rtx src_r
*** 2765,2769 ****
  		     VOIDmode, 3, src_reg, Pmode, dest_reg, Pmode,
  		     convert_to_mode (TYPE_MODE (integer_type_node), bytes_rtx,
! 				      TREE_UNSIGNED (integer_type_node)),
  		     TYPE_MODE (integer_type_node));
  #endif
--- 2765,2769 ----
  		     VOIDmode, 3, src_reg, Pmode, dest_reg, Pmode,
  		     convert_to_mode (TYPE_MODE (integer_type_node), bytes_rtx,
! 				      TYPE_UNSIGNED (integer_type_node)),
  		     TYPE_MODE (integer_type_node));
  #endif
*** config/mips/mips.c	24 Mar 2004 13:05:36 -0000	1.399
--- config/mips/mips.c	31 Mar 2004 20:45:33 -0000
*************** mips_function_value (tree valtype, tree 
*** 7510,7514 ****
  
        mode = TYPE_MODE (valtype);
!       unsignedp = TREE_UNSIGNED (valtype);
  
        /* Since we define TARGET_PROMOTE_FUNCTION_RETURN that returns
--- 7510,7514 ----
  
        mode = TYPE_MODE (valtype);
!       unsignedp = TYPE_UNSIGNED (valtype);
  
        /* Since we define TARGET_PROMOTE_FUNCTION_RETURN that returns
*** config/rs6000/rs6000.c	30 Mar 2004 08:25:30 -0000	1.618
--- config/rs6000/rs6000.c	31 Mar 2004 20:45:44 -0000
*************** rs6000_handle_altivec_attribute (tree *n
*** 14917,14921 ****
      {
      case 'v':
!       unsigned_p = TREE_UNSIGNED (type);
        switch (mode)
  	{
--- 14917,14921 ----
      {
      case 'v':
!       unsigned_p = TYPE_UNSIGNED (type);
        switch (mode)
  	{
*** config/s390/s390.c	13 Mar 2004 11:22:27 -0000	1.139
--- config/s390/s390.c	31 Mar 2004 20:45:49 -0000
*************** s390_function_value (tree type, enum mac
*** 6128,6132 ****
    if (type)
      {
!       int unsignedp = TREE_UNSIGNED (type);
        mode = promote_mode (type, TYPE_MODE (type), &unsignedp, 1);
      }
--- 6128,6132 ----
    if (type)
      {
!       int unsignedp = TYPE_UNSIGNED (type);
        mode = promote_mode (type, TYPE_MODE (type), &unsignedp, 1);
      }
*** config/sparc/sparc.c	10 Mar 2004 00:17:35 -0000	1.295
--- config/sparc/sparc.c	31 Mar 2004 20:45:57 -0000
*************** sparc_type_code (register tree type)
*** 7324,7328 ****
  	  /* Carefully distinguish all the standard types of C,
  	     without messing up if the language is not C.  We do this by
! 	     testing TYPE_PRECISION and TREE_UNSIGNED.  The old code used to
  	     look at both the names and the above fields, but that's redundant.
  	     Any type whose size is between two C types will be considered
--- 7324,7328 ----
  	  /* Carefully distinguish all the standard types of C,
  	     without messing up if the language is not C.  We do this by
! 	     testing TYPE_PRECISION and TYPE_UNSIGNED.  The old code used to
  	     look at both the names and the above fields, but that's redundant.
  	     Any type whose size is between two C types will be considered
*************** sparc_type_code (register tree type)
*** 7334,7347 ****
  
  	  if (TYPE_PRECISION (type) <= CHAR_TYPE_SIZE)
! 	    return (qualifiers | (TREE_UNSIGNED (type) ? 12 : 2));
    
  	  else if (TYPE_PRECISION (type) <= SHORT_TYPE_SIZE)
! 	    return (qualifiers | (TREE_UNSIGNED (type) ? 13 : 3));
    
  	  else if (TYPE_PRECISION (type) <= INT_TYPE_SIZE)
! 	    return (qualifiers | (TREE_UNSIGNED (type) ? 14 : 4));
    
  	  else
! 	    return (qualifiers | (TREE_UNSIGNED (type) ? 15 : 5));
    
  	case REAL_TYPE:
--- 7334,7347 ----
  
  	  if (TYPE_PRECISION (type) <= CHAR_TYPE_SIZE)
! 	    return (qualifiers | (TYPE_UNSIGNED (type) ? 12 : 2));
    
  	  else if (TYPE_PRECISION (type) <= SHORT_TYPE_SIZE)
! 	    return (qualifiers | (TYPE_UNSIGNED (type) ? 13 : 3));
    
  	  else if (TYPE_PRECISION (type) <= INT_TYPE_SIZE)
! 	    return (qualifiers | (TYPE_UNSIGNED (type) ? 14 : 4));
    
  	  else
! 	    return (qualifiers | (TYPE_UNSIGNED (type) ? 15 : 5));
    
  	case REAL_TYPE:
*** cp/call.c	20 Mar 2004 00:18:13 -0000	1.472
--- cp/call.c	31 Mar 2004 20:46:01 -0000
*************** joust (struct z_candidate *cand1, struct
*** 5923,5927 ****
  	      && (TYPE_PRECISION (t1->type)
  		  == TYPE_PRECISION (t2->type))
! 	      && (TREE_UNSIGNED (t1->u.next->type)
  		  || (TREE_CODE (t1->u.next->type)
  		      == ENUMERAL_TYPE)))
--- 5923,5927 ----
  	      && (TYPE_PRECISION (t1->type)
  		  == TYPE_PRECISION (t2->type))
! 	      && (TYPE_UNSIGNED (t1->u.next->type)
  		  || (TREE_CODE (t1->u.next->type)
  		      == ENUMERAL_TYPE)))
*** cp/class.c	18 Mar 2004 20:58:44 -0000	1.604
--- cp/class.c	31 Mar 2004 20:46:06 -0000
*************** check_bitfield_decl (tree field)
*** 2711,2719 ****
  	       && (0 > compare_tree_int (w,
  					 min_precision (TYPE_MIN_VALUE (type),
! 							TREE_UNSIGNED (type)))
  		   ||  0 > compare_tree_int (w,
  					     min_precision
  					     (TYPE_MAX_VALUE (type),
! 					      TREE_UNSIGNED (type)))))
  	cp_warning_at ("`%D' is too small to hold all values of `%#T'",
  		       field, type);
--- 2711,2719 ----
  	       && (0 > compare_tree_int (w,
  					 min_precision (TYPE_MIN_VALUE (type),
! 							TYPE_UNSIGNED (type)))
  		   ||  0 > compare_tree_int (w,
  					     min_precision
  					     (TYPE_MAX_VALUE (type),
! 					      TYPE_UNSIGNED (type)))))
  	cp_warning_at ("`%D' is too small to hold all values of `%#T'",
  		       field, type);
*************** build_vtt_inits (tree binfo, tree t, tre
*** 6907,6919 ****
  }
  
! /* Called from build_vtt_inits via dfs_walk.  BINFO is the binfo
!    for the base in most derived. DATA is a TREE_LIST who's
!    TREE_CHAIN is the type of the base being
!    constructed whilst this secondary vptr is live.  The TREE_UNSIGNED
!    flag of DATA indicates that this is a constructor vtable.  The
     TREE_TOP_LEVEL flag indicates that this is the primary VTT.  */
  
  static tree
! dfs_build_secondary_vptr_vtt_inits (tree binfo, void* data)
  {
    tree l; 
--- 6907,6917 ----
  }
  
! /* Called from build_vtt_inits via dfs_walk.  BINFO is the binfo for the base
!    in most derived. DATA is a TREE_LIST who's TREE_CHAIN is the type of the
!    base being constructed whilst this secondary vptr is live.  The
     TREE_TOP_LEVEL flag indicates that this is the primary VTT.  */
  
  static tree
! dfs_build_secondary_vptr_vtt_inits (tree binfo, void *data)
  {
    tree l; 
*** cp/cvt.c	23 Feb 2004 12:40:59 -0000	1.154
--- cp/cvt.c	31 Mar 2004 20:46:08 -0000
*************** type_promotes_to (tree type)
*** 1117,1121 ****
  			   TYPE_PRECISION (integer_type_node));
        tree totype = c_common_type_for_size (precision, 0);
!       if (TREE_UNSIGNED (type)
  	  && ! int_fits_type_p (TYPE_MAX_VALUE (type), totype))
  	type = c_common_type_for_size (precision, 1);
--- 1117,1121 ----
  			   TYPE_PRECISION (integer_type_node));
        tree totype = c_common_type_for_size (precision, 0);
!       if (TYPE_UNSIGNED (type)
  	  && ! int_fits_type_p (TYPE_MAX_VALUE (type), totype))
  	type = c_common_type_for_size (precision, 1);
*************** type_promotes_to (tree type)
*** 1126,1130 ****
      {
        /* Retain unsignedness if really not getting bigger.  */
!       if (TREE_UNSIGNED (type)
  	  && TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
  	type = unsigned_type_node;
--- 1126,1130 ----
      {
        /* Retain unsignedness if really not getting bigger.  */
!       if (TYPE_UNSIGNED (type)
  	  && TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
  	type = unsigned_type_node;
*** cp/decl.c	30 Mar 2004 23:44:58 -0000	1.1199
--- cp/decl.c	31 Mar 2004 20:46:15 -0000
*************** finish_enum (tree enumtype)
*** 9760,9764 ****
        underlying_type = integer_types[itk];
        if (TYPE_PRECISION (underlying_type) >= precision
! 	  && TREE_UNSIGNED (underlying_type) == unsignedp)
  	break;
      }
--- 9760,9764 ----
        underlying_type = integer_types[itk];
        if (TYPE_PRECISION (underlying_type) >= precision
! 	  && TYPE_UNSIGNED (underlying_type) == unsignedp)
  	break;
      }
*************** finish_enum (tree enumtype)
*** 9797,9801 ****
    TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type);
    TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type);
!   TREE_UNSIGNED (enumtype) = TREE_UNSIGNED (underlying_type);
  
    /* Convert each of the enumerators to the type of the underlying
--- 9797,9801 ----
    TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type);
    TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type);
!   TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (underlying_type);
  
    /* Convert each of the enumerators to the type of the underlying
*************** finish_enum (tree enumtype)
*** 9823,9827 ****
        TYPE_ALIGN (t) = TYPE_ALIGN (enumtype);
        TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (enumtype);
!       TREE_UNSIGNED (t) = TREE_UNSIGNED (enumtype);
      }
  
--- 9823,9827 ----
        TYPE_ALIGN (t) = TYPE_ALIGN (enumtype);
        TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (enumtype);
!       TYPE_UNSIGNED (t) = TYPE_UNSIGNED (enumtype);
      }
  
*** cp/mangle.c	24 Mar 2004 00:13:29 -0000	1.100
--- cp/mangle.c	31 Mar 2004 20:46:17 -0000
*************** write_builtin_type (tree type)
*** 1694,1702 ****
  	    {
  	      tree t = c_common_type_for_mode (TYPE_MODE (type),
! 					       TREE_UNSIGNED (type));
  	      if (type == t)
  		{
  		  if (TYPE_PRECISION (type) == 128)
! 		    write_char (TREE_UNSIGNED (type) ? 'o' : 'n');
  		  else
  		    /* Couldn't find this type.  */
--- 1694,1702 ----
  	    {
  	      tree t = c_common_type_for_mode (TYPE_MODE (type),
! 					       TYPE_UNSIGNED (type));
  	      if (type == t)
  		{
  		  if (TYPE_PRECISION (type) == 128)
! 		    write_char (TYPE_UNSIGNED (type) ? 'o' : 'n');
  		  else
  		    /* Couldn't find this type.  */
*** cp/semantics.c	31 Mar 2004 08:41:26 -0000	1.394
--- cp/semantics.c	31 Mar 2004 20:46:19 -0000
*************** finish_switch_cond (tree cond, tree swit
*** 767,772 ****
  	     when checking case values for being in range,
  	     and it's too hard to do the right thing.  */
! 	  if (TREE_UNSIGNED (TREE_TYPE (cond))
! 	      == TREE_UNSIGNED (TREE_TYPE (index)))
  	    cond = index;
  	}
--- 767,772 ----
  	     when checking case values for being in range,
  	     and it's too hard to do the right thing.  */
! 	  if (TYPE_UNSIGNED (TREE_TYPE (cond))
! 	      == TYPE_UNSIGNED (TREE_TYPE (index)))
  	    cond = index;
  	}
*************** finish_unary_op_expr (enum tree_code cod
*** 1839,1843 ****
    if (code == NEGATE_EXPR && TREE_CODE (expr) == INTEGER_CST
        && TREE_CODE (result) == INTEGER_CST
!       && !TREE_UNSIGNED (TREE_TYPE (result))
        && INT_CST_LT (result, integer_zero_node))
      TREE_NEGATED_INT (result) = 1;
--- 1839,1843 ----
    if (code == NEGATE_EXPR && TREE_CODE (expr) == INTEGER_CST
        && TREE_CODE (result) == INTEGER_CST
!       && !TYPE_UNSIGNED (TREE_TYPE (result))
        && INT_CST_LT (result, integer_zero_node))
      TREE_NEGATED_INT (result) = 1;
*** cp/typeck.c	23 Mar 2004 20:43:43 -0000	1.537
--- cp/typeck.c	31 Mar 2004 20:46:26 -0000
*************** type_after_usual_arithmetic_conversions 
*** 348,352 ****
  	  || same_type_p (TYPE_MAIN_VARIANT (t2), long_long_integer_type_node))
  	{
! 	  tree t = ((TREE_UNSIGNED (t1) || TREE_UNSIGNED (t2))
  		    ? long_long_unsigned_type_node 
  		    : long_long_integer_type_node);
--- 348,352 ----
  	  || same_type_p (TYPE_MAIN_VARIANT (t2), long_long_integer_type_node))
  	{
! 	  tree t = ((TYPE_UNSIGNED (t1) || TYPE_UNSIGNED (t2))
  		    ? long_long_unsigned_type_node 
  		    : long_long_integer_type_node);
*************** type_after_usual_arithmetic_conversions 
*** 362,371 ****
  	  || same_type_p (TYPE_MAIN_VARIANT (t2), long_integer_type_node))
  	{
! 	  tree t = ((TREE_UNSIGNED (t1) || TREE_UNSIGNED (t2))
  		    ? long_unsigned_type_node : long_integer_type_node);
  	  return build_type_attribute_variant (t, attributes);
  	}
        /* Otherwise prefer the unsigned one.  */
!       if (TREE_UNSIGNED (t1))
  	return build_type_attribute_variant (t1, attributes);
        else
--- 362,371 ----
  	  || same_type_p (TYPE_MAIN_VARIANT (t2), long_integer_type_node))
  	{
! 	  tree t = ((TYPE_UNSIGNED (t1) || TYPE_UNSIGNED (t2))
  		    ? long_unsigned_type_node : long_integer_type_node);
  	  return build_type_attribute_variant (t, attributes);
  	}
        /* Otherwise prefer the unsigned one.  */
!       if (TYPE_UNSIGNED (t1))
  	return build_type_attribute_variant (t1, attributes);
        else
*************** build_binary_op (enum tree_code code, tr
*** 2873,2877 ****
  	       it was unsigned.  */
  	    shorten = ((TREE_CODE (op0) == NOP_EXPR
! 			&& TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op0, 0))))
  		       || (TREE_CODE (op1) == INTEGER_CST
  			   && ! integer_all_onesp (op1)));
--- 2873,2877 ----
  	       it was unsigned.  */
  	    shorten = ((TREE_CODE (op0) == NOP_EXPR
! 			&& TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op0, 0))))
  		       || (TREE_CODE (op1) == INTEGER_CST
  			   && ! integer_all_onesp (op1)));
*************** build_binary_op (enum tree_code code, tr
*** 2902,2906 ****
  	     only if unsigned or if dividing by something we know != -1.  */
  	  shorten = ((TREE_CODE (op0) == NOP_EXPR
! 		      && TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op0, 0))))
  		     || (TREE_CODE (op1) == INTEGER_CST
  			 && ! integer_all_onesp (op1)));
--- 2902,2906 ----
  	     only if unsigned or if dividing by something we know != -1.  */
  	  shorten = ((TREE_CODE (op0) == NOP_EXPR
! 		      && TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op0, 0))))
  		     || (TREE_CODE (op1) == INTEGER_CST
  			 && ! integer_all_onesp (op1)));
*************** build_binary_op (enum tree_code code, tr
*** 3161,3165 ****
  	  tree arg1 = get_narrower (op1, &unsigned1);
  	  /* UNS is 1 if the operation to be done is an unsigned one.  */
! 	  int uns = TREE_UNSIGNED (result_type);
  	  tree type;
  
--- 3161,3165 ----
  	  tree arg1 = get_narrower (op1, &unsigned1);
  	  /* UNS is 1 if the operation to be done is an unsigned one.  */
! 	  int uns = TYPE_UNSIGNED (result_type);
  	  tree type;
  
*************** build_binary_op (enum tree_code code, tr
*** 3170,3176 ****
  
  	  if (op0 == arg0 && TREE_TYPE (op0) != final_type)
! 	    unsigned0 = TREE_UNSIGNED (TREE_TYPE (op0));
  	  if (op1 == arg1 && TREE_TYPE (op1) != final_type)
! 	    unsigned1 = TREE_UNSIGNED (TREE_TYPE (op1));
  
  	  /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE.  */
--- 3170,3176 ----
  
  	  if (op0 == arg0 && TREE_TYPE (op0) != final_type)
! 	    unsigned0 = TYPE_UNSIGNED (TREE_TYPE (op0));
  	  if (op1 == arg1 && TREE_TYPE (op1) != final_type)
! 	    unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1));
  
  	  /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE.  */
*************** build_binary_op (enum tree_code code, tr
*** 3224,3228 ****
  
  	  if (arg0 == op0 && final_type == TREE_TYPE (op0))
! 	    unsigned_arg = TREE_UNSIGNED (TREE_TYPE (op0));
  
  	  if (TYPE_PRECISION (TREE_TYPE (arg0)) < TYPE_PRECISION (result_type)
--- 3224,3228 ----
  
  	  if (arg0 == op0 && final_type == TREE_TYPE (op0))
! 	    unsigned_arg = TYPE_UNSIGNED (TREE_TYPE (op0));
  
  	  if (TYPE_PRECISION (TREE_TYPE (arg0)) < TYPE_PRECISION (result_type)
*************** build_binary_op (enum tree_code code, tr
*** 3237,3241 ****
  		 We can't optimize that case at all, but in most machines
  		 it never happens because available widths are 2**N.  */
! 	      && (!TREE_UNSIGNED (final_type)
  		  || unsigned_arg
  		  || (((unsigned) 2 * TYPE_PRECISION (TREE_TYPE (arg0)))
--- 3237,3241 ----
  		 We can't optimize that case at all, but in most machines
  		 it never happens because available widths are 2**N.  */
! 	      && (!TYPE_UNSIGNED (final_type)
  		  || unsigned_arg
  		  || (((unsigned) 2 * TYPE_PRECISION (TREE_TYPE (arg0)))
*************** build_binary_op (enum tree_code code, tr
*** 3279,3284 ****
  	  && !processing_template_decl)
  	{
! 	  int op0_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op0));
! 	  int op1_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op1));
  
  	  int unsignedp0, unsignedp1;
--- 3279,3284 ----
  	  && !processing_template_decl)
  	{
! 	  int op0_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op0));
! 	  int op1_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op1));
  
  	  int unsignedp0, unsignedp1;
*************** build_binary_op (enum tree_code code, tr
*** 3304,3308 ****
  	     since the signed type will only be chosen if it can represent
  	     all the values of the unsigned type.  */
! 	  if (! TREE_UNSIGNED (result_type))
  	    /* OK */;
  	  /* Do not warn if both operands are unsigned.  */
--- 3304,3308 ----
  	     since the signed type will only be chosen if it can represent
  	     all the values of the unsigned type.  */
! 	  if (!TYPE_UNSIGNED (result_type))
  	    /* OK */;
  	  /* Do not warn if both operands are unsigned.  */
*************** dubious_conversion_warnings (tree type, 
*** 5558,5565 ****
    /* And warn about assigning a negative value to an unsigned
       variable.  */
!   else if (TREE_UNSIGNED (type) && TREE_CODE (type) != BOOLEAN_TYPE)
      {
!       if (TREE_CODE (expr) == INTEGER_CST
! 	  && TREE_NEGATED_INT (expr))
  	{
  	  if (fndecl)
--- 5558,5564 ----
    /* And warn about assigning a negative value to an unsigned
       variable.  */
!   else if (TYPE_UNSIGNED (type) && TREE_CODE (type) != BOOLEAN_TYPE)
      {
!       if (TREE_CODE (expr) == INTEGER_CST && TREE_NEGATED_INT (expr))
  	{
  	  if (fndecl)

*** f/com.c	30 Mar 2004 19:19:04 -0000	1.224
--- f/com.c	31 Mar 2004 20:46:57 -0000
*************** ffecom_arrayref_ (tree item, ffebld expr
*** 913,917 ****
  	      && GET_MODE_CLASS (TYPE_MODE (tree_type)) == MODE_INT
  	      && TYPE_PRECISION (tree_type) < TYPE_PRECISION (sizetype))
! 	    tree_type_x = (TREE_UNSIGNED (tree_type) ? usizetype : ssizetype);
  
  	  if (TREE_TYPE (min) != tree_type_x)
--- 913,917 ----
  	      && GET_MODE_CLASS (TYPE_MODE (tree_type)) == MODE_INT
  	      && TYPE_PRECISION (tree_type) < TYPE_PRECISION (sizetype))
! 	    tree_type_x = (TYPE_UNSIGNED (tree_type) ? usizetype : ssizetype);
  
  	  if (TREE_TYPE (min) != tree_type_x)
*************** ffecom_arrayref_ (tree item, ffebld expr
*** 959,963 ****
  	      && GET_MODE_CLASS (TYPE_MODE (tree_type)) == MODE_INT
  	      && TYPE_PRECISION (tree_type) < TYPE_PRECISION (sizetype))
! 	    tree_type_x = (TREE_UNSIGNED (tree_type) ? usizetype : ssizetype);
  
  	  element = convert (tree_type_x, element);
--- 959,963 ----
  	      && GET_MODE_CLASS (TYPE_MODE (tree_type)) == MODE_INT
  	      && TYPE_PRECISION (tree_type) < TYPE_PRECISION (sizetype))
! 	    tree_type_x = (TYPE_UNSIGNED (tree_type) ? usizetype : ssizetype);
  
  	  element = convert (tree_type_x, element);
*************** ffecom_expr_ (ffebld expr, tree dest_tre
*** 2956,2960 ****
        && GET_MODE_CLASS (TYPE_MODE (tree_type)) == MODE_INT
        && TYPE_PRECISION (tree_type) < TYPE_PRECISION (sizetype))
!     tree_type_x = (TREE_UNSIGNED (tree_type) ? usizetype : ssizetype);
  
    switch (ffebld_op (expr))
--- 2956,2960 ----
        && GET_MODE_CLASS (TYPE_MODE (tree_type)) == MODE_INT
        && TYPE_PRECISION (tree_type) < TYPE_PRECISION (sizetype))
!     tree_type_x = (TYPE_UNSIGNED (tree_type) ? usizetype : ssizetype);
  
    switch (ffebld_op (expr))
*** java/jcf-write.c	23 Mar 2004 17:54:02 -0000	1.142
--- java/jcf-write.c	31 Mar 2004 20:47:07 -0000
*************** generate_bytecode_insns (tree exp, int t
*** 2242,2246 ****
  		    if (TYPE_PRECISION (dst_type) <= 8)
  		      OP1 (OPCODE_i2b);
! 		    else if (TREE_UNSIGNED (dst_type))
  		      OP1 (OPCODE_i2c);
  		    else
--- 2242,2246 ----
  		    if (TYPE_PRECISION (dst_type) <= 8)
  		      OP1 (OPCODE_i2b);
! 		    else if (TYPE_UNSIGNED (dst_type))
  		      OP1 (OPCODE_i2c);
  		    else
*** objc/objc-act.c	25 Mar 2004 17:04:45 -0000	1.210
--- objc/objc-act.c	31 Mar 2004 20:47:16 -0000
*************** encode_type (tree type, int curtype, int
*** 7343,7356 ****
        switch (GET_MODE_BITSIZE (TYPE_MODE (type)))
  	{
! 	case 8:  c = TREE_UNSIGNED (type) ? 'C' : 'c'; break;
! 	case 16: c = TREE_UNSIGNED (type) ? 'S' : 's'; break;
  	case 32: 
  	  if (type == long_unsigned_type_node
  	      || type == long_integer_type_node)
! 	         c = TREE_UNSIGNED (type) ? 'L' : 'l';
  	  else
! 	         c = TREE_UNSIGNED (type) ? 'I' : 'i';
  	  break;
! 	case 64: c = TREE_UNSIGNED (type) ? 'Q' : 'q'; break;
  	default: abort ();
  	}
--- 7343,7356 ----
        switch (GET_MODE_BITSIZE (TYPE_MODE (type)))
  	{
! 	case 8:  c = TYPE_UNSIGNED (type) ? 'C' : 'c'; break;
! 	case 16: c = TYPE_UNSIGNED (type) ? 'S' : 's'; break;
  	case 32: 
  	  if (type == long_unsigned_type_node
  	      || type == long_integer_type_node)
! 	         c = TYPE_UNSIGNED (type) ? 'L' : 'l';
  	  else
! 	         c = TYPE_UNSIGNED (type) ? 'I' : 'i';
  	  break;
! 	case 64: c = TYPE_UNSIGNED (type) ? 'Q' : 'q'; break;
  	default: abort ();
  	}
*** treelang/treetree.c	22 Sep 2003 05:09:32 -0000	1.36
--- treelang/treetree.c	31 Mar 2004 20:50:25 -0000
*************** static tree
*** 1028,1032 ****
  tree_lang_signed_or_unsigned_type (int unsignedp, tree type)
  {
!   if (! INTEGRAL_TYPE_P (type) || TREE_UNSIGNED (type) == unsignedp)
      return type;
    else
--- 1028,1032 ----
  tree_lang_signed_or_unsigned_type (int unsignedp, tree type)
  {
!   if (! INTEGRAL_TYPE_P (type) || TYPE_UNSIGNED (type) == unsignedp)
      return type;
    else
*** ada/decl.c	23 Mar 2004 20:59:31 -0000	1.63.2.46
--- ada/decl.c	31 Mar 2004 20:56:33 -0000
*************** gnat_to_gnu_entity (Entity_Id gnat_entit
*** 1222,1226 ****
  		? gnu_high : TYPE_MAX_VALUE (gnu_type);
  	    TYPE_PRECISION (gnu_subtype) = esize;
! 	    TREE_UNSIGNED (gnu_subtype) = 1;
  	    TYPE_EXTRA_SUBTYPE_P (gnu_subtype) = 1;
  	    TYPE_PACKED_ARRAY_TYPE_P (gnu_subtype)
--- 1222,1226 ----
  		? gnu_high : TYPE_MAX_VALUE (gnu_type);
  	    TYPE_PRECISION (gnu_subtype) = esize;
! 	    TYPE_UNSIGNED (gnu_subtype) = 1;
  	    TYPE_EXTRA_SUBTYPE_P (gnu_subtype) = 1;
  	    TYPE_PACKED_ARRAY_TYPE_P (gnu_subtype)
*************** gnat_to_gnu_entity (Entity_Id gnat_entit
*** 1300,1305 ****
  	 and non-negative or if the base type is unsigned; a signed type
  	 otherwise.    */
!       TREE_UNSIGNED (gnu_type)
! 	= (TREE_UNSIGNED (TREE_TYPE (gnu_type))
  	   || (TREE_CODE (TYPE_MIN_VALUE (gnu_type)) == INTEGER_CST
  	       && TREE_INT_CST_HIGH (TYPE_MIN_VALUE (gnu_type)) >= 0)
--- 1300,1305 ----
  	 and non-negative or if the base type is unsigned; a signed type
  	 otherwise.    */
!       TYPE_UNSIGNED (gnu_type)
! 	= (TYPE_UNSIGNED (TREE_TYPE (gnu_type))
  	   || (TREE_CODE (TYPE_MIN_VALUE (gnu_type)) == INTEGER_CST
  	       && TREE_INT_CST_HIGH (TYPE_MIN_VALUE (gnu_type)) >= 0)
*************** gnat_to_gnu_entity (Entity_Id gnat_entit
*** 1807,1811 ****
  		       && TREE_OVERFLOW (gnu_high))
  		gnu_high = gnu_max;
! 	      else if (TREE_UNSIGNED (gnu_base_subtype)
  		       || TREE_CODE (gnu_high) == INTEGER_CST)
  		gnu_high = size_binop (MAX_EXPR, gnu_max, gnu_high);
--- 1807,1811 ----
  		       && TREE_OVERFLOW (gnu_high))
  		gnu_high = gnu_max;
! 	      else if (TYPE_UNSIGNED (gnu_base_subtype)
  		       || TREE_CODE (gnu_high) == INTEGER_CST)
  		gnu_high = size_binop (MAX_EXPR, gnu_max, gnu_high);
*************** gnat_to_gnu_entity (Entity_Id gnat_entit
*** 2082,2087 ****
  		      TYPE_PRECISION (gnu_subtype)
  			= TYPE_PRECISION (gnu_inner_type);
! 		      TREE_UNSIGNED (gnu_subtype)
! 			= TREE_UNSIGNED (gnu_inner_type);
  		      TYPE_EXTRA_SUBTYPE_P (gnu_subtype) = 1;
  		      layout_type (gnu_subtype);
--- 2082,2087 ----
  		      TYPE_PRECISION (gnu_subtype)
  			= TYPE_PRECISION (gnu_inner_type);
! 		      TYPE_UNSIGNED (gnu_subtype)
! 			= TYPE_UNSIGNED (gnu_inner_type);
  		      TYPE_EXTRA_SUBTYPE_P (gnu_subtype) = 1;
  		      layout_type (gnu_subtype);
*************** make_type_from_size (tree type, tree siz
*** 6011,6016 ****
  	    && TYPE_BIASED_REPRESENTATION_P (type))
  	   || biased_p);
!       TREE_UNSIGNED (new_type)
! 	= TREE_UNSIGNED (type) | TYPE_BIASED_REPRESENTATION_P (new_type);
        TYPE_RM_SIZE_INT (new_type) = bitsize_int (size);
        return new_type;
--- 6011,6016 ----
  	    && TYPE_BIASED_REPRESENTATION_P (type))
  	   || biased_p);
!       TYPE_UNSIGNED (new_type)
! 	= TYPE_UNSIGNED (type) | TYPE_BIASED_REPRESENTATION_P (new_type);
        TYPE_RM_SIZE_INT (new_type) = bitsize_int (size);
        return new_type;
*** ada/trans.c	21 Mar 2004 18:23:39 -0000	1.68.2.40
--- ada/trans.c	31 Mar 2004 20:56:57 -0000
*************** tree_transform (Node_Id gnat_node)
*** 1887,1894 ****
  	   so we may need to choose a different type.  */
  	if (Nkind (gnat_node) == N_Op_Shift_Right
! 	    && ! TREE_UNSIGNED (gnu_type))
  	  gnu_type = gnat_unsigned_type (gnu_type);
  	else if (Nkind (gnat_node) == N_Op_Shift_Right_Arithmetic
! 		 && TREE_UNSIGNED (gnu_type))
  	  gnu_type = gnat_signed_type (gnu_type);
  
--- 1887,1894 ----
  	   so we may need to choose a different type.  */
  	if (Nkind (gnat_node) == N_Op_Shift_Right
! 	    && ! TYPE_UNSIGNED (gnu_type))
  	  gnu_type = gnat_unsigned_type (gnu_type);
  	else if (Nkind (gnat_node) == N_Op_Shift_Right_Arithmetic
! 		 && TYPE_UNSIGNED (gnu_type))
  	  gnu_type = gnat_signed_type (gnu_type);
  
*************** convert_with_check (Entity_Id gnat_type,
*** 4730,4744 ****
  	 comparing them properly.  Likewise, convert the upper bounds
  	 to unsigned types.  */
!       if (INTEGRAL_TYPE_P (gnu_in_basetype) && TREE_UNSIGNED (gnu_in_basetype))
  	gnu_in_lb = convert (gnat_signed_type (gnu_in_basetype), gnu_in_lb);
  
        if (INTEGRAL_TYPE_P (gnu_in_basetype)
! 	  && ! TREE_UNSIGNED (gnu_in_basetype))
  	gnu_in_ub = convert (gnat_unsigned_type (gnu_in_basetype), gnu_in_ub);
  
!       if (INTEGRAL_TYPE_P (gnu_base_type) && TREE_UNSIGNED (gnu_base_type))
  	gnu_out_lb = convert (gnat_signed_type (gnu_base_type), gnu_out_lb);
  
!       if (INTEGRAL_TYPE_P (gnu_base_type) && ! TREE_UNSIGNED (gnu_base_type))
  	gnu_out_ub = convert (gnat_unsigned_type (gnu_base_type), gnu_out_ub);
  
--- 4730,4744 ----
  	 comparing them properly.  Likewise, convert the upper bounds
  	 to unsigned types.  */
!       if (INTEGRAL_TYPE_P (gnu_in_basetype) && TYPE_UNSIGNED (gnu_in_basetype))
  	gnu_in_lb = convert (gnat_signed_type (gnu_in_basetype), gnu_in_lb);
  
        if (INTEGRAL_TYPE_P (gnu_in_basetype)
! 	  && !TYPE_UNSIGNED (gnu_in_basetype))
  	gnu_in_ub = convert (gnat_unsigned_type (gnu_in_basetype), gnu_in_ub);
  
!       if (INTEGRAL_TYPE_P (gnu_base_type) && TYPE_UNSIGNED (gnu_base_type))
  	gnu_out_lb = convert (gnat_signed_type (gnu_base_type), gnu_out_lb);
  
!       if (INTEGRAL_TYPE_P (gnu_base_type) && !TYPE_UNSIGNED (gnu_base_type))
  	gnu_out_ub = convert (gnat_unsigned_type (gnu_base_type), gnu_out_ub);
  
*** ada/utils.c	23 Mar 2004 21:00:21 -0000	1.48.2.34
--- ada/utils.c	31 Mar 2004 20:57:00 -0000
*************** tree
*** 2119,2123 ****
  gnat_signed_or_unsigned_type (int unsignedp, tree type)
  {
!   if (! INTEGRAL_TYPE_P (type) || TREE_UNSIGNED (type) == unsignedp)
      return type;
    else
--- 2119,2123 ----
  gnat_signed_or_unsigned_type (int unsignedp, tree type)
  {
!   if (! INTEGRAL_TYPE_P (type) || TYPE_UNSIGNED (type) == unsignedp)
      return type;
    else
*************** build_vms_descriptor (tree type, Mechani
*** 2356,2372 ****
  	  {
  	  case 8:
! 	    dtype = TREE_UNSIGNED (type) ? 2 : 6;
  	    break;
  	  case 16:
! 	    dtype = TREE_UNSIGNED (type) ? 3 : 7;
  	    break;
  	  case 32:
! 	    dtype = TREE_UNSIGNED (type) ? 4 : 8;
  	    break;
  	  case 64:
! 	    dtype = TREE_UNSIGNED (type) ? 5 : 9;
  	    break;
  	  case 128:
! 	    dtype = TREE_UNSIGNED (type) ? 25 : 26;
  	    break;
  	  }
--- 2356,2372 ----
  	  {
  	  case 8:
! 	    dtype = TYPE_UNSIGNED (type) ? 2 : 6;
  	    break;
  	  case 16:
! 	    dtype = TYPE_UNSIGNED (type) ? 3 : 7;
  	    break;
  	  case 32:
! 	    dtype = TYPE_UNSIGNED (type) ? 4 : 8;
  	    break;
  	  case 64:
! 	    dtype = TYPE_UNSIGNED (type) ? 5 : 9;
  	    break;
  	  case 128:
! 	    dtype = TYPE_UNSIGNED (type) ? 25 : 26;
  	    break;
  	  }
*************** unchecked_convert (tree type, tree expr,
*** 3389,3401 ****
  				GET_MODE_BITSIZE (TYPE_MODE (type)))
        && ! (INTEGRAL_TYPE_P (etype)
! 	    && TREE_UNSIGNED (type) == TREE_UNSIGNED (etype)
  	    && operand_equal_p (TYPE_RM_SIZE (type),
  				(TYPE_RM_SIZE (etype) != 0
  				 ? TYPE_RM_SIZE (etype) : TYPE_SIZE (etype)),
  				0))
!       && ! (TREE_UNSIGNED (type) && TREE_UNSIGNED (etype)))
      {
        tree base_type = gnat_type_for_mode (TYPE_MODE (type),
! 					   TREE_UNSIGNED (type));
        tree shift_expr
  	= convert (base_type,
--- 3389,3401 ----
  				GET_MODE_BITSIZE (TYPE_MODE (type)))
        && ! (INTEGRAL_TYPE_P (etype)
! 	    && TYPE_UNSIGNED (type) == TYPE_UNSIGNED (etype)
  	    && operand_equal_p (TYPE_RM_SIZE (type),
  				(TYPE_RM_SIZE (etype) != 0
  				 ? TYPE_RM_SIZE (etype) : TYPE_SIZE (etype)),
  				0))
!       && ! (TYPE_UNSIGNED (type) && TYPE_UNSIGNED (etype)))
      {
        tree base_type = gnat_type_for_mode (TYPE_MODE (type),
! 					   TYPE_UNSIGNED (type));
        tree shift_expr
  	= convert (base_type,
*** ada/utils2.c	21 Mar 2004 18:26:42 -0000	1.21.4.14
--- ada/utils2.c	31 Mar 2004 20:57:04 -0000
*************** nonbinary_modular_operation (enum tree_c
*** 513,517 ****
       type and convert both our operands to it.  */
    if (TYPE_PRECISION (op_type) < precision
!       || TREE_UNSIGNED (op_type) != unsignedp)
      {
        /* Copy the node so we ensure it can be modified to make it modular.  */
--- 513,517 ----
       type and convert both our operands to it.  */
    if (TYPE_PRECISION (op_type) < precision
!       || TYPE_UNSIGNED (op_type) != unsignedp)
      {
        /* Copy the node so we ensure it can be modified to make it modular.  */



More information about the Gcc-patches mailing list