diff options
author | Richard Guenther <rguenther@suse.de> | 2009-04-08 16:33:08 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-04-08 16:33:08 +0000 |
commit | 75ccc1e7fa591f7a6c88ddd04b97169bcf04e5ff (patch) | |
tree | 3b276fc4543ee33b2bc43f554a23fcf7da9cf60f /gcc/tree-dfa.c | |
parent | f6f5e3a1cc294a064bf87250db3dee449a24f278 (diff) | |
download | gcc-75ccc1e7fa591f7a6c88ddd04b97169bcf04e5ff.zip gcc-75ccc1e7fa591f7a6c88ddd04b97169bcf04e5ff.tar.gz gcc-75ccc1e7fa591f7a6c88ddd04b97169bcf04e5ff.tar.bz2 |
re PR tree-optimization/36291 (GCC is slow and memory-hungry building sipQtGuipart.cpp)
2009-04-08 Richard Guenther <rguenther@suse.de>
PR middle-end/36291
* tree-dfa.c (add_referenced_var): Do not recurse into
global initializers.
* tree-ssa-ccp.c (get_symbol_constant_value): Add newly
exposed variables.
(fold_const_aggregate_ref): Likewise.
From-SVN: r145757
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r-- | gcc/tree-dfa.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index d50b7dd..1738dd0 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -600,13 +600,11 @@ add_referenced_var (tree var) { /* Scan DECL_INITIAL for pointer variables as they may contain address arithmetic referencing the address of other - variables. - Even non-constant initializers need to be walked, because - IPA passes might prove that their are invariant later on. */ + variables. As we are only interested in directly referenced + globals or referenced locals restrict this to initializers + than can refer to local variables. */ if (DECL_INITIAL (var) - /* Initializers of external variables are not useful to the - optimizers. */ - && !DECL_EXTERNAL (var)) + && DECL_CONTEXT (var) == current_function_decl) walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0); return true; |