This is the mail archive of the
mailing list for the GCC project.
Re: split_block fix
On Sun, Jul 22, 2001 at 07:56:12PM +0200, Jan Hubicka wrote:
> What I was having problem with, if I remember correctly, was an CODE_LABEL
> inserted as last insn in the block. sub_basic_block called split_block on
> next-to-last insn, but split_block emits BASIC_BLOCK note after the
> CODE_LABEL, thus overing after end of the BB.
Ok, I see. In which case I think moving the check up,
and commenting it, makes things clearer.
I'll apply it shortly.
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.431
diff -c -p -d -r1.431 flow.c
*** flow.c 2001/07/21 03:05:09 1.431
--- flow.c 2001/07/22 22:45:06
*************** split_block (bb, insn)
*** 1565,1570 ****
--- 1565,1575 ----
bb_note = emit_note_after (NOTE_INSN_BASIC_BLOCK,
NOTE_BASIC_BLOCK (bb_note) = new_bb;
+ /* If the only thing in this new block was the label, make sure
+ the block note gets included. */
+ if (new_bb->head == new_bb->end)
+ new_bb->end = bb_note;