aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-dfa.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f30de32..c7b6f33 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2005-10-13 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/21304
+ * tree-dfa.c (add_referenced_var): Only look at decls which
+ have TREE_CONSTANT or TREE_READONLY set instead of if
+ !TREE_PUBLIC or !TREE_CONSTANT.
+
2005-10-13 James E Wilson <wilson@specifix.com>
* doc/invoke.texi: For -x, add f95-cpp-input.
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 866ac6e..9fc48d5 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -651,9 +651,9 @@ add_referenced_var (tree var, struct walk_state *walk_state)
optimizers. */
&& !DECL_EXTERNAL (var)
/* It's not necessary to walk the initial value of non-constant
- public variables because it cannot be propagated by the
+ variables because it cannot be propagated by the
optimizers. */
- && (!TREE_PUBLIC (var) || !TREE_CONSTANT (var)))
+ && (TREE_CONSTANT (var) || TREE_READONLY (var)))
walk_tree (&DECL_INITIAL (var), find_vars_r, walk_state, 0);
}
}