re PR debug/39379 (DW_TAG_imported* no longer emitted)

PR debug/39379
	* tree-cfg.c (remove_useless_stmts_bind): Don't remove GIMPLE_BINDs
	with blocks containing IMPORTED_DECLs in BLOCK_VARS.

	* g++.dg/debug/dwarf2/imported-module-3.C: New test.
	* g++.dg/debug/dwarf2/imported-module-4.C: New test.

From-SVN: r144640
This commit is contained in:
Jakub Jelinek 2009-03-05 13:50:36 +01:00 committed by Jakub Jelinek
parent 6c6094f12f
commit ee0ee7e2c1
5 changed files with 65 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2009-03-05 Jakub Jelinek <jakub@redhat.com>
PR debug/39379
* tree-cfg.c (remove_useless_stmts_bind): Don't remove GIMPLE_BINDs
with blocks containing IMPORTED_DECLs in BLOCK_VARS.
2009-03-05 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (R8_REG, R9_REG): New constants.

View file

@ -1,3 +1,9 @@
2009-03-05 Jakub Jelinek <jakub@redhat.com>
PR debug/39379
* g++.dg/debug/dwarf2/imported-module-3.C: New test.
* g++.dg/debug/dwarf2/imported-module-4.C: New test.
2009-03-04 Jason Merrill <jason@redhat.com>
PR c++/13549

View file

@ -0,0 +1,17 @@
// PR debug/39379
// { dg-do compile }
// { dg-options "-g -dA" }
// { dg-final { scan-assembler "DW_TAG_imported" } }
namespace A
{
int v;
}
int
main ()
{
using namespace A;
v++;
return v - 1;
}

View file

@ -0,0 +1,21 @@
// PR debug/39379
// { dg-do compile }
// { dg-options "-g -dA" }
// { dg-final { scan-assembler "DW_TAG_imported" } }
namespace A
{
int v;
}
int
f ()
{
int i;
{
using namespace A;
v++;
i = v - 1;
}
return i;
}

View file

@ -1796,9 +1796,21 @@ remove_useless_stmts_bind (gimple_stmt_iterator *gsi, struct rus_data *data ATTR
|| (TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block))
!= FUNCTION_DECL)))
{
gsi_insert_seq_before (gsi, body_seq, GSI_SAME_STMT);
gsi_remove (gsi, false);
data->repeat = true;
tree var = NULL_TREE;
/* Even if there are no gimple_bind_vars, there might be other
decls in BLOCK_VARS rendering the GIMPLE_BIND not useless. */
if (block)
for (var = BLOCK_VARS (block); var; var = TREE_CHAIN (var))
if (TREE_CODE (var) == IMPORTED_DECL)
break;
if (var)
gsi_next (gsi);
else
{
gsi_insert_seq_before (gsi, body_seq, GSI_SAME_STMT);
gsi_remove (gsi, false);
data->repeat = true;
}
}
else
gsi_next (gsi);