mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-20 17:40:46 +08:00
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
This commit is contained in:
parent
adb6509f4b
commit
33dde1e155
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user