diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-02 01:28:06 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-02 01:28:06 +0000 |
commit | 8c796c7c31f65a6a69e141c0ff4ba7b27aadf31d (patch) | |
tree | 4ae8b9479a85461b3b4d4d15313a3ec3809c54a7 /gcc/tree-ssa-live.c | |
parent | 9ee128846ac073555b0fe1195807d77f605155ac (diff) | |
download | gcc-8c796c7c31f65a6a69e141c0ff4ba7b27aadf31d.tar.gz |
Revert patches that should have been installed in the vta branch only.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128933 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-live.c')
-rw-r--r-- | gcc/tree-ssa-live.c | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c index 4cf6620a759..a78dd9c19eb 100644 --- a/gcc/tree-ssa-live.c +++ b/gcc/tree-ssa-live.c @@ -468,10 +468,39 @@ mark_scope_block_unused (tree scope) static bool remove_unused_scope_block_p (tree scope) { - tree *t; + tree *t, *next; bool unused = !TREE_USED (scope); + var_ann_t ann; int nsubblocks = 0; + for (t = &BLOCK_VARS (scope); *t; t = next) + { + next = &TREE_CHAIN (*t); + + /* Debug info of nested function refers to the block of the + function. */ + if (TREE_CODE (*t) == FUNCTION_DECL) + unused = false; + + /* When we are outputting debug info, we usually want to output + info about optimized-out variables in the scope blocks. + Exception are the scope blocks not containing any instructions + at all so user can't get into the scopes at first place. */ + else if ((ann = var_ann (*t)) != NULL + && ann->used) + unused = false; + + /* When we are not doing full debug info, we however can keep around + only the used variables for cfgexpand's memory packing saving quite + a lot of memory. */ + else if (debug_info_level != DINFO_LEVEL_NORMAL + && debug_info_level != DINFO_LEVEL_VERBOSE) + { + *t = TREE_CHAIN (*t); + next = t; + } + } + for (t = &BLOCK_SUBBLOCKS (scope); *t ;) if (remove_unused_scope_block_p (*t)) { @@ -504,10 +533,12 @@ remove_unused_scope_block_p (tree scope) /* When there is only one subblock, see if it is just wrapper we can ignore. Wrappers are not declaring any variables and not changing abstract origin. */ - else if (nsubblocks <= 1 + else if (nsubblocks == 1 && (BLOCK_VARS (scope) - || (BLOCK_ABSTRACT_ORIGIN (scope) - != BLOCK_ABSTRACT_ORIGIN (BLOCK_SUPERCONTEXT (scope))))) + || ((debug_info_level == DINFO_LEVEL_NORMAL + || debug_info_level == DINFO_LEVEL_VERBOSE) + && ((BLOCK_ABSTRACT_ORIGIN (scope) + != BLOCK_ABSTRACT_ORIGIN (BLOCK_SUPERCONTEXT (scope))))))) unused = false; return unused; } |