* 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
+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.
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));
/* 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);
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);
*/
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;
}
/* 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,
PUT_CODE (insn, NOTE);
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
NOTE_SOURCE_FILE (insn) = 0;
- if (insn == bb->end)
- purge_dead_edges (bb);
}
}
}
/* 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