From: Jan Hubicka Date: Sun, 1 Mar 2009 11:05:00 +0000 (+0100) Subject: * tree-inline.c (tree_function_versioning): Output debug info. X-Git-Tag: releases/gcc-4.4.0~402 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3aadcc56b098c6475836ad61e82e057275684cf;p=thirdparty%2Fgcc.git * tree-inline.c (tree_function_versioning): Output debug info. From-SVN: r144516 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dba3b12a0241..15618084f2a0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2009-02-28 Jan Hubicka + + * tree-inline.c (tree_function_versioning): Output debug info. + 2009-02-28 Jan Hubicka PR debug/39267 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c6b8017d6c3c..b1afa603960b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-03-01 Jan Hubicka + + * gcc.dg/debug/dwarf2/ipa-cp1.c: New testcase. + 2009-03-01 Jan Hubicka PR debug/39267 diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/ipa-cp1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/ipa-cp1.c new file mode 100644 index 000000000000..7442dab19f9a --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/ipa-cp1.c @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -gdwarf-2 -dA" } */ +void q(int p); +static void +t(int constant_propagated_par) +{ + int local_var = constant_propagated_par + 1; + q(local_var); + q(local_var); + q(local_var); + q(local_var); + q(local_var); + q(local_var); + q(local_var); + q(local_var); + q(local_var); + q(local_var); + q(local_var); +} +main() +{ + t(5); + t(5); + t(5); + t(5); + t(5); + t(5); + t(5); +} +/* { dg-final { scan-assembler "local_var" } } */ diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 65d5b88a9ce8..8ff784abd484 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4226,6 +4226,12 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map, old_version_node = cgraph_node (old_decl); new_version_node = cgraph_node (new_decl); + /* Output the inlining info for this abstract function, since it has been + inlined. If we don't do this now, we can lose the information about the + variables in the function when the blocks get blown away as soon as we + remove the cgraph node. */ + (*debug_hooks->outlining_inline_function) (old_decl); + DECL_ARTIFICIAL (new_decl) = 1; DECL_ABSTRACT_ORIGIN (new_decl) = DECL_ORIGIN (old_decl);