Commit 32a8d3f6 by Segher Boessenkool Committed by Segher Boessenkool

ifcvt: Don't make invalid insns for a cond trap (PR78751)

As shown in the PR, ifcvt will happily make invalid insns when given the
chance.  This patch teaches it some manners.


	PR rtl-optimization/78751
	* ifcvt.c (find_cond_trap): If we generated a non-existing insn,
	give up.

From-SVN: r244476
parent 0cb4b758
2017-01-15 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/78751
* ifcvt.c (find_cond_trap): If we generated a non-existing insn,
give up.
2017-01-14 Jeff Law <law@redhat.com>
PR tree-optimization/79090
......
......@@ -4686,6 +4686,11 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge)
if (seq == NULL)
return FALSE;
/* If that results in an invalid insn, back out. */
for (rtx_insn *x = seq; x; x = NEXT_INSN (x))
if (recog_memoized (x) < 0)
return FALSE;
/* Emit the new insns before cond_earliest. */
emit_insn_before_setloc (seq, cond_earliest, INSN_LOCATION (trap));
......
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