diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc9540c93ea..cb2ec2a291c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-03-15 Roger Sayle + + PR tree-optimization/17454 + * tree.c (tree_size): Add case for TREE_BINFO. + * fold-const.c (fold_checksum_tree): Only clear the overloaded + field TYPE_CACHED_VALUES if TYPE_CACHED_VALUES_P is set. + 2005-03-15 Roger Sayle * optabs.c (expand_doubleword_mult): Avoid clobbering op0 and diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 6a00abe423b..13e91530cb0 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10049,8 +10049,11 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht) expr = (tree) buf; TYPE_POINTER_TO (expr) = NULL; TYPE_REFERENCE_TO (expr) = NULL; - TYPE_CACHED_VALUES_P (expr) = 0; - TYPE_CACHED_VALUES (expr) = NULL; + if (TYPE_CACHED_VALUES_P (expr)) + { + TYPE_CACHED_VALUES_P (expr) = 0; + TYPE_CACHED_VALUES (expr) = NULL; + } } md5_process_bytes (expr, tree_size (expr), ctx); fold_checksum_tree (TREE_TYPE (expr), ctx, ht); diff --git a/gcc/tree.c b/gcc/tree.c index 0a99598123a..b1c2458973b 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -243,6 +243,10 @@ tree_size (tree node) return (sizeof (struct tree_phi_node) + (PHI_ARG_CAPACITY (node) - 1) * sizeof (struct phi_arg_d)); + case TREE_BINFO: + return (offsetof (struct tree_binfo, base_binfos) + + VEC_embedded_size (tree, BINFO_N_BASE_BINFOS (node))); + case TREE_VEC: return (sizeof (struct tree_vec) + (TREE_VEC_LENGTH (node) - 1) * sizeof(char *));