This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix inconsistent CFG out of DOM1


> Thanks.  Couldn't we catch this when we create the blocks in
> tree-ssa-threadupdate.c::create_block_for_threading or possibly in the
> duplicate_block code?

AFAICS not in this case, the problematic block is the (successor of the) new 
latch created at the end of thread_through_loop_header:

      /* Create the new latch block.  This is always necessary, as the latch
	 must have only a single successor, but the original header had at
	 least two successors.  */
      loop->latch = NULL;
      mfb_kj_edge = single_succ_edge (new_preheader);
      loop->header = mfb_kj_edge->dest;
      latch = make_forwarder_block (tgt_bb, mfb_keep_just, NULL);
      loop->header = latch->dest;
      loop->latch = latch->src;

tgt_bb needs to be cleaned up but, after the call to make_forwarder_block, its 
successor needs to instead.

The situation appears to be specific to loops, maybe it cannot happen for the 
non-loop threading code.

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]