diff options
author | Richard Henderson <rth@redhat.com> | 2002-01-05 19:51:13 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-01-05 19:51:13 -0800 |
commit | c28abdf00d60460c4f7e27edc7deb099ae91e8c1 (patch) | |
tree | b5435975138444886ee3c592973a8b7f20046641 | |
parent | ec6d4fa60cd144a5e5cd1c3bc5e38f630432fef5 (diff) | |
download | gcc-c28abdf00d60460c4f7e27edc7deb099ae91e8c1.zip gcc-c28abdf00d60460c4f7e27edc7deb099ae91e8c1.tar.gz gcc-c28abdf00d60460c4f7e27edc7deb099ae91e8c1.tar.bz2 |
c-decl.c (c_expand_body): Don't call outlining_inline_function.
* c-decl.c (c_expand_body): Don't call outlining_inline_function.
* integrate.c (output_inline_function): Likewise.
* toplev.c (rest_of_compilation): Do it here instead. Move call
to remove_unnecessary_notes after emitting abstract instance.
Force an emitted nested function to have its parent emited as well.
* dwarf2out.c (loc_descriptor_from_tree): Read mode after checking
for null.
(rtl_for_decl_location): Do not look at reload data structures
before reload has run.
* semantics.c (expand_body): Revert last change.
From-SVN: r48572
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/c-decl.c | 5 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 5 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 18 | ||||
-rw-r--r-- | gcc/integrate.c | 6 | ||||
-rw-r--r-- | gcc/toplev.c | 28 |
7 files changed, 55 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6746ed0..7a4adfc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2002-01-05 Richard Henderson <rth@redhat.com> + + * c-decl.c (c_expand_body): Don't call outlining_inline_function. + * integrate.c (output_inline_function): Likewise. + * toplev.c (rest_of_compilation): Do it here instead. Move call + to remove_unnecessary_notes after emitting abstract instance. + Force an emitted nested function to have its parent emited as well. + * dwarf2out.c (loc_descriptor_from_tree): Read mode after checking + for null. + (rtl_for_decl_location): Do not look at reload data structures + before reload has run. + 2002-01-05 Kazu Hirata <kazu@hxi.com> * cse.c: Fix formatting. diff --git a/gcc/c-decl.c b/gcc/c-decl.c index eb29b17..d6e8ac3 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6947,11 +6947,6 @@ c_expand_body (fndecl, nested_p, can_defer_p) timevar_push (TV_EXPAND); - if (DECL_INLINE (fndecl)) - /* Do any preparation such as emitting abstract debug info for the - inline before it gets mangled by optimization. */ - (*debug_hooks->outlining_inline_function) (fndecl); - if (nested_p) { /* Make sure that we will evaluate variable-sized types involved diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 591a882..d7fdc57 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2002-01-05 Richard Henderson <rth@redhat.com> + + * semantics.c (expand_body): Revert last change. + 2002-01-04 Jason Merrill <jason@redhat.com> * class.c (update_vtable_entry_for_fn): Set delta to zero for a diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 06c1ac2..f17019c 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2503,11 +2503,6 @@ expand_body (fn) recorded when we finished processing the function. */ lineno = STMT_LINENO (DECL_SAVED_TREE (fn)); - if (DECL_INLINE (fn)) - /* Do any preparation such as emitting abstract debug info for the - inline before it gets mangled by optimization. */ - (*debug_hooks->outlining_inline_function) (fn); - /* Generate code for the function. */ genrtl_finish_function (fn); diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 4a94154..3c11484 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -7968,7 +7968,6 @@ loc_descriptor_from_tree (loc, addressp) case PARM_DECL: { rtx rtl = rtl_for_decl_location (loc); - enum machine_mode mode = GET_MODE (rtl); if (rtl == NULL_RTX) return 0; @@ -7981,6 +7980,8 @@ loc_descriptor_from_tree (loc, addressp) } else { + enum machine_mode mode = GET_MODE (rtl); + if (GET_CODE (rtl) == MEM) { indirect_p = 1; @@ -8751,7 +8752,18 @@ rtl_for_decl_location (decl) /* Use DECL_RTL as the "location" unless we find something better. */ rtl = DECL_RTL_IF_SET (decl); - if (TREE_CODE (decl) == PARM_DECL) + /* When generating abstract instances, ignore everything except + constants and symbols living in memory. */ + if (! reload_completed) + { + if (rtl + && (CONSTANT_P (rtl) + || (GET_CODE (rtl) == MEM + && CONSTANT_P (XEXP (rtl, 0))))) + return rtl; + rtl = NULL_RTX; + } + else if (TREE_CODE (decl) == PARM_DECL) { if (rtl == NULL_RTX || is_pseudo_reg (rtl)) { @@ -8816,7 +8828,7 @@ rtl_for_decl_location (decl) /* A variable with no DECL_RTL but a DECL_INITIAL is a compile-time constant, and will have been substituted directly into all expressions that use it. C does not have such a concept, but C++ and other languages do. */ - else if (DECL_INITIAL (decl)) + else if (TREE_CODE (decl) == VAR_DECL && DECL_INITIAL (decl)) rtl = expand_expr (DECL_INITIAL (decl), NULL_RTX, VOIDmode, EXPAND_INITIALIZER); diff --git a/gcc/integrate.c b/gcc/integrate.c index 9143e0e..0571756 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -1,6 +1,6 @@ /* Procedure integration for GCC. Copyright (C) 1988, 1991, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -2950,10 +2950,6 @@ output_inline_function (fndecl) debug_hooks = &do_nothing_debug_hooks; } - /* Do any preparation, such as emitting abstract debug info for the inline - before it gets mangled by optimization. */ - (*debug_hooks->outlining_inline_function) (fndecl); - /* Compile this function all the way down to assembly code. As a side effect this destroys the saved RTL representation, but that's okay, because we don't need to inline this anymore. */ diff --git a/gcc/toplev.c b/gcc/toplev.c index 02e6bef..6105426 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2363,11 +2363,6 @@ rest_of_compilation (decl) if (!cfun->x_whole_function_mode_p) identify_blocks (); - /* Then remove any notes we don't need. That will make iterating - over the instruction sequence faster, and allow the garbage - collector to reclaim the memory used by the notes. */ - remove_unnecessary_notes (); - /* In function-at-a-time mode, we do not attempt to keep the BLOCK tree in sensible shape. So, we just recalculate it here. */ if (cfun->x_whole_function_mode_p) @@ -2505,6 +2500,29 @@ rest_of_compilation (decl) goto exit_rest_of_compilation; } + /* If we're emitting a nested function, make sure its parent gets + emitted as well. Doing otherwise confuses debug info. */ + { + tree parent; + for (parent = DECL_CONTEXT (current_function_decl); + parent != NULL_TREE; + parent = get_containing_scope (parent)) + if (TREE_CODE (parent) == FUNCTION_DECL) + TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (parent)) = 1; + } + + /* We are now committed to emitting code for this function. Do any + preparation, such as emitting abstract debug info for the inline + before it gets mangled by optimization. */ + if (DECL_INLINE (decl)) + (*debug_hooks->outlining_inline_function) (decl); + + /* Remove any notes we don't need. That will make iterating + over the instruction sequence faster, and allow the garbage + collector to reclaim the memory used by the notes. */ + remove_unnecessary_notes (); + reorder_blocks (); + ggc_collect (); /* Initialize some variables used by the optimizers. */ |