Commit ebdf17cb by Segher Boessenkool Committed by Segher Boessenkool

combine: Use correct mode in new comparison (PR86902)

This code in try_combine uses the wrong mode.  This fails (with RTL
checking) in trunk, but not in any released branches.


	PR rtl-optimization/86902
	* combine.c (try_combine): When changing the CC mode used, don't change
	an unrelated mode in other_insn to that new CC mode.

From-SVN: r264426
parent fce33808
2018-09-19 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/86902
* combine.c (try_combine): When changing the CC mode used, don't change
an unrelated mode in other_insn to that new CC mode.
2018-09-19 David Malcolm <dmalcolm@redhat.com> 2018-09-19 David Malcolm <dmalcolm@redhat.com>
* tree-data-ref.c (runtime_alias_check_p): Use formatted printing * tree-data-ref.c (runtime_alias_check_p): Use formatted printing
......
...@@ -3310,7 +3310,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, ...@@ -3310,7 +3310,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
{ {
/* Replace cc_use_loc with entire new RTX. */ /* Replace cc_use_loc with entire new RTX. */
SUBST (*cc_use_loc, SUBST (*cc_use_loc,
gen_rtx_fmt_ee (compare_code, compare_mode, gen_rtx_fmt_ee (compare_code, GET_MODE (*cc_use_loc),
newpat_dest, const0_rtx)); newpat_dest, const0_rtx));
undobuf.other_insn = cc_use_insn; undobuf.other_insn = cc_use_insn;
} }
...@@ -3319,7 +3319,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, ...@@ -3319,7 +3319,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
/* Just replace the CC reg with a new mode. */ /* Just replace the CC reg with a new mode. */
SUBST (XEXP (*cc_use_loc, 0), newpat_dest); SUBST (XEXP (*cc_use_loc, 0), newpat_dest);
undobuf.other_insn = cc_use_insn; undobuf.other_insn = cc_use_insn;
} }
} }
/* Now we modify the current newpat: /* Now we modify the current newpat:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment