summaryrefslogtreecommitdiffstats
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-25 23:53:23 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-25 23:53:23 +0000
commita9a81f26dfc6d26ed2214b590068364e4a1f4b6f (patch)
treee220cd3d4052a3bc02972d1c12f86e4e1ac366ea /gcc/ifcvt.c
parent4642b20509ae69830c44ffc3f59d9b86088c7fdb (diff)
downloadppe42-gcc-a9a81f26dfc6d26ed2214b590068364e4a1f4b6f.tar.gz
ppe42-gcc-a9a81f26dfc6d26ed2214b590068364e4a1f4b6f.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34179 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 088efd0943d..9b20b3ae503 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -73,6 +73,7 @@ static sbitmap *post_dominators;
static int count_bb_insns PARAMS ((basic_block));
static rtx first_active_insn PARAMS ((basic_block));
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 rtx cond_exec_get_condition PARAMS ((rtx));
@@ -173,6 +174,24 @@ last_active_insn_p (bb, 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
execution format if possible. Return TRUE if all of the non-note
@@ -637,6 +656,10 @@ noce_try_store_flag_constants (if_info)
seq = get_insns ();
end_sequence ();
+
+ if (seq_contains_jump (seq))
+ return FALSE;
+
emit_insns_before (seq, if_info->cond_earliest);
return TRUE;
@@ -691,6 +714,10 @@ noce_try_store_flag_inc (if_info)
seq = get_insns ();
end_sequence ();
+
+ if (seq_contains_jump (seq))
+ return FALSE;
+
emit_insns_before (seq, if_info->cond_earliest);
return TRUE;
@@ -738,6 +765,10 @@ noce_try_store_flag_mask (if_info)
seq = get_insns ();
end_sequence ();
+
+ if (seq_contains_jump (seq))
+ return FALSE;
+
emit_insns_before (seq, if_info->cond_earliest);
return TRUE;
OpenPOWER on IntegriCloud