patch for flow.c: flow_delete_insn
Richard Henderson
rth@cygnus.com
Tue May 9 22:50:00 GMT 2000
On Tue, May 09, 2000 at 03:19:55PM -0700, Richard Henderson wrote:
> Alternately, use reorder_insns, or just create a new note.
This implements the former. Bootstrapped alphaev56 and i686 linux.
r~
* flow.c (find_basic_blocks_1): Do not delete the first
bb_note we run across.
(create_basic_block): Use reorder_insns to move an existing
bb_note to the correct place.
Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.281
diff -c -p -d -r1.281 flow.c
*** flow.c 2000/05/09 18:41:25 1.281
--- flow.c 2000/05/10 05:47:04
*************** find_basic_blocks_1 (f)
*** 584,591 ****
{
if (bb_note == NULL_RTX)
bb_note = insn;
!
! next = flow_delete_insn (insn);
}
break;
}
--- 584,591 ----
{
if (bb_note == NULL_RTX)
bb_note = insn;
! else
! next = flow_delete_insn (insn);
}
break;
}
*************** create_basic_block (index, head, end, bb
*** 780,792 ****
{
/* If we found an existing note, thread it back onto the chain. */
if (GET_CODE (head) == CODE_LABEL)
! add_insn_after (bb_note, head);
else
{
! add_insn_before (bb_note, head);
head = bb_note;
}
}
else
{
--- 780,797 ----
{
/* If we found an existing note, thread it back onto the chain. */
+ rtx after;
+
if (GET_CODE (head) == CODE_LABEL)
! after = head;
else
{
! after = PREV_INSN (head);
head = bb_note;
}
+
+ if (after != bb_note && NEXT_INSN (after) != bb_note)
+ reorder_insns (bb_note, bb_note, after);
}
else
{
More information about the Gcc-patches
mailing list