re PR debug/55665 (Missing DW_TAG_lexical_block PC range)
authorJakub Jelinek <jakub@redhat.com>
Wed, 12 Dec 2012 23:19:32 +0000 (00:19 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 12 Dec 2012 23:19:32 +0000 (00:19 +0100)
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.

* g++.dg/guality/pr55665.C: New test.

From-SVN: r194461

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/guality/pr55665.C [new file with mode: 0644]
gcc/tree-inline.c

index 5d5dbe0b321d9de360ca10c16e330fdffc2e7f30..bb26702a60f8de33c620dd9db6c18ef61f27c224 100644 (file)
@@ -1,5 +1,10 @@
 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.
index 80981f6d60b65cdc4958037d653c981a42f99726..e9b645db24b221dfb25497a9a6992aba87a5a0a2 100644 (file)
@@ -1,5 +1,8 @@
 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.
diff --git a/gcc/testsuite/g++.dg/guality/pr55665.C b/gcc/testsuite/g++.dg/guality/pr55665.C
new file mode 100644 (file)
index 0000000..16c6d28
--- /dev/null
@@ -0,0 +1,33 @@
+// 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 ();
+}
index a06d7b92a3ca0f1fe05da7434d775db978e5103f..70aa56755cb8e9d8076cdee871d36a0186455584 100644 (file)
@@ -536,7 +536,7 @@ can_be_nonlocal (tree decl, copy_body_data *id)
 }
 
 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;
@@ -557,7 +557,7 @@ remap_decls (tree decls, vec<tree, va_gc> *nonlocalized_list,
          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;
        }
 
@@ -575,7 +575,7 @@ remap_decls (tree decls, vec<tree, va_gc> *nonlocalized_list,
          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
        {
@@ -622,7 +622,7 @@ remap_block (tree *block, copy_body_data *id)
 
   /* 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)