summaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-30 22:13:50 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-30 22:13:50 +0000
commit95c02608654896d12cb97aaae32fb52183b263c9 (patch)
tree74e7937772a327835058f3bbe6344104de9bbbb6 /gcc/ifcvt.c
parent4fe49c859bf090adededf2ac0283f5cd3da262cd (diff)
downloadgcc-95c02608654896d12cb97aaae32fb52183b263c9.tar.gz
* ifcvt.c (noce_get_alt_condition): Use reg_overlap_mentioned_p.
(noce_process_if_block): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55886 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 3ce996f8edd..ecf0f77c39c 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -1368,7 +1368,7 @@ noce_get_alt_condition (if_info, target, earliest)
/* X may not be mentioned in the range (cond_earliest, jump]. */
for (insn = if_info->jump; insn != *earliest; insn = PREV_INSN (insn))
- if (INSN_P (insn) && reg_mentioned_p (if_info->x, insn))
+ if (INSN_P (insn) && reg_overlap_mentioned_p (if_info->x, PATTERN (insn)))
return NULL;
/* A and B may not be modified in the range [cond_earliest, jump). */
@@ -1774,16 +1774,18 @@ noce_process_if_block (ce_info)
|| GET_CODE (insn_b) != INSN
|| (set_b = single_set (insn_b)) == NULL_RTX
|| ! rtx_equal_p (x, SET_DEST (set_b))
- || reg_mentioned_p (x, cond)
- || reg_mentioned_p (x, a)
- || reg_mentioned_p (x, SET_SRC (set_b)))
+ || reg_overlap_mentioned_p (x, cond)
+ || reg_overlap_mentioned_p (x, a)
+ || reg_overlap_mentioned_p (x, SET_SRC (set_b)))
insn_b = set_b = NULL_RTX;
}
b = (set_b ? SET_SRC (set_b) : x);
- /* X may not be mentioned in the range (cond_earliest, jump]. */
+ /* X may not be mentioned in the range (cond_earliest, jump].
+ Note the use of reg_overlap_mentioned_p, which handles memories
+ properly, as opposed to reg_mentioned_p, which doesn't. */
for (insn = jump; insn != if_info.cond_earliest; insn = PREV_INSN (insn))
- if (INSN_P (insn) && reg_mentioned_p (x, insn))
+ if (INSN_P (insn) && reg_overlap_mentioned_p (x, PATTERN (insn)))
return FALSE;
/* A and B may not be modified in the range [cond_earliest, jump). */