Commit f14c4356 by Michael Matz Committed by Michael Matz

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
parent d846e425
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
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
......
/* { 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__};
}
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment