re PR debug/37726 (Even at -O0 -g debuginfo for vars mentioned in nested fns is not emitted)

PR debug/37726
	* gimplify.c (declare_vars): Use gimple_bind_block instead of
	gimple_block.

	* gcc.dg/debug/dwarf2/pr37726.c: New test.

From-SVN: r140857
This commit is contained in:
Jakub Jelinek 2008-10-03 20:55:39 +02:00 committed by Jakub Jelinek
parent 4d4e036d31
commit 524d9a4532
4 changed files with 37 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2008-10-03 Jakub Jelinek <jakub@redhat.com>
PR debug/37726
* gimplify.c (declare_vars): Use gimple_bind_block instead of
gimple_block.
2008-10-03 Pascal Obry <obry@adacore.com>
* gcov.c (create_file_names): Properly handle UNIX and DOS

View file

@ -772,7 +772,7 @@ declare_vars (tree vars, gimple scope, bool debug_info)
temps = nreverse (last);
block = gimple_block (scope);
block = gimple_bind_block (scope);
gcc_assert (!block || TREE_CODE (block) == BLOCK);
if (!block || !debug_info)
{

View file

@ -1,3 +1,8 @@
2008-10-03 Jakub Jelinek <jakub@redhat.com>
PR debug/37726
* gcc.dg/debug/dwarf2/pr37726.c: New test.
2008-10-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/37719

View file

@ -0,0 +1,25 @@
/* PR debug/37726 */
/* { dg-do compile } */
/* { dg-options "-g -O0 -dA -fno-merge-debug-strings" } */
int foo (int parm)
{
int var = 0;
int bar (void)
{
return parm + var;
}
parm++;
var++;
return bar ();
}
int
main (void)
{
return foo (4) - 6;
}
/* Both parm and var variables should be in debug info for both foo and bar. */
/* { dg-final { scan-assembler-times "\"parm\[^\n\]*\"\[^\n\]*DW_AT_name" 2 } } */
/* { dg-final { scan-assembler-times "\"var\[^\n\]*\"\[^\n\]*DW_AT_name" 2 } } */