From: Nathan Sidwell Date: Fri, 20 Aug 2004 14:17:39 +0000 (+0000) Subject: stor-layout.c (initialize_sizetypes): Set SIZETYPE earlier, clear cache on copied... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3224beadb4cebe8137600efe3d13082f40076cc1;p=gcc.git stor-layout.c (initialize_sizetypes): Set SIZETYPE earlier, clear cache on copied sizetype. * stor-layout.c (initialize_sizetypes): Set SIZETYPE earlier, clear cache on copied sizetype. * ada/utils2.c (build_allocator): Use build_int_cst for negative size types. * cp/class.c (build_vtbl_initializer): Use build_int_cst for negative size types. * cp/decl.c (complete_array_type): Likewise. * cp/method.c (finish_thunk): Likewise. From-SVN: r86320 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e6471f70e92..d6bba043dc4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-08-20 Nathan Sidwell + + * stor-layout.c (initialize_sizetypes): Set SIZETYPE earlier, + clear cache on copied sizetype. + 2004-08-20 Ben Elliston * configure.ac: Don't escape apostrophe in --enable-coverage help. @@ -2785,7 +2790,7 @@ * config/i386/xmmintrin.h: Include . 2004-08-03 H.J. Lu - Tanguy FautrÃ? + Tanguy Fautrà * config/i386/pmm_malloc.h: New file. diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7bc0828143e..6ea32826406 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2004-08-20 Nathan Sidwell + + * utils2.c (build_allocator): Use build_int_cst for negative + size types. + 2004-08-18 Richard Henderson * misc.c (LANG_HOOKS_HONOR_READONLY): Remove. diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c index 726c9f2ac84..60de87d89d6 100644 --- a/gcc/ada/utils2.c +++ b/gcc/ada/utils2.c @@ -1799,7 +1799,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, /* If the size overflows, pass -1 so the allocator will raise storage error. */ if (TREE_CODE (size) == INTEGER_CST && TREE_OVERFLOW (size)) - size = ssize_int (-1); + size = build_int_cst (ssizetype, -1, -1); storage = build_call_alloc_dealloc (NULL_TREE, size, TYPE_ALIGN (storage_type), @@ -1872,7 +1872,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, /* If the size overflows, pass -1 so the allocator will raise storage error. */ if (TREE_CODE (size) == INTEGER_CST && TREE_OVERFLOW (size)) - size = ssize_int (-1); + size = build_int_cst (ssizetype, -1, -1); /* If this is a type whose alignment is larger than the biggest we support in normal alignment and this is in diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cf2e0b85b13..372c27e0416 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2004-08-20 Nathan Sidwell + + * class.c (build_vtbl_initializer): Use build_int_cst for + negative size types. + * decl.c (complete_array_type): Likewise. + * method.c (finish_thunk): Likewise. + 2004-08-20 Andreas Tobler * tree.c: Remove unused mark_local_for_remap_r. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 1989dca91af..c7294146b3a 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -7278,7 +7278,8 @@ build_vtbl_initializer (tree binfo, vid.ctor_vtbl_p = !same_type_p (BINFO_TYPE (rtti_binfo), t); vid.generate_vcall_entries = true; /* The first vbase or vcall offset is at index -3 in the vtable. */ - vid.index = ssize_int (-3 * TARGET_VTABLE_DATA_ENTRY_DISTANCE); + vid.index = build_int_cst (ssizetype, + -3 * TARGET_VTABLE_DATA_ENTRY_DISTANCE, -1); /* Add entries to the vtable for RTTI. */ build_rtti_vtbl_entries (binfo, &vid); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 0c60f3c6d35..36e83d9c1a5 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -5260,7 +5260,7 @@ complete_array_type (tree type, tree initial_value, int do_default) { tree elts = CONSTRUCTOR_ELTS (initial_value); - maxindex = ssize_int (-1); + maxindex = build_int_cst (ssizetype, -1, -1); for (; elts; elts = TREE_CHAIN (elts)) { if (TREE_PURPOSE (elts)) diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 13fe0a492aa..d0bad5df4fb 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -179,7 +179,9 @@ void finish_thunk (tree thunk) { tree function, name; - tree fixed_offset = ssize_int (THUNK_FIXED_OFFSET (thunk)); + tree fixed_offset = build_int_cst (ssizetype, + THUNK_FIXED_OFFSET (thunk), + THUNK_FIXED_OFFSET (thunk) < 0 ? -1 : 0); tree virtual_offset = THUNK_VIRTUAL_OFFSET (thunk); my_friendly_assert (!DECL_NAME (thunk) && DECL_THUNK_P (thunk), 20021127); diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 156702f652f..19de9b6d0a4 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1863,12 +1863,12 @@ initialize_sizetypes (void) TYPE_MODE (t) = SImode; TYPE_ALIGN (t) = GET_MODE_ALIGNMENT (SImode); TYPE_USER_ALIGN (t) = 0; + TYPE_IS_SIZETYPE (t) = 1; TYPE_SIZE (t) = build_int_cst (t, GET_MODE_BITSIZE (SImode), 0); TYPE_SIZE_UNIT (t) = build_int_cst (t, GET_MODE_SIZE (SImode), 0); TYPE_UNSIGNED (t) = 1; TYPE_PRECISION (t) = GET_MODE_BITSIZE (SImode); TYPE_MIN_VALUE (t) = build_int_cst (t, 0, 0); - TYPE_IS_SIZETYPE (t) = 1; /* 1000 avoids problems with possible overflow and is certainly larger than any size value we'd want to be storing. */ @@ -1878,6 +1878,8 @@ initialize_sizetypes (void) size_int_wide. */ sizetype = t; bitsizetype = copy_node (t); + TYPE_CACHED_VALUES (bitsizetype) = NULL_TREE; + TYPE_CACHED_VALUES_P (bitsizetype) = 0; } /* Set sizetype to TYPE, and initialize *sizetype accordingly.