Commit c28abdf0 by Richard Henderson Committed by Richard Henderson

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
parent ec6d4fa6
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.
......
......@@ -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
......
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
......
......@@ -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);
......
......@@ -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);
......
/* 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. */
......
......@@ -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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment