diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-03 19:53:47 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-03 19:53:47 +0000 |
commit | b93ca75c5b1631c9f0ea5770c6408171aa80e695 (patch) | |
tree | dda0b5cd5fd490aa7e859092678f02933789bca8 /gcc/tree-dfa.c | |
parent | 92effd8753f2b487c63e143127aa6f98e0e425c8 (diff) | |
download | gcc-b93ca75c5b1631c9f0ea5770c6408171aa80e695.tar.gz |
* tree-dfa.c (add_referenced_var): Don't walk initializer of external
and non-constant public variables.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95844 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r-- | gcc/tree-dfa.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index b591ffb5e7e..641bb1b4df4 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -901,7 +901,14 @@ add_referenced_var (tree var, struct walk_state *walk_state) /* Scan DECL_INITIAL for pointer variables as they may contain address arithmetic referencing the address of other variables. */ - if (DECL_INITIAL (var)) + if (DECL_INITIAL (var) + /* Initializers of external variables are not useful to the + 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 + optimizers. */ + && (!TREE_PUBLIC (var) || !TREE_CONSTANT (var))) walk_tree (&DECL_INITIAL (var), find_vars_r, walk_state, 0); } } |