diff options
author | Jan Hubicka <jh@suse.cz> | 2006-12-20 23:45:42 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2006-12-20 22:45:42 +0000 |
commit | 33dde1e155b86aa684a75b0820f6af368f046507 (patch) | |
tree | a2fec6c9ebf71881ab6fe59d10b7f82e28154a37 | |
parent | adb6509f4b75e929a237ded6d182f8524697fedf (diff) | |
download | gcc-33dde1e155b86aa684a75b0820f6af368f046507.zip gcc-33dde1e155b86aa684a75b0820f6af368f046507.tar.gz gcc-33dde1e155b86aa684a75b0820f6af368f046507.tar.bz2 |
tree-dfa.c (add_referenced_var): Walk initializers of non-constant/readonly static vars.
* tree-dfa.c (add_referenced_var): Walk initializers of
non-constant/readonly static vars.
From-SVN: r120090
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-dfa.c | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c4bcad1..0660654 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2006-12-20 Jan Hubicka <jh@suse.cz> + * tree-dfa.c (add_referenced_var): Walk initializers of + non-constant/readonly static vars. + +2006-12-20 Jan Hubicka <jh@suse.cz> + * tree-flow-inline.h (gimple_var_anns): New function. (var_ann): Use hashtable for static functions. * tree-dfa.c (create_var_ann): Likewise. diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 5b9c724..9c30eb5 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -741,15 +741,13 @@ add_referenced_var (tree var) /* Scan DECL_INITIAL for pointer variables as they may contain address arithmetic referencing the address of other - variables. */ + variables. + Even non-constant intializers need to be walked, because + IPA passes might prove that their are invariant later on. */ 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 - variables because it cannot be propagated by the - optimizers. */ - && (TREE_CONSTANT (var) || TREE_READONLY (var))) + && !DECL_EXTERNAL (var)) walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0); } } |