summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-live.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-02 06:18:01 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-02 06:18:01 +0000
commitf665f7bba2f1d6ff7ffd8cacdc5e4d85ba167004 (patch)
treeccc3a4712d7c10046df4c3604d1167d5dafaa720 /gcc/tree-ssa-live.c
parente81986abbb09686debad9198b240245ff75fc0f2 (diff)
downloadgcc-f665f7bba2f1d6ff7ffd8cacdc5e4d85ba167004.tar.gz
PR debug/47106
PR debug/47402 * tree-flow-inline.h (clear_is_used, is_used_p): New. * cfgexpand.c (account_used_vars_for_block): Use them. * tree-nrv.c (tree_nrv): Likewise. * tree-ssa-live.c (remove_unused_scope_block_p): Likewise. (dump_scope_block): Likewise. (remove_unused_locals): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169515 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-live.c')
-rw-r--r--gcc/tree-ssa-live.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 4880a1a7bbd..d917bb99a83 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -468,7 +468,7 @@ remove_unused_scope_block_p (tree scope)
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)
+ && is_used_p (*t))
unused = false;
else if (TREE_CODE (*t) == LABEL_DECL && TREE_USED (*t))
/* For labels that are still used in the IL, the decision to
@@ -633,13 +633,11 @@ dump_scope_block (FILE *file, int indent, tree scope, int flags)
for (var = BLOCK_VARS (scope); var; var = DECL_CHAIN (var))
{
bool used = false;
- var_ann_t ann;
- if ((ann = var_ann (var))
- && ann->used)
- used = true;
+ if (var_ann (var))
+ used = is_used_p (var);
- fprintf (file, "%*s",indent, "");
+ fprintf (file, "%*s", indent, "");
print_generic_decl (file, var, flags);
fprintf (file, "%s\n", used ? "" : " (unused)");
}
@@ -708,7 +706,7 @@ remove_unused_locals (void)
/* Assume all locals are unused. */
FOR_EACH_REFERENCED_VAR (t, rvi)
- var_ann (t)->used = false;
+ clear_is_used (t);
/* Walk the CFG marking all referenced symbols. */
FOR_EACH_BB (bb)
@@ -769,7 +767,7 @@ remove_unused_locals (void)
var = VEC_index (tree, cfun->local_decls, srcidx);
if (TREE_CODE (var) != FUNCTION_DECL
&& (!(ann = var_ann (var))
- || !ann->used))
+ || !is_used_p (var)))
{
if (is_global_var (var))
{
@@ -801,7 +799,7 @@ remove_unused_locals (void)
if (TREE_CODE (var) == VAR_DECL
&& is_global_var (var)
&& (ann = var_ann (var)) != NULL
- && ann->used)
+ && is_used_p (var))
mark_all_vars_used (&DECL_INITIAL (var), global_unused_vars);
num = VEC_length (tree, cfun->local_decls);
@@ -827,8 +825,8 @@ remove_unused_locals (void)
if (!is_global_var (t)
&& TREE_CODE (t) != PARM_DECL
&& TREE_CODE (t) != RESULT_DECL
- && !(ann = var_ann (t))->used
- && !ann->is_heapvar)
+ && !is_used_p (t)
+ && !var_ann (t)->is_heapvar)
remove_referenced_var (t);
remove_unused_scope_block_p (DECL_INITIAL (current_function_decl));
if (dump_file && (dump_flags & TDF_DETAILS))