Commit 068473ec by Jan Hubicka Committed by Jan Hubicka

basic-block.h (fixup_abnormal_edges): Declare.

	* basic-block.h (fixup_abnormal_edges): Declare.
	* reload1.c (fixup_abnormal_edges): New function.
	* reg-stack.c (convert_regs): Use it.

	* gcse.c (insert_insn_end_bb): Handle trapping insns.

	* gcse.c (hash_scan_set): Refuse instructions with EH edges.

From-SVN: r50405
parent a9a437be
Thu Mar 7 16:33:54 CET 2002 Jan Hubicka <jh@suse.cz>
* basic-block.h (fixup_abnormal_edges): Declare.
* reload1.c (fixup_abnormal_edges): New function.
* reg-stack.c (convert_regs): Use it.
* gcse.c (insert_insn_end_bb): Handle trapping insns.
* gcse.c (hash_scan_set): Refuse instructions with EH edges.
2002-03-07 Richard Sandiford <rsandifo@redhat.com> 2002-03-07 Richard Sandiford <rsandifo@redhat.com>
* defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New. * defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New.
......
...@@ -697,6 +697,7 @@ extern conflict_graph conflict_graph_compute ...@@ -697,6 +697,7 @@ extern conflict_graph conflict_graph_compute
partition)); partition));
extern bool mark_dfs_back_edges PARAMS ((void)); extern bool mark_dfs_back_edges PARAMS ((void));
extern void update_br_prob_note PARAMS ((basic_block)); extern void update_br_prob_note PARAMS ((basic_block));
extern void fixup_abnormal_edges PARAMS ((void));
/* In dominance.c */ /* In dominance.c */
......
...@@ -2189,6 +2189,10 @@ hash_scan_set (pat, insn, set_p) ...@@ -2189,6 +2189,10 @@ hash_scan_set (pat, insn, set_p)
&& regno >= FIRST_PSEUDO_REGISTER && regno >= FIRST_PSEUDO_REGISTER
/* Don't GCSE something if we can't do a reg/reg copy. */ /* Don't GCSE something if we can't do a reg/reg copy. */
&& can_copy_p [GET_MODE (dest)] && can_copy_p [GET_MODE (dest)]
/* GCSE commonly inserts instruction after the insn. We can't
do that easily for EH_REGION notes so disable GCSE on these
for now. */
&& !find_reg_note (insn, REG_EH_REGION, NULL_RTX)
/* Is SET_SRC something we want to gcse? */ /* Is SET_SRC something we want to gcse? */
&& want_to_gcse_p (src) && want_to_gcse_p (src)
/* Don't CSE a nop. */ /* Don't CSE a nop. */
...@@ -4609,13 +4613,23 @@ insert_insn_end_bb (expr, bb, pre) ...@@ -4609,13 +4613,23 @@ insert_insn_end_bb (expr, bb, pre)
pat = process_insert_insn (expr); pat = process_insert_insn (expr);
/* If the last insn is a jump, insert EXPR in front [taking care to /* If the last insn is a jump, insert EXPR in front [taking care to
handle cc0, etc. properly]. */ handle cc0, etc. properly]. Similary we need to care trapping
instructions in presence of non-call exceptions. */
if (GET_CODE (insn) == JUMP_INSN) if (GET_CODE (insn) == JUMP_INSN
|| (GET_CODE (insn) == INSN
&& (bb->succ->succ_next || (bb->succ->flags & EDGE_ABNORMAL))))
{ {
#ifdef HAVE_cc0 #ifdef HAVE_cc0
rtx note; rtx note;
#endif #endif
/* It should always be the case that we can put these instructions
anywhere in the basic block with performing PRE optimizations.
Check this. */
if (GET_CODE (insn) == insn && pre
&& !TEST_BIT (antloc[bb->index], expr->bitmap_index)
&& !TEST_BIT (transp[bb->index], expr->bitmap_index))
abort ();
/* If this is a jump table, then we can't insert stuff here. Since /* If this is a jump table, then we can't insert stuff here. Since
we know the previous real insn must be the tablejump, we insert we know the previous real insn must be the tablejump, we insert
...@@ -4645,7 +4659,8 @@ insert_insn_end_bb (expr, bb, pre) ...@@ -4645,7 +4659,8 @@ insert_insn_end_bb (expr, bb, pre)
/* Likewise if the last insn is a call, as will happen in the presence /* Likewise if the last insn is a call, as will happen in the presence
of exception handling. */ of exception handling. */
else if (GET_CODE (insn) == CALL_INSN) else if (GET_CODE (insn) == CALL_INSN
&& (bb->succ->succ_next || (bb->succ->flags & EDGE_ABNORMAL)))
{ {
/* Keeping in mind SMALL_REGISTER_CLASSES and parameters in registers, /* Keeping in mind SMALL_REGISTER_CLASSES and parameters in registers,
we search backward and place the instructions before the first we search backward and place the instructions before the first
......
...@@ -2854,6 +2854,7 @@ convert_regs (file) ...@@ -2854,6 +2854,7 @@ convert_regs (file)
} }
} }
fixup_abnormal_edges ();
if (inserted) if (inserted)
commit_edge_insertions (); commit_edge_insertions ();
......
...@@ -459,7 +459,7 @@ static void failed_reload PARAMS ((rtx, int)); ...@@ -459,7 +459,7 @@ static void failed_reload PARAMS ((rtx, int));
static int set_reload_reg PARAMS ((int, int)); static int set_reload_reg PARAMS ((int, int));
static void reload_cse_delete_noop_set PARAMS ((rtx, rtx)); static void reload_cse_delete_noop_set PARAMS ((rtx, rtx));
static void reload_cse_simplify PARAMS ((rtx)); static void reload_cse_simplify PARAMS ((rtx));
static void fixup_abnormal_edges PARAMS ((void)); void fixup_abnormal_edges PARAMS ((void));
extern void dump_needs PARAMS ((struct insn_chain *)); extern void dump_needs PARAMS ((struct insn_chain *));
/* Initialize the reload pass once per compilation. */ /* Initialize the reload pass once per compilation. */
...@@ -9465,7 +9465,7 @@ copy_eh_notes (insn, x) ...@@ -9465,7 +9465,7 @@ copy_eh_notes (insn, x)
proper call and fix the damage. proper call and fix the damage.
Similar handle instructions throwing exceptions internally. */ Similar handle instructions throwing exceptions internally. */
static void void
fixup_abnormal_edges () fixup_abnormal_edges ()
{ {
int i; int i;
......
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