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:
parent
4d4e036d31
commit
524d9a4532
4 changed files with 37 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
25
gcc/testsuite/gcc.dg/debug/dwarf2/pr37726.c
Normal file
25
gcc/testsuite/gcc.dg/debug/dwarf2/pr37726.c
Normal 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 } } */
|
Loading…
Add table
Reference in a new issue