diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-03-19 05:26:48 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-03-19 05:26:48 +0000 |
commit | f1ab82bec0bcd2973783a648a073f6c65dc31985 (patch) | |
tree | 7e5085f497fa4f8351b62a15342abb5192c649b0 /gcc/function.c | |
parent | ad63a0fca1c16a7b56f4f29888a87ee535cb9f4c (diff) | |
download | gcc-f1ab82bec0bcd2973783a648a073f6c65dc31985.tar.gz |
* emit-rtl.c (remove_unncessary_notes): Check that all
NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes have an
associated NOTE_BLOCK.
* function.h (identify_blocks): Update comments.
(reorder_blocks): Declare.
* function.c (identify_blocks): Don't take paramters.
(reorder_blocks): Don't take parameters.
* loop.h (find_loop_tree_blocks): Remove.
(unroll_block_trees): Likewise.
* loop.c (loop_optimize): Don't call find_loop_tree_blocks. Use
reorder_blocks instead of unroll_block_trees.h
* sibcall.c (optimize_sibling_and_tail_recursive_calls): Likewise.
* stmt.c (find_loop_tree_blocks): Remove.
(unroll_block_trees): Likewise.
* toplev.c (rest_of_compilation): Don't call find_loop_tree_blocks
in whole-function mode.
* tree.h (reorder_blocks): Remove declaration.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32632 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/gcc/function.c b/gcc/function.c index dfd87618396..e994558fdc8 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5508,11 +5508,6 @@ round_trampoline_addr (tramp) return tramp; } -/* The functions identify_blocks and reorder_blocks provide a way to - reorder the tree of BLOCK nodes, for optimizers that reshuffle or - duplicate portions of the RTL code. Call identify_blocks before - changing the RTL, and call reorder_blocks after. */ - /* Put all this function's BLOCK nodes including those that are chained onto the first block into a vector, and return it. Also store in each NOTE for the beginning or end of a block @@ -5521,13 +5516,12 @@ round_trampoline_addr (tramp) and INSNS, the insn chain of the function. */ void -identify_blocks (block, insns) - tree block; - rtx insns; +identify_blocks () { int n_blocks; tree *block_vector, *last_block_vector; tree *block_stack; + tree block = DECL_INITIAL (current_function_decl); if (block == 0) return; @@ -5537,8 +5531,10 @@ identify_blocks (block, insns) block_vector = get_block_vector (block, &n_blocks); block_stack = (tree *) xmalloc (n_blocks * sizeof (tree)); - last_block_vector = identify_blocks_1 (insns, block_vector + 1, - block_vector + n_blocks, block_stack); + last_block_vector = identify_blocks_1 (get_insns (), + block_vector + 1, + block_vector + n_blocks, + block_stack); /* If we didn't use all of the subblocks, we've misplaced block notes. */ /* ??? This appears to happen all the time. Latent bugs elsewhere? */ @@ -5616,36 +5612,30 @@ identify_blocks_1 (insns, block_vector, end_block_vector, orig_block_stack) return block_vector; } -/* Given a revised instruction chain, rebuild the tree structure of - BLOCK nodes to correspond to the new order of RTL. The new block - tree is inserted below TOP_BLOCK. Returns the current top-level - block. */ +/* Identify BLOCKs referenced by more than one + NOTE_INSN_BLOCK_{BEG,END}, and create duplicate blocks. */ -tree -reorder_blocks (block, insns) - tree block; - rtx insns; +void +reorder_blocks () { - tree current_block = block; + tree block = DECL_INITIAL (current_function_decl); varray_type block_stack; if (block == NULL_TREE) - return NULL_TREE; + return; VARRAY_TREE_INIT (block_stack, 10, "block_stack"); - /* Prune the old trees away, so that it doesn't get in the way. */ - BLOCK_SUBBLOCKS (current_block) = 0; - BLOCK_CHAIN (current_block) = 0; + /* Prune the old trees away, so that they don't get in the way. */ + BLOCK_SUBBLOCKS (block) = NULL_TREE; + BLOCK_CHAIN (block) = NULL_TREE; - reorder_blocks_1 (insns, current_block, &block_stack); + reorder_blocks_1 (get_insns (), block, &block_stack); - BLOCK_SUBBLOCKS (current_block) - = blocks_nreverse (BLOCK_SUBBLOCKS (current_block)); + BLOCK_SUBBLOCKS (block) + = blocks_nreverse (BLOCK_SUBBLOCKS (block)); VARRAY_FREE (block_stack); - - return current_block; } /* Helper function for reorder_blocks. Process the insn chain beginning |