On 21 May 2014 00:54, Jeff Law <l...@redhat.com> wrote: > On 05/20/14 01:11, Zhenqiang Chen wrote: >> >> Hi, >> >> The patch fix ICE issue triggered by shrink-wrapping enhancement. >> >> Bootstrap and no make check regression on X86-64. >> >> OK for trunk? >> >> Thanks! >> -Zhenqiang >> >> >> 2014-05-20 Zhenqiang Chen <zhenqiang.c...@linaro.org> >> >> PR rtl-optimization/61220 >> Part of PR rtl-optimization/61225 >> * shrink-wrap.c (move_insn_for_shrink_wrap): Skip SP and FP >> adjustment >> insn; skip split_edge for a block without only on successor. >> >> testsuite/ChangeLog: >> 2014-05-20 Zhenqiang Chen <zhenqiang.c...@linaro.org> >> >> * gcc.dg/pr61220.c: New test. >> * gcc.dg/shrink-wrap-loop.c: Disable for x86_64 -m32 mode. >> > [ ... ] > > > > >> /* Make sure that the source register isn't defined later in BB. */ >> @@ -204,6 +209,10 @@ move_insn_for_shrink_wrap (basic_block bb, rtx insn, >> /* Create a new basic block on the edge. */ >> if (EDGE_COUNT (next_block->preds) == 2) >> { >> + /* split_edge for a block with only one successor is meaningless. >> */ >> + if (EDGE_COUNT (bb->succs) == 1) >> + return false; >> + >> next_block = split_edge (live_edge); > > So don't you just want to use: > > if (EDGE_CRITICAL_P (live_edge)) > > to replace the two explicit checks of EDGE_COUNT on the preds & succs?
Thanks for the comment. In the code, there are 4 combinations of EDGE_COUNT: <1, 1>, <1, 2>, <2, 1> and <2, 2>. <2, 1> is "illegal". <2, 2> is legal, but need split_edge. <1, *> can bypass the second check. EDGE_CRITICAL_P can only distinguish <2, 2> from others. So I think two explicit checks is more efficient than EDGE_CRITICAL_P. Thanks! -Zhenqiang