+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
--- /dev/null
+/* { 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__};
+}
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);
}
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);