OSDN Git Service

PR debug/39471
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Mar 2009 17:49:28 +0000 (17:49 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Mar 2009 17:49:28 +0000 (17:49 +0000)
* dwarf2out.c (dwarf2out_imported_module_or_decl_1): Emit
DW_TAG_imported_module even if decl is IMPORTED_DECL with
NAMESPACE_DECL in its DECL_INITIAL.

* cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
on IMPORTED_DECL.

* g++.dg/debug/dwarf2/imported-module-2.C: Expect
DW_TAG_imported_module, not just any DW_TAG_imported prefixed tag.
* g++.dg/debug/dwarf2/imported-module-3.C: Likewise.
* g++.dg/debug/dwarf2/imported-module-4.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144911 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C
gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C

index 7af0db0..f758952 100644 (file)
@@ -1,5 +1,10 @@
 2009-03-17  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/39471
+       * dwarf2out.c (dwarf2out_imported_module_or_decl_1): Emit
+       DW_TAG_imported_module even if decl is IMPORTED_DECL with
+       NAMESPACE_DECL in its DECL_INITIAL.
+
        PR middle-end/39443
        * optabs.c (set_user_assembler_libfunc): New function.
        * expr.h (set_user_assembler_libfunc): New prototype.
index e4161c5..b015dfa 100644 (file)
@@ -1,3 +1,9 @@
+2009-03-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/39471
+       * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
+       on IMPORTED_DECL.
+
 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/39371
index 838a9d6..12d632b 100644 (file)
@@ -593,8 +593,6 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
 
          IMPORTED_DECL_ASSOCIATED_DECL (using_directive)
            = TREE_OPERAND (*expr_p, 0);
-         DECL_NAME (using_directive)
-           = DECL_NAME (TREE_OPERAND (*expr_p, 0));
          TREE_CHAIN (using_directive) = BLOCK_VARS (block);
          BLOCK_VARS (block) = using_directive;
        }
index 6711777..79651e1 100644 (file)
@@ -15380,12 +15380,11 @@ dwarf2out_imported_module_or_decl_1 (tree decl,
     }
   else if (TREE_CODE (decl) == IMPORTED_DECL)
     {
-      tree imported_ns_decl;
+      tree imported_ns_decl = IMPORTED_DECL_ASSOCIATED_DECL (decl);
       /* IMPORTED_DECL nodes that are not imported namespace are just not
          supported yet.  */
-      gcc_assert (DECL_INITIAL (decl)
-                 && TREE_CODE (DECL_INITIAL (decl)) == NAMESPACE_DECL);
-      imported_ns_decl = DECL_INITIAL (decl);
+      gcc_assert (imported_ns_decl
+                 && TREE_CODE (imported_ns_decl) == NAMESPACE_DECL);
       at_import_die = lookup_decl_die (imported_ns_decl);
       if (!at_import_die)
        at_import_die = force_decl_die (imported_ns_decl);
@@ -15414,7 +15413,10 @@ dwarf2out_imported_module_or_decl_1 (tree decl,
        }
     }
 
-  if (TREE_CODE (decl) == NAMESPACE_DECL)
+  if (TREE_CODE (decl) == NAMESPACE_DECL
+      || (TREE_CODE (decl) == IMPORTED_DECL
+         && (TREE_CODE (IMPORTED_DECL_ASSOCIATED_DECL (decl))
+             == NAMESPACE_DECL)))
     imported_die = new_die (DW_TAG_imported_module,
                            lexical_block_die,
                            lexical_block);
index ae361a5..5c34253 100644 (file)
@@ -1,5 +1,11 @@
 2009-03-17  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/39471
+       * g++.dg/debug/dwarf2/imported-module-2.C: Expect
+       DW_TAG_imported_module, not just any DW_TAG_imported prefixed tag.
+       * g++.dg/debug/dwarf2/imported-module-3.C: Likewise.
+       * g++.dg/debug/dwarf2/imported-module-4.C: Likewise.
+
        PR middle-end/39443
        * gcc.dg/pr39443.c: New test.
 
index 8612897..9a4821a 100644 (file)
@@ -2,7 +2,7 @@
 // Origin: PR debug/38390
 // { dg-do compile  }
 // { dg-options "-g -dA" }
-// { dg-final { scan-assembler "DW_TAG_imported" }  }
+// { dg-final { scan-assembler "DW_TAG_imported_module" }  }
 
 namespace A
 {
index d62a506..9559bcb 100644 (file)
@@ -1,7 +1,7 @@
 // PR debug/39379
 // { dg-do compile }
 // { dg-options "-g -dA" }
-// { dg-final { scan-assembler "DW_TAG_imported" }  }
+// { dg-final { scan-assembler "DW_TAG_imported_module" }  }
 
 namespace A
 {
index 6e9b52e..7ac6bab 100644 (file)
@@ -1,7 +1,7 @@
 // PR debug/39379
 // { dg-do compile }
 // { dg-options "-g -dA" }
-// { dg-final { scan-assembler "DW_TAG_imported" }  }
+// { dg-final { scan-assembler "DW_TAG_imported_module" }  }
 
 namespace A
 {