diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2005-08-29 00:12:19 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@gcc.gnu.org> | 2005-08-29 00:12:19 +0000 |
commit | 46c5394b31bbab3d52c4130df31d77a76a6966a8 (patch) | |
tree | 85543977e6e7417ba0bc531bce5572d18ec390ac /gcc/fold-const.c | |
parent | ea407814d021c256717eba35c08c960923b02ec1 (diff) | |
download | gcc-46c5394b31bbab3d52c4130df31d77a76a6966a8.zip gcc-46c5394b31bbab3d52c4130df31d77a76a6966a8.tar.gz gcc-46c5394b31bbab3d52c4130df31d77a76a6966a8.tar.bz2 |
re PR middle-end/22455 (ICE tree check: expected function_decl, have type_decl in fold_checksum_tree, at fold-const.c:10282)
2005-08-28 Daniel Berlin <dberlin@dberlin.org>
Fix PR middle-end/22455
* fold-const.c (fold_checksum_tree): Adjust for now-largest tree size.
Checksum only the parts of the tree that exist for the tree code.
From-SVN: r103586
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 88fbd0c..2f024b4 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10277,14 +10277,14 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht) { void **slot; enum tree_code code; - char buf[sizeof (struct tree_decl_non_common)]; + char buf[sizeof (struct tree_function_decl)]; int i, len; recursive_label: gcc_assert ((sizeof (struct tree_exp) + 5 * sizeof (tree) - <= sizeof (struct tree_decl_non_common)) - && sizeof (struct tree_type) <= sizeof (struct tree_decl_non_common)); + <= sizeof (struct tree_function_decl)) + && sizeof (struct tree_type) <= sizeof (struct tree_function_decl)); if (expr == NULL) return; slot = htab_find_slot (ht, expr, INSERT); @@ -10375,13 +10375,18 @@ recursive_label: fold_checksum_tree (DECL_SIZE_UNIT (expr), ctx, ht); fold_checksum_tree (DECL_NAME (expr), ctx, ht); fold_checksum_tree (DECL_CONTEXT (expr), ctx, ht); - fold_checksum_tree (DECL_ARGUMENTS (expr), ctx, ht); - fold_checksum_tree (DECL_RESULT_FLD (expr), ctx, ht); fold_checksum_tree (DECL_INITIAL (expr), ctx, ht); fold_checksum_tree (DECL_ABSTRACT_ORIGIN (expr), ctx, ht); - fold_checksum_tree (DECL_SECTION_NAME (expr), ctx, ht); fold_checksum_tree (DECL_ATTRIBUTES (expr), ctx, ht); - fold_checksum_tree (DECL_VINDEX (expr), ctx, ht); + if (CODE_CONTAINS_STRUCT (TREE_CODE (expr), TS_DECL_WITH_VIS)) + fold_checksum_tree (DECL_SECTION_NAME (expr), ctx, ht); + + if (CODE_CONTAINS_STRUCT (TREE_CODE (expr), TS_DECL_NON_COMMON)) + { + fold_checksum_tree (DECL_VINDEX (expr), ctx, ht); + fold_checksum_tree (DECL_RESULT_FLD (expr), ctx, ht); + fold_checksum_tree (DECL_ARGUMENT_FLD (expr), ctx, ht); + } break; case tcc_type: if (TREE_CODE (expr) == ENUMERAL_TYPE) |