mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-22 16:19:48 +08:00
basic-block.h (purge_all_dead_edges): Add update_life_p argument.
* basic-block.h (purge_all_dead_edges): Add update_life_p argument. * cfgcleanup.c (merge_blocks): Update the life flag after merging; fix warning. * cfgrtl.c (purge_all_dead_edges): Allow updating of liveness. (life_analysis): call purge_all_dead_edges after deleting noops. (delete_noop_move): Do not purge CFG. * toplev.c (rest_of_compilation): Update purge_all_dead_edges call. From-SVN: r46605
This commit is contained in:
parent
4fdaa8786f
commit
473fb060f3
@ -1,3 +1,13 @@
|
||||
Mon Oct 29 12:43:06 CET 2001 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* basic-block.h (purge_all_dead_edges): Add update_life_p argument.
|
||||
* cfgcleanup.c (merge_blocks): Update the life flag after merging;
|
||||
fix warning.
|
||||
* cfgrtl.c (purge_all_dead_edges): Allow updating of liveness.
|
||||
(life_analysis): call purge_all_dead_edges after deleting noops.
|
||||
(delete_noop_move): Do not purge CFG.
|
||||
* toplev.c (rest_of_compilation): Update purge_all_dead_edges call.
|
||||
|
||||
2001-10-28 David Edelsohn <edelsohn@gnu.org>
|
||||
|
||||
* config/rs6000/aix31.h (ASM_OUTPUT_EXTERNAL): Use assemble_name.
|
||||
|
@ -638,7 +638,7 @@ extern basic_block force_nonfallthru PARAMS ((edge));
|
||||
extern bool redirect_edge_and_branch PARAMS ((edge, basic_block));
|
||||
extern rtx block_label PARAMS ((basic_block));
|
||||
extern bool forwarder_block_p PARAMS ((basic_block));
|
||||
extern bool purge_all_dead_edges PARAMS ((void));
|
||||
extern bool purge_all_dead_edges PARAMS ((bool));
|
||||
extern bool purge_dead_edges PARAMS ((basic_block));
|
||||
extern void find_sub_basic_blocks PARAMS ((basic_block));
|
||||
extern void find_many_sub_basic_blocks PARAMS ((sbitmap));
|
||||
|
@ -433,6 +433,12 @@ merge_blocks (e, b, c, mode)
|
||||
/* If B has a fallthru edge to C, no need to move anything. */
|
||||
if (e->flags & EDGE_FALLTHRU)
|
||||
{
|
||||
/* We need to update liveness in case C already has broken liveness
|
||||
or B ends by conditional jump to next instructions that will be
|
||||
removed. */
|
||||
if ((BB_FLAGS (c) & BB_UPDATE_LIFE)
|
||||
|| GET_CODE (b->end) == JUMP_INSN)
|
||||
BB_SET_FLAG (b, BB_UPDATE_LIFE);
|
||||
merge_blocks_nomove (b, c);
|
||||
update_forwarder_flag (b);
|
||||
|
||||
@ -490,7 +496,7 @@ merge_blocks (e, b, c, mode)
|
||||
|
||||
if (b_has_incoming_fallthru)
|
||||
{
|
||||
rtx bb;
|
||||
basic_block bb;
|
||||
if (b_fallthru_edge->src == ENTRY_BLOCK_PTR)
|
||||
return false;
|
||||
bb = force_nonfallthru (b_fallthru_edge);
|
||||
|
24
gcc/cfgrtl.c
24
gcc/cfgrtl.c
@ -1923,10 +1923,30 @@ purge_dead_edges (bb)
|
||||
*/
|
||||
|
||||
bool
|
||||
purge_all_dead_edges ()
|
||||
purge_all_dead_edges (update_life_p)
|
||||
bool update_life_p;
|
||||
{
|
||||
int i, purged = false;
|
||||
sbitmap blocks;
|
||||
|
||||
if (update_life_p)
|
||||
{
|
||||
blocks = sbitmap_alloc (n_basic_blocks);
|
||||
sbitmap_zero (blocks);
|
||||
}
|
||||
for (i = 0; i < n_basic_blocks; i++)
|
||||
purged |= purge_dead_edges (BASIC_BLOCK (i));
|
||||
{
|
||||
bool purged_here;
|
||||
purged_here = purge_dead_edges (BASIC_BLOCK (i));
|
||||
purged |= purged_here;
|
||||
if (purged_here && update_life_p)
|
||||
SET_BIT (blocks, i);
|
||||
}
|
||||
if (update_life_p && purged)
|
||||
update_life_info (blocks, UPDATE_LIFE_GLOBAL,
|
||||
PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE
|
||||
| PROP_KILL_DEAD_CODE);
|
||||
if (update_life_p)
|
||||
sbitmap_free (blocks);
|
||||
return purged;
|
||||
}
|
||||
|
@ -456,6 +456,7 @@ life_analysis (f, file, flags)
|
||||
/* Always remove no-op moves. Do this before other processing so
|
||||
that we don't have to keep re-scanning them. */
|
||||
delete_noop_moves (f);
|
||||
purge_all_dead_edges (false);
|
||||
|
||||
/* Some targets can emit simpler epilogues if they know that sp was
|
||||
not ever modified during the function. After reload, of course,
|
||||
@ -803,8 +804,6 @@ delete_noop_moves (f)
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
if (insn == bb->end)
|
||||
purge_dead_edges (bb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3301,7 +3301,7 @@ rest_of_compilation (decl)
|
||||
|
||||
/* Always purge dead edges, as we may eliminate an insn throwing
|
||||
exception. */
|
||||
rebuild_jump_labels_after_combine |= purge_all_dead_edges ();
|
||||
rebuild_jump_labels_after_combine |= purge_all_dead_edges (true);
|
||||
|
||||
/* Combining insns may have turned an indirect jump into a
|
||||
direct jump. Rebuid the JUMP_LABEL fields of jumping
|
||||
|
Loading…
Reference in New Issue
Block a user