* tree.def (SET_TYPE): Remove.
(CONSTRUCTOR): Update description.
* builtins.c (type_to_class) Remove SET_TYPE case.
* dbxout.c (dbxout_type): Likewise.
* dwarf2out.c (is_base_type): Likewise.
(gen_set_type_die): Remove.
(gen_type_die): Remove SET_TYPE case.
* expr.c (count_type_elements): Likewise.
(mostly_zeroes_p): Likewise.
(store_constructor): Likewise.
* print_tree.c (print_node): Likewise.
* stor-layout.c (layout_type): Likewise.
* tree-browser.c (browse_tree): Likewise.
* tree-inline.c (remap_type): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
* tree.c (type_contains_plaeholder_1, type_hash_eq,
variably_modified_type_p, initializer_zerop): Likewise.
* tree.h (SET_OR_ARRAY_CHECK): Remove.
(AGGREGATE_TYPE_P): Remove SET_TYPE check.
(TYPE_DOMAIN): Use ARRAY_TYPE_CHECK.
* typeclass.h (enum type_class): Remove set_type_class.
* varasm.c (const_hash_1): Remove SET_TYPE case.
(compare_constant, copy_constant, output_constant): Likewise.
* config/i386/i386.c (classify_argument): Likewise.
* config/ia64/ia64.c (hfa_element_mode): Likewise.
* config/sparc/sparc.c (sparc_type_code): Likewise.
* ada/decl.c (gnat_substitute_in_type): Remove SET_TYPE case.
From-SVN: r91931
2004-12-09 Nathan Sidwell <nathan@codesourcery.com>
+ * tree.def (SET_TYPE): Remove.
+ (CONSTRUCTOR): Update description.
+ * builtins.c (type_to_class) Remove SET_TYPE case.
+ * dbxout.c (dbxout_type): Likewise.
+ * dwarf2out.c (is_base_type): Likewise.
+ (gen_set_type_die): Remove.
+ (gen_type_die): Remove SET_TYPE case.
+ * expr.c (count_type_elements): Likewise.
+ (mostly_zeroes_p): Likewise.
+ (store_constructor): Likewise.
+ * print_tree.c (print_node): Likewise.
+ * stor-layout.c (layout_type): Likewise.
+ * tree-browser.c (browse_tree): Likewise.
+ * tree-inline.c (remap_type): Likewise.
+ * tree-pretty-print.c (dump_generic_node): Likewise.
+ * tree.c (type_contains_plaeholder_1, type_hash_eq,
+ variably_modified_type_p, initializer_zerop): Likewise.
+ * tree.h (SET_OR_ARRAY_CHECK): Remove.
+ (AGGREGATE_TYPE_P): Remove SET_TYPE check.
+ (TYPE_DOMAIN): Use ARRAY_TYPE_CHECK.
+ * typeclass.h (enum type_class): Remove set_type_class.
+ * varasm.c (const_hash_1): Remove SET_TYPE case.
+ (compare_constant, copy_constant, output_constant): Likewise.
+ * config/i386/i386.c (classify_argument): Likewise.
+ * config/ia64/ia64.c (hfa_element_mode): Likewise.
+ * config/sparc/sparc.c (sparc_type_code): Likewise.
+
PR c++/16681
* tree-inline.c (estimate_num_insns_1): Add RANGE_EXPR case.
+2004-12-09 Nathan Sidwell <nathan@codesourcery.com>
+
+ * decl.c (gnat_substitute_in_type): Remove SET_TYPE case.
+
2004-12-07 Ed Falis <falis@adacore.com>
* s-intman-vxworks.adb (Notify_Exception): removed useless check for
case OFFSET_TYPE:
case METHOD_TYPE:
case FILE_TYPE:
- case SET_TYPE:
case FUNCTION_TYPE:
case LANG_TYPE:
/* Don't know how to do these yet. */
case QUAL_UNION_TYPE: return union_type_class;
case ARRAY_TYPE: return (TYPE_STRING_FLAG (type)
? string_type_class : array_type_class);
- case SET_TYPE: return set_type_class;
case FILE_TYPE: return file_type_class;
case LANG_TYPE: return lang_type_class;
default: return no_type_class;
}
}
}
- else if (TREE_CODE (type) == SET_TYPE)
- {
- if (bytes <= 4)
- {
- classes[0] = X86_64_INTEGERSI_CLASS;
- return 1;
- }
- else if (bytes <= 8)
- {
- classes[0] = X86_64_INTEGER_CLASS;
- return 1;
- }
- else if (bytes <= 12)
- {
- classes[0] = X86_64_INTEGER_CLASS;
- classes[1] = X86_64_INTEGERSI_CLASS;
- return 2;
- }
- else
- {
- classes[0] = X86_64_INTEGER_CLASS;
- classes[1] = X86_64_INTEGER_CLASS;
- return 2;
- }
- }
else
abort ();
case VOID_TYPE: case INTEGER_TYPE: case ENUMERAL_TYPE:
case BOOLEAN_TYPE: case CHAR_TYPE: case POINTER_TYPE:
case OFFSET_TYPE: case REFERENCE_TYPE: case METHOD_TYPE:
- case FILE_TYPE: case SET_TYPE: case LANG_TYPE:
- case FUNCTION_TYPE:
+ case FILE_TYPE: case LANG_TYPE: case FUNCTION_TYPE:
return VOIDmode;
/* Fortran complex types are supposed to be HFAs, so we need to handle
case CHAR_TYPE: /* GNU Pascal CHAR type. Not used in C. */
case BOOLEAN_TYPE: /* GNU Fortran BOOLEAN type. */
case FILE_TYPE: /* GNU Pascal FILE type. */
- case SET_TYPE: /* GNU Pascal SET type. */
case LANG_TYPE: /* ? */
return qualifiers;
}
break;
- case SET_TYPE:
- if (use_gnu_debug_info_extensions)
- {
- have_used_extensions = 1;
- stabstr_S ("@s");
- stabstr_D (BITS_PER_UNIT * int_size_in_bytes (type));
- stabstr_C (';');
-
- /* Check if a bitstring type, which in Chill is
- different from a [power]set. */
- if (TYPE_STRING_FLAG (type))
- stabstr_S ("@S;");
- }
- stabstr_C ('S');
- dbxout_type (TYPE_DOMAIN (type), 0);
- break;
-
case ARRAY_TYPE:
/* Make arrays of packed bits look like bitstrings for chill. */
if (TYPE_PACKED (type) && use_gnu_debug_info_extensions)
static const char *decl_start_label (tree);
#endif
static void gen_array_type_die (tree, dw_die_ref);
-static void gen_set_type_die (tree, dw_die_ref);
#if 0
static void gen_entry_point_die (tree, dw_die_ref);
#endif
case CHAR_TYPE:
return 1;
- case SET_TYPE:
case ARRAY_TYPE:
case RECORD_TYPE:
case UNION_TYPE:
add_type_attribute (array_die, element_type, 0, 0, context_die);
}
-static void
-gen_set_type_die (tree type, dw_die_ref context_die)
-{
- dw_die_ref type_die
- = new_die (DW_TAG_set_type, scope_die_for (type, context_die), type);
-
- equate_type_number_to_die (type, type_die);
- add_type_attribute (type_die, TREE_TYPE (type), 0, 0, context_die);
-}
-
#if 0
static void
gen_entry_point_die (tree decl, dw_die_ref context_die)
gen_ptr_to_mbr_type_die (type, context_die);
break;
- case SET_TYPE:
- gen_type_die (TYPE_DOMAIN (type), context_die);
- gen_set_type_die (type, context_die);
- break;
-
case FILE_TYPE:
gen_type_die (TREE_TYPE (type), context_die);
/* No way to represent these in Dwarf yet! */
case VOID_TYPE:
case METHOD_TYPE:
case FILE_TYPE:
- case SET_TYPE:
case FUNCTION_TYPE:
case LANG_TYPE:
default:
{
HOST_WIDE_INT nz_elts, nc_elts, elts;
- /* If there are no ranges of true bits, it is all zero. */
- if (TREE_TYPE (exp) && TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
- return CONSTRUCTOR_ELTS (exp) == NULL_TREE;
-
categorize_ctor_elements (exp, &nz_elts, &nc_elts);
elts = count_type_elements (TREE_TYPE (exp));
gen_rtvec_v (n_elts, vector))));
break;
}
-
- /* Set constructor assignments. */
- case SET_TYPE:
- {
- tree elt = CONSTRUCTOR_ELTS (exp);
- unsigned HOST_WIDE_INT nbytes = int_size_in_bytes (type), nbits;
- tree domain = TYPE_DOMAIN (type);
- tree domain_min, domain_max, bitlength;
-
- /* The default implementation strategy is to extract the
- constant parts of the constructor, use that to initialize
- the target, and then "or" in whatever non-constant ranges
- we need in addition.
-
- If a large set is all zero or all ones, it is probably
- better to set it using memset. Also, if a large set has
- just a single range, it may also be better to first clear
- all the first clear the set (using memset), and set the
- bits we want. */
-
- /* Check for all zeros. */
- if (elt == NULL_TREE && size > 0)
- {
- if (!cleared)
- clear_storage (target, GEN_INT (size));
- return;
- }
-
- domain_min = convert (sizetype, TYPE_MIN_VALUE (domain));
- domain_max = convert (sizetype, TYPE_MAX_VALUE (domain));
- bitlength = size_binop (PLUS_EXPR,
- size_diffop (domain_max, domain_min),
- ssize_int (1));
-
- nbits = tree_low_cst (bitlength, 1);
-
- /* For "small" sets, or "medium-sized" (up to 32 bytes) sets
- that are "complicated" (more than one range), initialize
- (the constant parts) by copying from a constant. */
- if (GET_MODE (target) != BLKmode || nbits <= 2 * BITS_PER_WORD
- || (nbytes <= 32 && TREE_CHAIN (elt) != NULL_TREE))
- {
- unsigned int set_word_size = TYPE_ALIGN (TREE_TYPE (exp));
- enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1);
- char *bit_buffer = alloca (nbits);
- HOST_WIDE_INT word = 0;
- unsigned int bit_pos = 0;
- unsigned int ibit = 0;
- unsigned int offset = 0; /* In bytes from beginning of set. */
-
- elt = get_set_constructor_bits (exp, bit_buffer, nbits);
- for (;;)
- {
- if (bit_buffer[ibit])
- {
- if (BYTES_BIG_ENDIAN)
- word |= (1 << (set_word_size - 1 - bit_pos));
- else
- word |= 1 << bit_pos;
- }
-
- bit_pos++; ibit++;
- if (bit_pos >= set_word_size || ibit == nbits)
- {
- if (word != 0 || ! cleared)
- {
- rtx datum = gen_int_mode (word, mode);
- rtx to_rtx;
-
- /* The assumption here is that it is safe to
- use XEXP if the set is multi-word, but not
- if it's single-word. */
- if (MEM_P (target))
- to_rtx = adjust_address (target, mode, offset);
- else
- {
- gcc_assert (!offset);
- to_rtx = target;
- }
- emit_move_insn (to_rtx, datum);
- }
-
- if (ibit == nbits)
- break;
- word = 0;
- bit_pos = 0;
- offset += set_word_size / BITS_PER_UNIT;
- }
- }
- }
- else if (!cleared)
- /* Don't bother clearing storage if the set is all ones. */
- if (TREE_CHAIN (elt) != NULL_TREE
- || (TREE_PURPOSE (elt) == NULL_TREE
- ? nbits != 1
- : ( ! host_integerp (TREE_VALUE (elt), 0)
- || ! host_integerp (TREE_PURPOSE (elt), 0)
- || (tree_low_cst (TREE_VALUE (elt), 0)
- - tree_low_cst (TREE_PURPOSE (elt), 0) + 1
- != (HOST_WIDE_INT) nbits))))
- clear_storage (target, expr_size (exp));
-
- for (; elt != NULL_TREE; elt = TREE_CHAIN (elt))
- {
- /* Start of range of element or NULL. */
- tree startbit = TREE_PURPOSE (elt);
- /* End of range of element, or element value. */
- tree endbit = TREE_VALUE (elt);
- HOST_WIDE_INT startb, endb;
- rtx bitlength_rtx, startbit_rtx, endbit_rtx, targetx;
-
- bitlength_rtx = expand_expr (bitlength,
- NULL_RTX, MEM, EXPAND_CONST_ADDRESS);
-
- /* Handle non-range tuple element like [ expr ]. */
- if (startbit == NULL_TREE)
- {
- startbit = save_expr (endbit);
- endbit = startbit;
- }
-
- startbit = convert (sizetype, startbit);
- endbit = convert (sizetype, endbit);
- if (! integer_zerop (domain_min))
- {
- startbit = size_binop (MINUS_EXPR, startbit, domain_min);
- endbit = size_binop (MINUS_EXPR, endbit, domain_min);
- }
- startbit_rtx = expand_expr (startbit, NULL_RTX, MEM,
- EXPAND_CONST_ADDRESS);
- endbit_rtx = expand_expr (endbit, NULL_RTX, MEM,
- EXPAND_CONST_ADDRESS);
-
- if (REG_P (target))
- {
- targetx
- = assign_temp
- ((build_qualified_type (lang_hooks.types.type_for_mode
- (GET_MODE (target), 0),
- TYPE_QUAL_CONST)),
- 0, 1, 1);
- emit_move_insn (targetx, target);
- }
-
- else
- {
- gcc_assert (MEM_P (target));
- targetx = target;
- }
-
- /* Optimization: If startbit and endbit are constants divisible
- by BITS_PER_UNIT, call memset instead. */
- if (TREE_CODE (startbit) == INTEGER_CST
- && TREE_CODE (endbit) == INTEGER_CST
- && (startb = TREE_INT_CST_LOW (startbit)) % BITS_PER_UNIT == 0
- && (endb = TREE_INT_CST_LOW (endbit) + 1) % BITS_PER_UNIT == 0)
- {
- emit_library_call (memset_libfunc, LCT_NORMAL,
- VOIDmode, 3,
- plus_constant (XEXP (targetx, 0),
- startb / BITS_PER_UNIT),
- Pmode,
- constm1_rtx, TYPE_MODE (integer_type_node),
- GEN_INT ((endb - startb) / BITS_PER_UNIT),
- TYPE_MODE (sizetype));
- }
- else
- emit_library_call (setbits_libfunc, LCT_NORMAL,
- VOIDmode, 4, XEXP (targetx, 0),
- Pmode, bitlength_rtx, TYPE_MODE (sizetype),
- startbit_rtx, TYPE_MODE (sizetype),
- endbit_rtx, TYPE_MODE (sizetype));
-
- if (REG_P (target))
- emit_move_insn (target, targetx);
- }
- break;
- }
+
default:
gcc_unreachable ();
}
if (TREE_CODE (node) == ENUMERAL_TYPE)
print_node (file, "values", TYPE_VALUES (node), indent + 4);
- else if (TREE_CODE (node) == ARRAY_TYPE || TREE_CODE (node) == SET_TYPE)
+ else if (TREE_CODE (node) == ARRAY_TYPE)
print_node (file, "domain", TYPE_DOMAIN (node), indent + 4);
else if (TREE_CODE (node) == VECTOR_TYPE)
fprintf (file, " nunits %d", (int) TYPE_VECTOR_SUBPARTS (node));
}
break;
- case SET_TYPE: /* Used by Chill and Pascal. */
- {
- unsigned int alignment;
- HOST_WIDE_INT size_in_bits;
- HOST_WIDE_INT rounded_size;
-
- gcc_assert (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
- == INTEGER_CST);
- gcc_assert (TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (type)))
- == INTEGER_CST);
-
-#ifndef SET_WORD_SIZE
-#define SET_WORD_SIZE BITS_PER_WORD
-#endif
- alignment = set_alignment ? set_alignment : SET_WORD_SIZE;
- size_in_bits
- = (tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 0)
- - tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0) + 1);
- rounded_size
- = ((size_in_bits + alignment - 1) / alignment) * alignment;
-
- if (rounded_size > (int) alignment)
- TYPE_MODE (type) = BLKmode;
- else
- TYPE_MODE (type) = mode_for_size (alignment, MODE_INT, 1);
-
- TYPE_SIZE (type) = bitsize_int (rounded_size);
- TYPE_SIZE_UNIT (type) = size_int (rounded_size / BITS_PER_UNIT);
- TYPE_ALIGN (type) = alignment;
- TYPE_USER_ALIGN (type) = 0;
- TYPE_PRECISION (type) = size_in_bits;
- }
- break;
-
case FILE_TYPE:
/* The size may vary in different languages, so the language front end
should fill in the size. */
break;
case TB_DOMAIN:
- if (head && (TREE_CODE (head) == ARRAY_TYPE
- || TREE_CODE (head) == SET_TYPE))
+ if (head && TREE_CODE (head) == ARRAY_TYPE)
TB_SET_HEAD (TYPE_DOMAIN (head));
else
TB_WF;
break;
case FILE_TYPE:
- case SET_TYPE:
case OFFSET_TYPE:
default:
/* Shouldn't have been thought variable sized. */
break;
}
- case SET_TYPE:
- NIY;
- break;
-
case RECORD_TYPE:
case UNION_TYPE:
case QUAL_UNION_TYPE:
|| CONTAINS_PLACEHOLDER_P (TYPE_MAX_VALUE (type)));
case ARRAY_TYPE:
- case SET_TYPE:
case VECTOR_TYPE:
/* We're already checked the component type (TREE_TYPE), so just check
the index type. */
TYPE_ARG_TYPES (b->type)))));
case ARRAY_TYPE:
- case SET_TYPE:
return TYPE_DOMAIN (a->type) == TYPE_DOMAIN (b->type);
case RECORD_TYPE:
case POINTER_TYPE:
case REFERENCE_TYPE:
case ARRAY_TYPE:
- case SET_TYPE:
case VECTOR_TYPE:
if (variably_modified_type_p (TREE_TYPE (type), fn))
return true;
if (elt == NULL_TREE)
return true;
- /* A set is empty only if it has no elements. */
- if (TREE_CODE (TREE_TYPE (init)) == SET_TYPE)
- return false;
-
for (; elt ; elt = TREE_CHAIN (elt))
if (! initializer_zerop (TREE_VALUE (elt)))
return false;
/* Array types in C or Pascal */
DEFTREECODE (ARRAY_TYPE, "array_type", tcc_type, 0)
-/* Types of sets for Pascal. Special fields are the same as
- in an array type. The target type is always a boolean type.
- Used for both bitstrings and powersets in Chill;
- TYPE_STRING_FLAG indicates a bitstring. */
-DEFTREECODE (SET_TYPE, "set_type", tcc_type, 0)
-
/* Struct in C, or record in Pascal. */
/* Special fields:
TYPE_FIELDS chain of FIELD_DECLs for the fields of the struct,
/* Constructor: return an aggregate value made from specified components.
In C, this is used only for structure and array initializers.
- Also used for SET_TYPE in Chill (and potentially Pascal).
The operand is a list of component values made out of a chain of
TREE_LIST nodes.
value in a SAVE_EXPR if you want to evaluate side effects only once.)
For RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE:
- The TREE_PURPOSE of each node is a FIELD_DECL.
-
- For SET_TYPE:
- The TREE_VALUE specifies a value (index) in the set that is true.
- If TREE_PURPOSE is non-NULL, it specifies the lower limit of a
- range of true values. Elements not listed are false (not in the set). */
+ The TREE_PURPOSE of each node is a FIELD_DECL. */
DEFTREECODE (CONSTRUCTOR, "constructor", tcc_expression, 1)
/* The expression types are mostly straightforward, with the fourth argument
#define FUNC_OR_METHOD_CHECK(T) TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE)
#define PTR_OR_REF_CHECK(T) TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE)
-#define SET_OR_ARRAY_CHECK(T) \
- TREE_CHECK2 (T, ARRAY_TYPE, SET_TYPE)
-
#define RECORD_OR_UNION_CHECK(T) \
TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
#define NOT_RECORD_OR_UNION_CHECK(T) \
#define AGGREGATE_TYPE_P(TYPE) \
(TREE_CODE (TYPE) == ARRAY_TYPE || TREE_CODE (TYPE) == RECORD_TYPE \
- || TREE_CODE (TYPE) == UNION_TYPE || TREE_CODE (TYPE) == QUAL_UNION_TYPE \
- || TREE_CODE (TYPE) == SET_TYPE)
+ || TREE_CODE (TYPE) == UNION_TYPE || TREE_CODE (TYPE) == QUAL_UNION_TYPE)
/* Nonzero if TYPE represents a pointer or reference type.
(It should be renamed to INDIRECT_TYPE_P.) */
#define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
#define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
#define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
-#define TYPE_DOMAIN(NODE) (SET_OR_ARRAY_CHECK (NODE)->type.values)
+#define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type.values)
#define TYPE_FIELDS(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.values)
#define TYPE_CACHED_VALUES(NODE) (TYPE_CHECK(NODE)->type.values)
#define TYPE_ORIG_SIZE_TYPE(NODE) \
real_type_class, complex_type_class,
function_type_class, method_type_class,
record_type_class, union_type_class,
- array_type_class, string_type_class, set_type_class, file_type_class,
+ array_type_class, string_type_class, file_type_class,
lang_type_class
};
+ const_hash_1 (TREE_IMAGPART (exp)));
case CONSTRUCTOR:
- if (TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
- {
- char *tmp;
-
- len = int_size_in_bytes (TREE_TYPE (exp));
- tmp = alloca (len);
- get_set_constructor_bytes (exp, (unsigned char *) tmp, len);
- p = tmp;
- break;
- }
- else
- {
- tree link;
-
- hi = 5 + int_size_in_bytes (TREE_TYPE (exp));
-
- for (link = CONSTRUCTOR_ELTS (exp); link; link = TREE_CHAIN (link))
- if (TREE_VALUE (link))
- hi = hi * 603 + const_hash_1 (TREE_VALUE (link));
-
- return hi;
- }
+ {
+ tree link;
+
+ hi = 5 + int_size_in_bytes (TREE_TYPE (exp));
+
+ for (link = CONSTRUCTOR_ELTS (exp); link; link = TREE_CHAIN (link))
+ if (TREE_VALUE (link))
+ hi = hi * 603 + const_hash_1 (TREE_VALUE (link));
+
+ return hi;
+ }
case ADDR_EXPR:
case FDESC_EXPR:
&& compare_constant (TREE_IMAGPART (t1), TREE_IMAGPART (t2)));
case CONSTRUCTOR:
- typecode = TREE_CODE (TREE_TYPE (t1));
- if (typecode != TREE_CODE (TREE_TYPE (t2)))
- return 0;
-
- if (typecode == SET_TYPE)
- {
- int len = int_size_in_bytes (TREE_TYPE (t2));
- unsigned char *tmp1, *tmp2;
-
- if (int_size_in_bytes (TREE_TYPE (t1)) != len)
- return 0;
-
- tmp1 = alloca (len);
- tmp2 = alloca (len);
-
- if (get_set_constructor_bytes (t1, tmp1, len) != NULL_TREE)
- return 0;
- if (get_set_constructor_bytes (t2, tmp2, len) != NULL_TREE)
- return 0;
-
- return memcmp (tmp1, tmp2, len) == 0;
- }
- else
- {
- tree l1, l2;
-
- if (typecode == ARRAY_TYPE)
- {
- HOST_WIDE_INT size_1 = int_size_in_bytes (TREE_TYPE (t1));
- /* For arrays, check that the sizes all match. */
- if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2))
- || size_1 == -1
- || size_1 != int_size_in_bytes (TREE_TYPE (t2)))
- return 0;
- }
- else
- {
- /* For record and union constructors, require exact type
- equality. */
- if (TREE_TYPE (t1) != TREE_TYPE (t2))
- return 0;
- }
+ {
+ tree l1, l2;
+
+ typecode = TREE_CODE (TREE_TYPE (t1));
+ if (typecode != TREE_CODE (TREE_TYPE (t2)))
+ return 0;
- for (l1 = CONSTRUCTOR_ELTS (t1), l2 = CONSTRUCTOR_ELTS (t2);
- l1 && l2;
- l1 = TREE_CHAIN (l1), l2 = TREE_CHAIN (l2))
- {
- /* Check that each value is the same... */
- if (! compare_constant (TREE_VALUE (l1), TREE_VALUE (l2)))
- return 0;
- /* ... and that they apply to the same fields! */
- if (typecode == ARRAY_TYPE)
- {
- if (! compare_constant (TREE_PURPOSE (l1),
- TREE_PURPOSE (l2)))
- return 0;
- }
- else
- {
- if (TREE_PURPOSE (l1) != TREE_PURPOSE (l2))
- return 0;
- }
- }
+ if (typecode == ARRAY_TYPE)
+ {
+ HOST_WIDE_INT size_1 = int_size_in_bytes (TREE_TYPE (t1));
+ /* For arrays, check that the sizes all match. */
+ if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2))
+ || size_1 == -1
+ || size_1 != int_size_in_bytes (TREE_TYPE (t2)))
+ return 0;
+ }
+ else
+ {
+ /* For record and union constructors, require exact type
+ equality. */
+ if (TREE_TYPE (t1) != TREE_TYPE (t2))
+ return 0;
+ }
- return l1 == NULL_TREE && l2 == NULL_TREE;
- }
+ for (l1 = CONSTRUCTOR_ELTS (t1), l2 = CONSTRUCTOR_ELTS (t2);
+ l1 && l2;
+ l1 = TREE_CHAIN (l1), l2 = TREE_CHAIN (l2))
+ {
+ /* Check that each value is the same... */
+ if (! compare_constant (TREE_VALUE (l1), TREE_VALUE (l2)))
+ return 0;
+ /* ... and that they apply to the same fields! */
+ if (typecode == ARRAY_TYPE)
+ {
+ if (! compare_constant (TREE_PURPOSE (l1),
+ TREE_PURPOSE (l2)))
+ return 0;
+ }
+ else
+ {
+ if (TREE_PURPOSE (l1) != TREE_PURPOSE (l2))
+ return 0;
+ }
+ }
+
+ return l1 == NULL_TREE && l2 == NULL_TREE;
+ }
case ADDR_EXPR:
case FDESC_EXPR:
CONSTRUCTOR_ELTS (copy) = list;
for (tail = list; tail; tail = TREE_CHAIN (tail))
TREE_VALUE (tail) = copy_constant (TREE_VALUE (tail));
- if (TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
- for (tail = list; tail; tail = TREE_CHAIN (tail))
- TREE_PURPOSE (tail) = copy_constant (TREE_PURPOSE (tail));
return copy;
}
abort ();
return;
- case SET_TYPE:
- if (TREE_CODE (exp) == INTEGER_CST)
- assemble_integer (expand_expr (exp, NULL_RTX,
- VOIDmode, EXPAND_INITIALIZER),
- thissize, align, 1);
- else if (TREE_CODE (exp) == CONSTRUCTOR)
- {
- unsigned char *buffer = alloca (thissize);
- if (get_set_constructor_bytes (exp, buffer, thissize))
- abort ();
- assemble_string ((char *) buffer, thissize);
- }
- else
- error ("unknown set constructor type");
- return;
-
case ERROR_MARK:
return;