aboutsummaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-01-23 18:59:58 -0800
committerRichard Henderson <rth@gcc.gnu.org>2003-01-23 18:59:58 -0800
commit3de9c088e8349dbf2af82c6ae947e9fe84b356e2 (patch)
tree795011f29c3d8a47649c42e9fa9e483f0e44bbb2 /gcc/ifcvt.c
parent8bef0925e831b8b5092b6282cb5d8b68dad62cc0 (diff)
downloadgcc-3de9c088e8349dbf2af82c6ae947e9fe84b356e2.zip
gcc-3de9c088e8349dbf2af82c6ae947e9fe84b356e2.tar.gz
gcc-3de9c088e8349dbf2af82c6ae947e9fe84b356e2.tar.bz2
ifcvt.c (noce_process_if_block): Re-add check vs X being changed in no-else-block case.
* ifcvt.c (noce_process_if_block): Re-add check vs X being changed in no-else-block case. Add commentary. From-SVN: r61695
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 341e755..ed04aef 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -1802,15 +1802,22 @@ noce_process_if_block (ce_info)
else
{
insn_b = prev_nonnote_insn (if_info.cond_earliest);
+ /* We're going to be moving the evaluation of B down from above
+ COND_EARLIEST to JUMP. Make sure the relevant data is still
+ intact. */
if (! insn_b
|| GET_CODE (insn_b) != INSN
|| (set_b = single_set (insn_b)) == NULL_RTX
|| ! rtx_equal_p (x, SET_DEST (set_b))
- || reg_overlap_mentioned_p (x, cond)
- || reg_overlap_mentioned_p (x, a)
|| reg_overlap_mentioned_p (x, SET_SRC (set_b))
|| modified_between_p (SET_SRC (set_b),
- PREV_INSN (if_info.cond_earliest), jump))
+ PREV_INSN (if_info.cond_earliest), jump)
+ /* Likewise with X. In particular this can happen when
+ noce_get_condition looks farther back in the instruction
+ stream than one might expect. */
+ || reg_overlap_mentioned_p (x, cond)
+ || reg_overlap_mentioned_p (x, a)
+ || modified_between_p (x, PREV_INSN (if_info.cond_earliest), jump))
insn_b = set_b = NULL_RTX;
}
b = (set_b ? SET_SRC (set_b) : x);