aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/fold-const.c13
2 files changed, 14 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9a3f53f..2b7ff26 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2005-12-27 Kazu Hirata <kazu@codesourcery.com>
* global.c, tree-ssa-pre.c: Move DEF_VEC_P(basic_block) and
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 4006d89..2366c75 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -10498,13 +10498,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);