Commit 4e4017cb by Richard Henderson Committed by Richard Henderson

ifcvt.c (seq_contains_jump): New.

        * ifcvt.c (seq_contains_jump): New.
        (noce_try_store_flag_constants): Use it to fail conversion.
        (noce_try_store_flag_inc, noce_try_store_flag_mask): Likewise.

From-SVN: r34179
parent 0519ce30
2000-05-25 Richard Henderson <rth@cygnus.com>
* ifcvt.c (seq_contains_jump): New.
(noce_try_store_flag_constants): Use it to fail conversion.
(noce_try_store_flag_inc, noce_try_store_flag_mask): Likewise.
2000-05-25 Mark Mitchell <mark@codesourcery.com> 2000-05-25 Mark Mitchell <mark@codesourcery.com>
* except.h (can_throw): Declare it. * except.h (can_throw): Declare it.
...@@ -73,6 +73,7 @@ static sbitmap *post_dominators; ...@@ -73,6 +73,7 @@ static sbitmap *post_dominators;
static int count_bb_insns PARAMS ((basic_block)); static int count_bb_insns PARAMS ((basic_block));
static rtx first_active_insn PARAMS ((basic_block)); static rtx first_active_insn PARAMS ((basic_block));
static int last_active_insn_p PARAMS ((basic_block, rtx)); static int last_active_insn_p PARAMS ((basic_block, rtx));
static int seq_contains_jump PARAMS ((rtx));
static int cond_exec_process_insns PARAMS ((rtx, rtx, rtx, rtx, int)); static int cond_exec_process_insns PARAMS ((rtx, rtx, rtx, rtx, int));
static rtx cond_exec_get_condition PARAMS ((rtx)); static rtx cond_exec_get_condition PARAMS ((rtx));
...@@ -173,6 +174,24 @@ last_active_insn_p (bb, insn) ...@@ -173,6 +174,24 @@ last_active_insn_p (bb, insn)
return GET_CODE (insn) == JUMP_INSN; return GET_CODE (insn) == JUMP_INSN;
} }
/* It is possible, especially when having dealt with multi-word
arithmetic, for the expanders to have emitted jumps. Search
through the sequence and return TRUE if a jump exists so that
we can abort the conversion. */
static int
seq_contains_jump (insn)
rtx insn;
{
while (insn)
{
if (GET_CODE (insn) == JUMP_INSN)
return 1;
insn = NEXT_INSN (insn);
}
return 0;
}
/* Go through a bunch of insns, converting them to conditional /* Go through a bunch of insns, converting them to conditional
execution format if possible. Return TRUE if all of the non-note execution format if possible. Return TRUE if all of the non-note
...@@ -637,6 +656,10 @@ noce_try_store_flag_constants (if_info) ...@@ -637,6 +656,10 @@ noce_try_store_flag_constants (if_info)
seq = get_insns (); seq = get_insns ();
end_sequence (); end_sequence ();
if (seq_contains_jump (seq))
return FALSE;
emit_insns_before (seq, if_info->cond_earliest); emit_insns_before (seq, if_info->cond_earliest);
return TRUE; return TRUE;
...@@ -691,6 +714,10 @@ noce_try_store_flag_inc (if_info) ...@@ -691,6 +714,10 @@ noce_try_store_flag_inc (if_info)
seq = get_insns (); seq = get_insns ();
end_sequence (); end_sequence ();
if (seq_contains_jump (seq))
return FALSE;
emit_insns_before (seq, if_info->cond_earliest); emit_insns_before (seq, if_info->cond_earliest);
return TRUE; return TRUE;
...@@ -738,6 +765,10 @@ noce_try_store_flag_mask (if_info) ...@@ -738,6 +765,10 @@ noce_try_store_flag_mask (if_info)
seq = get_insns (); seq = get_insns ();
end_sequence (); end_sequence ();
if (seq_contains_jump (seq))
return FALSE;
emit_insns_before (seq, if_info->cond_earliest); emit_insns_before (seq, if_info->cond_earliest);
return TRUE; return TRUE;
......
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