aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-03-17 18:49:28 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-03-17 18:49:28 +0100
commita3f596ba3de6975109c5d3d5900a1693cfebb96d (patch)
tree10fca5d7225e35a93769e3b741ec499d6757e765 /gcc
parent6b2b88712792698e1348e585ab91fa8518a250f0 (diff)
downloadgcc-a3f596ba3de6975109c5d3d5900a1693cfebb96d.zip
gcc-a3f596ba3de6975109c5d3d5900a1693cfebb96d.tar.gz
gcc-a3f596ba3de6975109c5d3d5900a1693cfebb96d.tar.bz2
re PR debug/39471 (DW_TAG_imported_module should be used (not DW_TAG_imported_declaration))
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. * 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. From-SVN: r144911
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/cp-gimplify.c2
-rw-r--r--gcc/dwarf2out.c12
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C2
8 files changed, 27 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7af0db0..f758952 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e4161c5..b015dfa 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 838a9d6..12d632b 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -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;
}
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 6711777..79651e1 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ae361a5..5c34253 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
index 8612897..9a4821a 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-2.C
@@ -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
{
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C
index d62a506..9559bcb 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-3.C
@@ -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
{
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C
index 6e9b52e..7ac6bab 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/imported-module-4.C
@@ -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
{