diff options
author | Jan Hubicka <jh@suse.cz> | 2003-10-22 13:58:10 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2003-10-22 11:58:10 +0000 |
commit | 1bb17c2144248180a1b00f5e5e6cf607fba0d46c (patch) | |
tree | 9d18905bfe933c3bc24bcf7b89cb85d08790b337 /gcc/dwarf2out.c | |
parent | e97c30aaa713e64309e3c0df2592f56e2a26e70e (diff) | |
download | gcc-1bb17c2144248180a1b00f5e5e6cf607fba0d46c.zip gcc-1bb17c2144248180a1b00f5e5e6cf607fba0d46c.tar.gz gcc-1bb17c2144248180a1b00f5e5e6cf607fba0d46c.tar.bz2 |
re PR debug/12389 ([testcase needed] ICE in gen_subprogram_die for nested function)
PR debug/12389
* Makefile.in (dwarf2out.o): Depend on cgraph.h.
* cgraph.c (cgraph_function_possibly_inlined_p): New function.
* cgraph.h (cgraph_function_possibly_inlined_p): Declare.
(cgraph_global_info): Add flag inlined
* dwarf2out.c (gen_subprogram_die, gen_decl_die): Use
cgraph_function_possibly_inded_p
* cgraphunit.c (mark_inline): Set inlined flag.
* toplev.c (rest_of_decl_compilation): Call outlining_inline_function
only for possibly inlined functions.
* c-decl.c (duplicate_decls): Never output abstract DIE representing old
body of function.
From-SVN: r72795
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 2642e81..32b9332 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -64,6 +64,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "target.h" #include "langhooks.h" #include "hashtab.h" +#include "cgraph.h" #ifdef DWARF2_DEBUGGING_INFO static void dwarf2out_source_line (unsigned int, const char *); @@ -10685,20 +10686,20 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) } else if (DECL_ABSTRACT (decl)) { - if (DECL_INLINE (decl) && !flag_no_inline) + if (DECL_DECLARED_INLINE_P (decl)) { - /* ??? Checking DECL_DEFER_OUTPUT is correct for static - inline functions, but not for extern inline functions. - We can't get this completely correct because information - about whether the function was declared inline is not - saved anywhere. */ - if (DECL_DEFER_OUTPUT (decl)) + if (cgraph_function_possibly_inlined_p (decl)) add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_declared_inlined); else - add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_inlined); + add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_declared_not_inlined); } else - add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_declared_not_inlined); + { + if (cgraph_function_possibly_inlined_p (decl)) + add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_inlined); + else + abort (); + } equate_decl_number_to_die (decl, subr_die); } @@ -11800,7 +11801,8 @@ gen_decl_die (tree decl, dw_die_ref context_die) /* If we're emitting an out-of-line copy of an inline function, emit info for the abstract instance and set up to refer to it. */ - else if (DECL_INLINE (decl) && ! DECL_ABSTRACT (decl) + else if (cgraph_function_possibly_inlined_p (decl) + && ! DECL_ABSTRACT (decl) && ! class_scope_p (context_die) /* dwarf2out_abstract_function won't emit a die if this is just a declaration. We must avoid setting DECL_ABSTRACT_ORIGIN in |