From: Alexandre Oliva Date: Tue, 2 Oct 2007 01:12:19 +0000 (+0000) Subject: tree-ssa-live.c (remove_unused_scope_block_p): Don't change generated code depending... X-Git-Tag: releases/gcc-4.3.0~2271 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6cd9e97f91364ff0992aeb1a3a7e48fd110c107b;p=thirdparty%2Fgcc.git tree-ssa-live.c (remove_unused_scope_block_p): Don't change generated code depending on -g. * tree-ssa-live.c (remove_unused_scope_block_p): Don't change generated code depending on -g. Reverts part of 2007-07-26's patch. From-SVN: r128932 --- diff --git a/gcc/ChangeLog.vta b/gcc/ChangeLog.vta index 413359c1c12d..12ef27f70b8c 100644 --- a/gcc/ChangeLog.vta +++ b/gcc/ChangeLog.vta @@ -1,3 +1,9 @@ +2007-10-01 Alexandre Oliva + + * tree-ssa-live.c (remove_unused_scope_block_p): Don't change + generated code depending on -g. Reverts part of 2007-07-26's + patch. + Local Variables: mode: change-log change-log-default-name: "ChangeLog.vta" diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c index a78dd9c19ebb..4cf6620a759a 100644 --- a/gcc/tree-ssa-live.c +++ b/gcc/tree-ssa-live.c @@ -468,39 +468,10 @@ mark_scope_block_unused (tree scope) static bool remove_unused_scope_block_p (tree scope) { - tree *t, *next; + tree *t; 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)) { @@ -533,12 +504,10 @@ 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) - || ((debug_info_level == DINFO_LEVEL_NORMAL - || debug_info_level == DINFO_LEVEL_VERBOSE) - && ((BLOCK_ABSTRACT_ORIGIN (scope) - != BLOCK_ABSTRACT_ORIGIN (BLOCK_SUPERCONTEXT (scope))))))) + || (BLOCK_ABSTRACT_ORIGIN (scope) + != BLOCK_ABSTRACT_ORIGIN (BLOCK_SUPERCONTEXT (scope))))) unused = false; return unused; }