2012-12-12 Jakub Jelinek <jakub@redhat.com>
+ PR debug/55665
+ * tree-inline.c (remap_decls): Change nonlocalized_list
+ to pointer to pointer to vector from pointer to vector.
+ (remap_block): Pass address of BLOCK_NONLOCALIZED_VARS.
+
PR sanitizer/55508
* builtin-attrs.def (ATTR_TMPURE_NOTHROW_LEAF_LIST,
ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST): New.
2012-12-12 Jakub Jelinek <jakub@redhat.com>
+ PR debug/55665
+ * g++.dg/guality/pr55665.C: New test.
+
* lib/gcc-dg.exp (${tool}_load): Handle non-existing
set_target_env_var the same as if it is empty list.
(dg-set-target-env-var): Fix up error message.
--- /dev/null
+// PR debug/55655
+// { dg-do run }
+// { dg-options "-g" }
+
+extern "C" void abort ();
+struct A { A (int); int a; };
+
+__attribute__((noinline, noclone)) int
+bar (void)
+{
+ return 40;
+}
+
+__attribute__((noinline, noclone)) void
+foo (int x)
+{
+ __asm volatile ("" : : "r" (x) : "memory");
+}
+
+A::A (int x)
+{
+ static int p = bar ();
+ foo (p); // { dg-final { gdb-test 23 "p" "40" } }
+ a = ++p;
+}
+
+int
+main ()
+{
+ A a (42);
+ if (a.a != 41)
+ abort ();
+}
}
static tree
-remap_decls (tree decls, vec<tree, va_gc> *nonlocalized_list,
+remap_decls (tree decls, vec<tree, va_gc> **nonlocalized_list,
copy_body_data *id)
{
tree old_var;
if ((!optimize || debug_info_level > DINFO_LEVEL_TERSE)
&& !DECL_IGNORED_P (old_var)
&& nonlocalized_list)
- vec_safe_push (nonlocalized_list, old_var);
+ vec_safe_push (*nonlocalized_list, old_var);
continue;
}
if ((!optimize || debug_info_level > DINFO_LEVEL_TERSE)
&& !DECL_IGNORED_P (old_var)
&& nonlocalized_list)
- vec_safe_push (nonlocalized_list, old_var);
+ vec_safe_push (*nonlocalized_list, old_var);
}
else
{
/* Remap its variables. */
BLOCK_VARS (new_block) = remap_decls (BLOCK_VARS (old_block),
- BLOCK_NONLOCALIZED_VARS (new_block),
+ &BLOCK_NONLOCALIZED_VARS (new_block),
id);
if (id->transform_lang_insert_block)