summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorJason Merrill <jason@casey.cygnus.com>2000-04-26 00:36:56 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-04-25 20:36:56 -0400
commit1cfdcc15effc096604f32fb88ddc1ad8f67aab07 (patch)
tree86eb94bf7bf8baa171b95fd2c33f84eafa1c186c /gcc/dwarf2out.c
parentd25ed420a21ee1692ab894f53effeb3a0eac0207 (diff)
downloadgcc-1cfdcc15effc096604f32fb88ddc1ad8f67aab07.tar.gz
dwarf2out.c (add_bound_info): Don't crash on an unexpanded SAVE_EXPR.
* dwarf2out.c (add_bound_info): Don't crash on an unexpanded SAVE_EXPR. * dwarfout.c (output_decl): Ignore NAMESPACE_DECLs. * dwarf2out.c (gen_subprogram_die): The class-scope declaration DIE is the primary DIE for a member function. (gen_decl_die): Call set_decl_origin_self here. * dwarfout.c (output_decl): And here. * integrate.c (output_inline_function): Not here. Don't clear DECL_INLINE until after calling rest_of_compilation. (set_decl_origin_self): No longer static. * tree.h: Add prototype. * toplev.c (note_deferral_of_defined_inline_function): Only write out abstract instance for actual inlines. * cp/decl.c (finish_function): Don't play games with DECL_INLINE. From-SVN: r33430
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index d5807877a70..79bffccce90 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -7119,7 +7119,8 @@ add_bound_info (subrange_die, bound_attr, bound)
We assume that a MEM rtx is safe because gcc wouldn't put the
value there unless it was going to be used repeatedly in the
function, i.e. for cleanups. */
- if (! optimize || GET_CODE (SAVE_EXPR_RTL (bound)) == MEM)
+ if (! optimize || (SAVE_EXPR_RTL (bound)
+ && GET_CODE (SAVE_EXPR_RTL (bound)) == MEM))
{
register dw_die_ref ctx = lookup_decl_die (current_function_decl);
register dw_die_ref decl_die = new_die (DW_TAG_variable, ctx);
@@ -8006,12 +8007,7 @@ gen_unspecified_parameters_die (decl_or_type, context_die)
/* Generate a list of nameless DW_TAG_formal_parameter DIEs (and perhaps a
DW_TAG_unspecified_parameters DIE) to represent the types of the formal
parameters as specified in some function type specification (except for
- those which appear as part of a function *definition*).
-
- Note we must be careful here to output all of the parameter DIEs before*
- we output any DIEs needed to represent the types of the formal parameters.
- This keeps svr4 SDB happy because it (incorrectly) thinks that the first
- non-parameter DIE it sees ends the formal parameter list. */
+ those which appear as part of a function *definition*). */
static void
gen_formal_types_die (function_or_method_type, context_die)
@@ -8151,6 +8147,14 @@ gen_subprogram_die (decl, context_die)
case, `declaration' takes priority; we'll get back to the abstract
instance when we're done with the class. */
+ /* The class-scope declaration DIE must be the primary DIE. */
+ if (origin && declaration && class_scope_p (context_die))
+ {
+ origin = NULL;
+ if (old_die)
+ abort ();
+ }
+
if (origin != NULL)
{
if (declaration && ! local_scope_p (context_die))
@@ -9322,10 +9326,14 @@ gen_decl_die (decl, context_die)
&& (current_function_decl == NULL_TREE || DECL_ARTIFICIAL (decl)))
break;
- /* Emit info for the abstract instance first, if we haven't yet. */
- origin = decl_ultimate_origin (decl);
- if (origin)
- gen_abstract_function (origin);
+ /* 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. */
+ if (DECL_INLINE (decl) && ! DECL_ABSTRACT (decl)
+ && ! class_scope_p (context_die))
+ {
+ gen_abstract_function (decl);
+ set_decl_origin_self (decl);
+ }
if (debug_info_level > DINFO_LEVEL_TERSE)
{