On 12/10/2016 08:58 PM, Segher Boessenkool wrote:
On Thu, Dec 08, 2016 at 01:21:04PM +0100, Bernd Schmidt wrote:
This is another case where an optimization turns a trap_if
unconditional. We have to defer changing the CFG, since the rest of
cprop seems to blow up when we modify things while scanning.

The problem for PR78727 is that we also need to do this for insns that
already are the last insn in the block:

+      while (!uncond_traps.is_empty ())
+       {
+         rtx_insn *insn = uncond_traps.pop ();
+         basic_block to_split = BLOCK_FOR_INSN (insn);
+         remove_edge (split_block (to_split, insn));
+         emit_barrier_after_bb (to_split);
+       }

We need that barrier, and we also need the successor edges removed
(which split_block+remove_edge does).

(PR78727 works fine with just that BB_END test deleted).

Ah, ok. In that case I'll probably also add a test to make sure this is only done for insns that weren't an unconditional trap before. Retesting...


Bernd

Reply via email to