This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ifcvt defect (was Re: PATCH: Debug support for bb-reorder)
On Mon, May 01, 2000 at 10:20:21PM -0700, Jason Eckhardt wrote:
> I believe I've located the problem in ifcvt.c:dead_or_predicable(). I've
> attached a patch for the defect.
> However, I found this particular function a bit hard to follow, so
> I'm not 100% confident of the patch.
I prefer this fix.
I'm not sure how to make that function easier to follow... perhaps if
we had standard functions for moving insns between blocks, so all the
head/end tracking is not inline?
> * flow.c (verify_flow_info): Added two more sanity checks. The
> first checks that the blocks are numbered consecutively. The second
> checks that n_basic_blocks is actually equal to the number of
> basic blocks in the insn chain.
Ok.
r~
* ifcvt.c (dead_or_predicable): Set merge_bb->end to the insn before
the sequence we're moving, not to merge_bb->head.
Index: ifcvt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ifcvt.c,v
retrieving revision 1.6
diff -c -p -d -r1.6 ifcvt.c
*** ifcvt.c 2000/05/01 22:25:54 1.6
--- ifcvt.c 2000/05/02 06:33:19
*************** dead_or_predicable (test_bb, merge_bb, o
*** 1935,1944 ****
}
/* Move the insns out of MERGE_BB to before the branch. */
- if (end == merge_bb->end)
- merge_bb->end = merge_bb->head;
if (head != NULL)
{
head = squeeze_notes (head, end);
if (GET_CODE (end) == NOTE
&& (NOTE_LINE_NUMBER (end) == NOTE_INSN_BLOCK_END
--- 1935,1945 ----
}
/* Move the insns out of MERGE_BB to before the branch. */
if (head != NULL)
{
+ if (end == merge_bb->end)
+ merge_bb->end = PREV_INSN (head);
+
head = squeeze_notes (head, end);
if (GET_CODE (end) == NOTE
&& (NOTE_LINE_NUMBER (end) == NOTE_INSN_BLOCK_END