diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2008-03-01 18:22:52 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2008-03-01 18:22:52 +0000 |
commit | 89c3cbc686697a14bfb603da5e187331464e696b (patch) | |
tree | 325127064d5304b40c378df2ef0686f3fdf5d5c8 /gcc | |
parent | 5eb4a9af17425b88532437c4c1c97bef313ac443 (diff) | |
download | gcc-89c3cbc686697a14bfb603da5e187331464e696b.zip gcc-89c3cbc686697a14bfb603da5e187331464e696b.tar.gz gcc-89c3cbc686697a14bfb603da5e187331464e696b.tar.bz2 |
ifcvt.c (noce_process_if_block): Try to handle only the then block if the else block exists but isn't suitable.
* ifcvt.c (noce_process_if_block): Try to handle only the then
block if the else block exists but isn't suitable.
From-SVN: r132803
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ifcvt.c | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ff83b9c..216d321 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-03-01 Alexandre Oliva <aoliva@redhat.com> + + * ifcvt.c (noce_process_if_block): Try to handle only the then + block if the else block exists but isn't suitable. + 2008-03-01 Janne Blomqvist <jb@gcc.gnu.org> PR gcc/35063 diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 1bb6732..4fd98d0 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -2245,6 +2245,7 @@ noce_process_if_block (struct noce_if_info *if_info) || !NONJUMP_INSN_P (insn_b) || (set_b = single_set (insn_b)) == NULL_RTX || ! rtx_equal_p (x, SET_DEST (set_b)) + || ! noce_operand_ok (SET_SRC (set_b)) || reg_overlap_mentioned_p (x, SET_SRC (set_b)) || modified_between_p (SET_SRC (set_b), PREV_INSN (if_info->cond_earliest), jump) @@ -2290,6 +2291,7 @@ noce_process_if_block (struct noce_if_info *if_info) if (! noce_operand_ok (a) || ! noce_operand_ok (b)) return FALSE; + retry: /* Set up the info block for our subroutines. */ if_info->insn_a = insn_a; if_info->insn_b = insn_b; @@ -2387,6 +2389,13 @@ noce_process_if_block (struct noce_if_info *if_info) goto success; } + if (!else_bb && set_b) + { + insn_b = set_b = NULL_RTX; + b = orig_x; + goto retry; + } + return FALSE; success: |