re PR tree-optimization/50644 (ICE in set_is_used added today)

PR middle-end/50644
	PR middle-end/50741

	* tree-ssa-live.c (mark_all_vars_used_1): Recurse only for decls of
	current function.
	(remove_unused_locals): Ditto.

testsuite/

	* g++.dg/tree-ssa/pr50741.C: New.

From-SVN: r181443
This commit is contained in:
Michael Matz 2011-11-17 16:03:56 +00:00 committed by Michael Matz
parent d846e425c9
commit f14c43566a
4 changed files with 32 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2011-11-17 Michael Matz <matz@suse.de>
PR middle-end/50644
PR middle-end/50741
* tree-ssa-live.c (mark_all_vars_used_1): Recurse only for decls of
current function.
(remove_unused_locals): Ditto.
2011-11-16 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.c (alpha_split_compare_and_swap_12): Copy

View File

@ -1,3 +1,9 @@
2011-11-17 Michael Matz <matz@suse.de>
PR middle-end/50644
PR middle-end/50741
* g++.dg/tree-ssa/pr50741.C: New.
2011-11-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* lib/gcc-simulate-thread.exp (simulate-thread): Skip on

View File

@ -0,0 +1,14 @@
/* { dg-do compile } */
/* { dg-options "-O2 -g" } */
/* PR middle-end/50741 */
struct PublishLo
{
const char *functionName;
~PublishLo();
};
struct A { A(); };
A::A()
{
static PublishLo _rL_53 = {__FUNCTION__};
}

View File

@ -374,7 +374,8 @@ mark_all_vars_used_1 (tree *tp, int *walk_subtrees, void *data)
eliminated as unused. */
if (TREE_CODE (t) == VAR_DECL)
{
if (data != NULL && bitmap_clear_bit ((bitmap) data, DECL_UID (t)))
if (data != NULL && bitmap_clear_bit ((bitmap) data, DECL_UID (t))
&& DECL_CONTEXT (t) == current_function_decl)
mark_all_vars_used (&DECL_INITIAL (t), data);
set_is_used (t);
}
@ -836,7 +837,8 @@ remove_unused_locals (void)
if (TREE_CODE (var) == VAR_DECL
&& is_global_var (var)
&& var_ann (var) != NULL
&& is_used_p (var))
&& is_used_p (var)
&& DECL_CONTEXT (var) == current_function_decl)
mark_all_vars_used (&DECL_INITIAL (var), global_unused_vars);
num = VEC_length (tree, cfun->local_decls);