This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: infinite loop in SPEC's gcc after your patches
- To: Diego Novillo <dnovillo at redhat dot com>, gcc-patches at gcc dot gnu dot org, aj at suse dot de, patches at x86-64 dot org
- Subject: Re: infinite loop in SPEC's gcc after your patches
- From: Jan Hubicka <jh at suse dot cz>
- Date: Mon, 23 Jul 2001 17:27:24 +0200
- Cc: Jan Hubicka <jh at suse dot cz>, Richard Henderson <rth at redhat dot com>
- References: <20010723100511.A31585@tornado.cygnus.com> <20010723160708.B28424@atrey.karlin.mff.cuni.cz> <20010723101821.D31471@tornado.cygnus.com>
> On Mon, 23 Jul 2001, Jan Hubicka wrote:
>
> > > Guys,
> > Hi,
> > I've just noticed the same with Andreas on spec2000 runs. I am going to
> > investigate the problem.
> >
> > If you do have some better idea where to start, please let me know.
> >
> I would start by undoing the patches I quoted one at a time until
> the problem goes away. From there the real fix would hopefully
> manifest itself. I don't think the search should take long, it
> only broke today.
Hi,
the problem is caused by double barrier, where delete_block remove only one.
The patch makes try_simplify_condjump consistent with other places we create
new BB. The bug didn't show previously, as double barriers has been usually
zapped by jump pass.
I will write some code to do such cleanups on insn chain again soon.
Still the bug should show up in other situations and we are tolerant to multiple
barriers in other code, so this fix looks correct to me.
Bootstrapped/regtested MIPS. I am installing it as obvious, as w/o the compiler
seems to be rather broken.
Honza
Mon Jul 23 17:22:11 CEST 2001 Jan Hubicka <jh@suse.cz>
* flow.c (try_simplify_condjump): Unlink insn chain on
fallthru edge; use can_fallthru.
Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.435
diff -c -3 -p -r1.435 flow.c
*** flow.c 2001/07/23 14:08:11 1.435
--- flow.c 2001/07/23 15:21:06
*************** try_simplify_condjump (cbranch_block)
*** 3056,3062 ****
/* The conditional branch must target the block after the
unconditional branch. */
cbranch_dest_block = cbranch_jump_edge->dest;
! if (cbranch_dest_block->index != jump_block->index + 1)
return false;
/* Invert the conditional branch. Prevent jump.c from deleting
--- 3056,3063 ----
/* The conditional branch must target the block after the
unconditional branch. */
cbranch_dest_block = cbranch_jump_edge->dest;
!
! if (!can_fallthru (jump_block, cbranch_dest_block))
return false;
/* Invert the conditional branch. Prevent jump.c from deleting
*************** try_simplify_condjump (cbranch_block)
*** 3079,3084 ****
--- 3080,3089 ----
cbranch_fallthru_edge->flags &= ~EDGE_FALLTHRU;
flow_delete_block (jump_block);
+ /* Selectively unlink the sequence. */
+ if (cbranch_jump_edge->src->end != PREV_INSN (cbranch_jump_edge->dest->head))
+ flow_delete_insn_chain (NEXT_INSN (cbranch_jump_edge->src->end),
+ PREV_INSN (cbranch_jump_edge->dest->head));
return true;
}