aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2008-11-12 21:57:44 +0000
committerDodji Seketeli <dodji@gcc.gnu.org>2008-11-12 22:57:44 +0100
commit6b20f353f6c35385c5e473672ed373e4470df908 (patch)
tree4bc0a17b6a59171e39ad721b6863cf81bef60b30 /gcc/final.c
parentac12508218a55bb3a9973b2f57ecea0003e995e3 (diff)
downloadgcc-6b20f353f6c35385c5e473672ed373e4470df908.zip
gcc-6b20f353f6c35385c5e473672ed373e4470df908.tar.gz
gcc-6b20f353f6c35385c5e473672ed373e4470df908.tar.bz2
re PR debug/27574 (MIssing debug info at -O0 for a local variable in a C++ constructor)
gcc/ChangeLog: 2008-11-12 Dodji Seketeli <dodji@redhat.com> PR debug/27574 * cgraph.h: New abstract_and_needed member to struct cgraph_node. * cgraphunit.c (cgraph_analyze_functions): Flag abstract functions - which clones are reachable - as "abstract and needed". * cgraph.c (cgraph_release_function_body): If a node is "abstract and needed", do not release its DECL_INITIAL() content because that will be needed to emit debug info. gcc/testsuite/ChangeLog: 2008-11-12 Dodji Seketeli <dodji@redhat.com> PR debug/27574 * g++.dg/debug/dwarf2/local-var-in-contructor.C: New test. From-SVN: r141807
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/final.c b/gcc/final.c
index e2d9e5a..d007907 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -4187,6 +4187,10 @@ rest_of_handle_final (void)
timevar_push (TV_SYMOUT);
(*debug_hooks->function_decl) (current_function_decl);
timevar_pop (TV_SYMOUT);
+
+ /* Release the blocks that are linked to DECL_INITIAL() to free the memory. */
+ DECL_INITIAL (current_function_decl) = error_mark_node;
+
if (DECL_STATIC_CONSTRUCTOR (current_function_decl)
&& targetm.have_ctors_dtors)
targetm.asm_out.constructor (XEXP (DECL_RTL (current_function_decl), 0),