This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cfg_cleanup and loop discovery in cfg_layout mode
Hello,
> > On Thu, Jul 03, 2003 at 10:39:26AM +0200, Jan Hubicka wrote:
> > > http://gcc.gnu.org/ml/gcc-patches/2003-06/msg01741.html
> >
> > Ok.
>
> Thanks! I've updated all the patches for ISO-C prototypes and installed
> them together (they are too interwinded to be reliably tested
> separately)
this should fix the breakage the patches caused on
powerpc-apple-darwin6.3. The problem was that the original code
removes the label if it occurs in bb 0.
I don't fully understand what Honza wanted the code to do, especially
why he is handling the case when NOTE_INSN_BASIC_BLOCK comes first
specially; but I believe this one should work as well.
Zdenek
* cfglayout.c (record_effective_endpoints): Split insns before
first basic block correctly.
Index: cfglayout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfglayout.c,v
retrieving revision 1.41
diff -c -3 -p -r1.41 cfglayout.c
*** cfglayout.c 3 Jul 2003 23:50:05 -0000 1.41
--- cfglayout.c 4 Jul 2003 21:28:16 -0000
*************** record_effective_endpoints (void)
*** 196,214 ****
rtx insn;
for (insn = get_insns ();
! NEXT_INSN (insn) && GET_CODE (insn) == NOTE;
insn = NEXT_INSN (insn))
! {
! if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK)
! {
! insn = NULL;
! break;
! }
! if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
! break;
! }
! if (insn)
! cfg_layout_function_header = unlink_insn_chain (get_insns (), insn);
else
cfg_layout_function_header = NULL_RTX;
--- 196,211 ----
rtx insn;
for (insn = get_insns ();
! insn
! && GET_CODE (insn) == NOTE
! && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK;
insn = NEXT_INSN (insn))
! continue;
! if (!insn)
! abort (); /* No basic blocks at all? */
! if (PREV_INSN (insn))
! cfg_layout_function_header =
! unlink_insn_chain (get_insns (), PREV_INSN (insn));
else
cfg_layout_function_header = NULL_RTX;