Commit 59c982fe by Jan Hubicka Committed by Jan Hubicka

tree-dfa.c (add_referenced_var): Don't walk initializer of external and…

tree-dfa.c (add_referenced_var): Don't walk initializer of external and non-constant public variables.

	* tree-dfa.c (add_referenced_var): Don't walk initializer of external
	and non-constant public variables.

From-SVN: r95844
parent e59ef543
2005-03-03 Jan Hubicka <jh@suse.cz>
* tree-dfa.c (add_referenced_var): Don't walk initializer of external
and non-constant public variables.
2005-03-03 Kazu Hirata <kazu@cs.umass.edu>
* tree-cfg.c (stmt_starts_bb_p): Clean up by replacing code
......
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment