This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Fix PR tree-optimization/25394
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 28 Dec 2005 09:09:09 -0500
- Subject: [PATCH]: Fix PR tree-optimization/25394
This little obvious patch fixes fold-checksumming, which was failing due
to needing some more structure containment checks.
Committed to mainline.
--Dan
2005-12-28 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/25394
* fold-const.c (fold_checksum_tree): Guard
portions of checksumming with correct structure checks.
Index: fold-const.c
===================================================================
--- fold-const.c (revision 108368)
+++ fold-const.c (working copy)
@@ -10507,13 +10507,16 @@ recursive_label:
fold_checksum_tree (TREE_OPERAND (expr, i), ctx, ht);
break;
case tcc_declaration:
- fold_checksum_tree (DECL_SIZE (expr), ctx, ht);
- 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_INITIAL (expr), ctx, ht);
- fold_checksum_tree (DECL_ABSTRACT_ORIGIN (expr), ctx, ht);
- fold_checksum_tree (DECL_ATTRIBUTES (expr), ctx, ht);
+ if (CODE_CONTAINS_STRUCT (TREE_CODE (expr), TS_DECL_COMMON))
+ {
+ fold_checksum_tree (DECL_SIZE (expr), ctx, ht);
+ fold_checksum_tree (DECL_SIZE_UNIT (expr), ctx, ht);
+ fold_checksum_tree (DECL_INITIAL (expr), ctx, ht);
+ fold_checksum_tree (DECL_ABSTRACT_ORIGIN (expr), ctx, ht);
+ fold_checksum_tree (DECL_ATTRIBUTES (expr), ctx, ht);
+ }
if (CODE_CONTAINS_STRUCT (TREE_CODE (expr), TS_DECL_WITH_VIS))
fold_checksum_tree (DECL_SECTION_NAME (expr), ctx, ht);