summaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-26 18:24:19 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-26 18:24:19 +0000
commit836969df77a99989826d5d788f86acf948a7b923 (patch)
treee608cbb4dca3385e3627ee2e91f2ecdf14351056 /gcc/ifcvt.c
parent95b6682397a1e993c33a375881aaffd998495d68 (diff)
downloadgcc-836969df77a99989826d5d788f86acf948a7b923.tar.gz
gcc/
2007-08-26 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/33181 * ifcvt.c (noce_get_alt_condition): Make sure that the previous non NOTE insn doesn't cross basic block. (noce_try_abs): Likewise. (noce_process_if_block): Likewise. gcc/testsuite/ 2007-08-26 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/33181 * gcc.dg/ifelse-2.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127810 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index b3cdf3aaaad..644a5e1c6ed 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -1534,6 +1534,7 @@ noce_get_alt_condition (struct noce_if_info *if_info, rtx target,
/* First, look to see if we put a constant in a register. */
prev_insn = prev_nonnote_insn (if_info->cond_earliest);
if (prev_insn
+ && BLOCK_NUM (prev_insn) == BLOCK_NUM (if_info->cond_earliest)
&& INSN_P (prev_insn)
&& GET_CODE (PATTERN (prev_insn)) == SET)
{
@@ -1772,6 +1773,7 @@ noce_try_abs (struct noce_if_info *if_info)
{
rtx set, insn = prev_nonnote_insn (earliest);
if (insn
+ && BLOCK_NUM (insn) == BLOCK_NUM (earliest)
&& (set = single_set (insn))
&& rtx_equal_p (SET_DEST (set), c))
{
@@ -2198,6 +2200,7 @@ noce_process_if_block (struct noce_if_info *if_info)
COND_EARLIEST to JUMP. Make sure the relevant data is still
intact. */
if (! insn_b
+ || BLOCK_NUM (insn_b) != BLOCK_NUM (if_info->cond_earliest)
|| !NONJUMP_INSN_P (insn_b)
|| (set_b = single_set (insn_b)) == NULL_RTX
|| ! rtx_equal_p (x, SET_DEST (set_b))