Bug 37726 - [4.4 Regression] Even at -O0 -g debuginfo for vars mentioned in nested fns is not emitted
Summary: [4.4 Regression] Even at -O0 -g debuginfo for vars mentioned in nested fns is...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-03 13:28 UTC by Jakub Jelinek
Modified: 2008-10-07 20:04 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-10-03 13:29:37


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2008-10-03 13:28:17 UTC
int foo (int parm)
{
  int var = 0;
  int bar (void)
  {
    return parm + var;
  }
  parm++;
  var++;
  return bar ();
}

int
main (void)
{
  return foo (4) - 6;
}

at -O0 -g this was perfectly debuggable in 4.3, but doesn't know anything about parm or var, neither in the outer nor inner function.
Comment 1 Jakub Jelinek 2008-10-03 18:57:01 UTC
Subject: Bug 37726

Author: jakub
Date: Fri Oct  3 18:55:39 2008
New Revision: 140857

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140857
Log:
	PR debug/37726
	* gimplify.c (declare_vars): Use gimple_bind_block instead of
	gimple_block.

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

Added:
    trunk/gcc/testsuite/gcc.dg/debug/dwarf2/pr37726.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/testsuite/ChangeLog

Comment 2 Jakub Jelinek 2008-10-03 19:35:21 UTC
Fixed.
Comment 3 Andrew Pinski 2008-10-07 20:04:23 UTC
This test does not work for darwin for some reason, I have not looked why though, I bet it is due to the way dwarf2 is outputted there.