* cfglayout.c (fixup_fallthru_exit_predecesor): New static function.
(cfg_layout_finalize): Use it.
* bb-reorder.c (HAVE_epilogue): Remove.
(make_reorder_chain): Do not care special placement of
last basic block.
* predict.c (expected_value_to_br_prob): Delete the note
once transformed.
* c-decl.c (c_expand_body): Fix TV_EXPAND nesting problem;
measure integration time separately.
From-SVN: r47019
+Wed Nov 14 19:46:08 CET 2001 Jan Hubicka <jh@suse.cz>
+
+ * cfglayout.c (fixup_fallthru_exit_predecesor): New static function.
+ (cfg_layout_finalize): Use it.
+ * bb-reorder.c (HAVE_epilogue): Remove.
+ (make_reorder_chain): Do not care special placement of
+ last basic block.
+
+ * predict.c (expected_value_to_br_prob): Delete the note
+ once transformed.
+
+ * c-decl.c (c_expand_body): Fix TV_EXPAND nesting problem;
+ measure integration time separately.
+
Wed Nov 14 12:30:57 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* function.c (struct temp_slot): ALIGN now unsigned.
#include "output.h"
#include "cfglayout.h"
-#ifndef HAVE_epilogue
-#define HAVE_epilogue 0
-#endif
-
/* Local function prototypes. */
static void make_reorder_chain PARAMS ((void));
static basic_block make_reorder_chain_1 PARAMS ((basic_block, basic_block));
static void
make_reorder_chain ()
{
- basic_block last_block = NULL;
basic_block prev = NULL;
int nbb_m1 = n_basic_blocks - 1;
basic_block next;
- /* If we've not got epilogue in RTL, we must fallthru to the exit.
- Force the last block to be at the end. */
- /* ??? Some ABIs (e.g. MIPS) require the return insn to be at the
- end of the function for stack unwinding purposes. */
- if (! HAVE_epilogue)
- {
- last_block = BASIC_BLOCK (nbb_m1);
- RBI (last_block)->visited = 1;
- nbb_m1 -= 1;
- }
-
/* Loop until we've placed every block. */
do
{
prev = make_reorder_chain_1 (next, prev);
}
while (next);
-
- /* Terminate the chain. */
- if (! HAVE_epilogue)
- {
- RBI (prev)->next = last_block;
- prev = last_block;
- }
RBI (prev)->next = NULL;
}
if (flag_syntax_only)
return;
- timevar_push (TV_EXPAND);
-
if (flag_inline_trees)
{
/* First, cache whether the current function is inlinable. Some
predicates depend on cfun and current_function_decl to
function completely. */
+ timevar_push (TV_INTEGRATION);
uninlinable = ! tree_inlinable_function_p (fndecl);
if (! uninlinable && can_defer_p
{
/* Let the back-end know that this funtion exists. */
(*debug_hooks->deferred_inline_function) (fndecl);
+ timevar_pop (TV_INTEGRATION);
return;
}
/* Then, inline any functions called in it. */
optimize_inline_calls (fndecl);
+ timevar_pop (TV_INTEGRATION);
}
+ timevar_push (TV_EXPAND);
+
if (nested_p)
{
/* Make sure that we will evaluate variable-sized types involved
static rtx get_prev_bb_note PARAMS ((rtx));
void verify_insn_chain PARAMS ((void));
+static basic_block fixup_fallthru_exit_predecesor PARAMS ((void));
\f
/* Skip over inter-block insns occurring after BB which are typically
associated with BB (e.g., barriers). If there are any such insns,
abort ();
}
}
+
+/* The block falling trought to exit must be last in the reordered
+ chain. Make it happen so. */
+static basic_block
+fixup_fallthru_exit_predecesor ()
+{
+ edge e;
+ basic_block bb = NULL;
+
+ for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
+ if (e->flags & EDGE_FALLTHRU)
+ bb = e->src;
+ if (bb && RBI (bb)->next)
+ {
+ basic_block c = BASIC_BLOCK (0);
+ while (RBI (c)->next != bb)
+ c = RBI (c)->next;
+ RBI (c)->next = RBI (bb)->next;
+ while (RBI (c)->next)
+ c = RBI (c)->next;
+ RBI (c)->next = bb;
+ RBI (bb)->next = NULL;
+ }
+}
\f
/* Main entry point to this module - initialize the datastructures for
CFG layout changes. */
void
cfg_layout_finalize ()
{
+ fixup_fallthru_exit_predecesor ();
fixup_reorder_chain ();
#ifdef ENABLE_CHECKING
verify_insn_chain ();
{
ev = NOTE_EXPECTED_VALUE (insn);
ev_reg = XEXP (ev, 0);
+ delete_insn (insn);
}
continue;