This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: trivial cleanups


> On Mon, Sep 24, 2001 at 01:45:20PM +0200, Jan Hubicka wrote:
> > *** /p2/cfg9/egcs/gcc/cfgcleanup.c	Thu Sep 20 18:33:13 2001
> > --- cfgcleanup.c	Sat Sep 22 14:19:55 2001
> > *************** try_simplify_condjump (cbranch_block)
> > *** 106,119 ****
> >     if (!can_fallthru (jump_block, cbranch_dest_block))
> >       return false;
> >   
> > !   /* Invert the conditional branch.  Prevent jump.c from deleting
> > !      "unreachable" instructions.  */
> > !   LABEL_NUSES (JUMP_LABEL (cbranch_insn))++;
> > !   if (!invert_jump (cbranch_insn, block_label (jump_dest_block), 1))
> > !     {
> > !       LABEL_NUSES (JUMP_LABEL (cbranch_insn))--;
> > !       return false;
> > !     }
> >   
> >     if (rtl_dump_file)
> >       fprintf (rtl_dump_file, "Simplifying condjump %i around jump %i\n",
> > --- 106,114 ----
> >     if (!can_fallthru (jump_block, cbranch_dest_block))
> >       return false;
> >   
> > !   /* Invert the conditional branch.  */
> > !   if (!invert_jump (cbranch_insn, block_label (jump_dest_block), 0))
> > !     return false;
> >   
> >     if (rtl_dump_file)
> >       fprintf (rtl_dump_file, "Simplifying condjump %i around jump %i\n",
> 
> Does it matter that the new code leaves the LABEL_NUSES
> incremented, whereas the old code would increment it if
> invert_jump returned true?
The whole problem was that invert jump sometimes killed dead code that wasted CFG
(the killing was correct, but we needed to do it at higher level)
It now does have option to not do it so I am using it instead of hacking.
The old code got counts wrong, but it didn't matter, because the jump's destination
label got removed subsequently.

Thanks for reviewing my patches!

Honza
> 
> Matt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]