+Thu Mar 2 13:29:46 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * c-common.c (c_common_nodes_and_builtins): Make sizetype_endlink
+ reference the language-equivalent of sizetype.
+ * c-typeck.c (comptypes): Treat sizetype like its language equivalent.
+ * fold-const.c (size_binop, size_diffop): Put back checks.
+ * gcse.c (dump_hash_table): Fix minor error in last change.
+ * stor-layout.c (set_sizetype): Set TYPE_DOMAIN of sizetype.
+ Clear TYPE_{NEXT,MAIN}_VARIANT and TYPE_{POINTER,REFERENCE}_to of
+ all sizetypes.
+
Thu Mar 2 12:48:45 MET 2000 Jan Hubicka <jh@suse.cz>
* calls.c (expand_call) Do not attempt to combine stack adjustments
ptr_ftype = build_function_type (ptr_type_node, NULL_TREE);
ptr_ftype_unsigned = build_function_type (ptr_type_node, unsigned_endlink);
- sizetype_endlink = tree_cons (NULL_TREE, sizetype, endlink);
+ sizetype_endlink = tree_cons (NULL_TREE, TYPE_DOMAIN (sizetype), endlink);
/* We realloc here because sizetype could be int or unsigned. S'ok. */
ptr_ftype_sizetype = build_function_type (ptr_type_node, sizetype_endlink);
|| TREE_CODE (t1) == ERROR_MARK || TREE_CODE (t2) == ERROR_MARK)
return 1;
+ /* If either type is the internal version of sizetype, return the
+ language version. */
+ if (TREE_CODE (t1) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t1)
+ && TYPE_DOMAIN (t1) != 0)
+ t1 = TYPE_DOMAIN (t1);
+
+ if (TREE_CODE (t2) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t2)
+ && TYPE_DOMAIN (t2) != 0)
+ t2 = TYPE_DOMAIN (t2);
+
/* Treat an enum type as the integer type of the same width and
signedness. */
+Thu Mar 2 13:32:01 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * typeck.c (comptypes): Treat sizetype like its language equivalent.
+
2000-03-01 Bernd Schmidt <bernds@cygnus.co.uk>
* typeck.c (maybe_warn_about_returning_address_of_local): Reorganize
if (t2 == error_mark_node)
return 0;
- /* If this is a strict comparison with a sizetype, the actual types
- won't be the same (since we need to set TYPE_IS_SIZETYPE, so verify
- if they are both the same size and signedness. */
- if (strict == COMPARE_STRICT
- && TREE_CODE (t2) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t2)
- && TREE_CODE (t1) == INTEGER_TYPE
- && TREE_UNSIGNED (t1) == TREE_UNSIGNED (t2)
- && TYPE_MODE (t1) == TYPE_MODE (t2)
- && TYPE_MIN_VALUE (t1) == TYPE_MIN_VALUE (t2)
- && TYPE_MAX_VALUE (t1) == TYPE_MAX_VALUE (t2))
- return 1;
+ /* If either type is the internal version of sizetype, return the
+ language version. */
+ if (TREE_CODE (t1) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t1)
+ && TYPE_DOMAIN (t1) != 0)
+ t1 = TYPE_DOMAIN (t1);
+
+ if (TREE_CODE (t2) == INTEGER_TYPE && TYPE_IS_SIZETYPE (t2)
+ && TYPE_DOMAIN (t2) != 0)
+ t2 = TYPE_DOMAIN (t2);
if (strict & COMPARE_RELAXED)
{
{
tree type = TREE_TYPE (arg0);
- if (TREE_CODE (type) != INTEGER_TYPE
- || TREE_CODE (TREE_TYPE (arg1)) != INTEGER_TYPE)
+ if (TREE_CODE (type) != INTEGER_TYPE || ! TYPE_IS_SIZETYPE (type)
+ || type != TREE_TYPE (arg1))
abort ();
/* Handle the special case of two integer constants faster. */
tree type = TREE_TYPE (arg0);
tree ctype;
- if (TREE_CODE (type) != INTEGER_TYPE
- || TREE_CODE (TREE_TYPE (arg1)) != INTEGER_TYPE)
+ if (TREE_CODE (type) != INTEGER_TYPE || ! TYPE_IS_SIZETYPE (type)
+ || type != TREE_TYPE (arg1))
abort ();
/* If the type is already signed, just do the simple thing. */
name, table_size, total_size);
for (i = 0; i < total_size; i++)
- {
- fprintf (file, "Index %d (hash value %d)\n ",
- expr->bitmap_index, hash_val[i]);
- print_rtl (file, flat_table[i]->expr);
- fprintf (file, "\n");
- }
+ if (flat_table[i] != 0)
+ {
+ fprintf (file, "Index %d (hash value %d)\n ",
+ expr->bitmap_index, hash_val[i]);
+ print_rtl (file, flat_table[i]->expr);
+ fprintf (file, "\n");
+ }
fprintf (file, "\n");
/* Make copies of nodes since we'll be setting TYPE_IS_SIZETYPE. */
sizetype = copy_node (type);
+ TYPE_DOMAIN (sizetype) = type;
bitsizetype = make_node (INTEGER_TYPE);
TYPE_NAME (bitsizetype) = TYPE_NAME (type);
TYPE_PRECISION (bitsizetype) = precision;
TYPE_NAME (bitsizetype) = get_identifier ("bit_size_type");
+ /* Show is a sizetype, is a main type, and has no pointers to it. */
for (i = 0; i < sizeof sizetype_tab / sizeof sizetype_tab[0]; i++)
- TYPE_IS_SIZETYPE (sizetype_tab[i]) = 1;
+ {
+ TYPE_IS_SIZETYPE (sizetype_tab[i]) = 1;
+ TYPE_MAIN_VARIANT (sizetype_tab[i]) = sizetype_tab[i];
+ TYPE_NEXT_VARIANT (sizetype_tab[i]) = 0;
+ TYPE_POINTER_TO (sizetype_tab[i]) = 0;
+ TYPE_REFERENCE_TO (sizetype_tab[i]) = 0;
+ }
ggc_add_tree_root ((tree *) &sizetype_tab,
sizeof sizetype_tab / sizeof (tree));