From: ktkachov Date: Fri, 27 Nov 2015 09:52:09 +0000 (+0000) Subject: [RTL-ifcvt] Reject insns that are multiple_sets X-Git-Tag: upstream/6.1~2674 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02f1a5ac7429e15d79a66a5b1e419f9b74d9ea07;p=platform%2Fupstream%2Flinaro-gcc.git [RTL-ifcvt] Reject insns that are multiple_sets * ifcvt.c (insn_valid_noce_process_p): Reject insn if it satisfies multiple_sets. (noce_try_cmove_arith): Add checking asserts that orig_a and orig_b are not modified by the final modified insns in the basic blocks. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231004 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9278a0c..4510240 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2015-11-27 Kyrylo Tkachov + * ifcvt.c (insn_valid_noce_process_p): Reject insn if it satisfies + multiple_sets. + (noce_try_cmove_arith): Add checking asserts that orig_a and orig_b + are not modified by the final modified insns in the basic blocks. + +2015-11-27 Kyrylo Tkachov + PR rtl-optimization/68506 * ifcvt.c (noce_try_cmove_arith): Try emitting the else basic block first if emit_a exists or then_bb modifies 'b'. Reindent if-else diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 8ece873..c995b0f 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -1850,6 +1850,7 @@ insn_valid_noce_process_p (rtx_insn *insn, rtx cc) { if (!insn || !NONJUMP_INSN_P (insn) + || multiple_sets (insn) || (cc && set_of (cc, insn))) return false; @@ -2176,7 +2177,7 @@ noce_try_cmove_arith (struct noce_if_info *if_info) swap insn that sets up A with the one that sets up B. If even that doesn't help, punt. */ - modified_in_a = emit_a != NULL_RTX && modified_in_p (orig_b, emit_a); + gcc_checking_assert (!emit_a || !modified_in_p (orig_b, emit_a)); if (tmp_b && then_bb) { FOR_BB_INSNS (then_bb, tmp_insn) @@ -2192,7 +2193,7 @@ noce_try_cmove_arith (struct noce_if_info *if_info) } if (emit_a || modified_in_a) { - modified_in_b = emit_b != NULL_RTX && modified_in_p (orig_a, emit_b); + gcc_checking_assert (!emit_b || !modified_in_p (orig_a, emit_b)); if (tmp_b && else_bb) { FOR_BB_INSNS (else_bb, tmp_insn)