This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patches] Re: infinite loop in SPEC's gcc after your patches
- To: Richard Henderson <rth at redhat dot com>, Jan Hubicka <jh at suse dot cz>, 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: [patches] Re: infinite loop in SPEC's gcc after your patches
- From: Jan Hubicka <jh at suse dot cz>
- Date: Mon, 23 Jul 2001 22:57:48 +0200
- References: <20010723100511.A31585@tornado.cygnus.com> <20010723160708.B28424@atrey.karlin.mff.cuni.cz> <20010723101821.D31471@tornado.cygnus.com> <20010723172724.J28424@atrey.karlin.mff.cuni.cz> <20010723111033.B17358@redhat.com>
> On Mon, Jul 23, 2001 at 05:27:24PM +0200, Jan Hubicka wrote:
> > ! 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;
>
> Um.. we're never supposed to be able to fallthru here.
> You've disabled this whole pass.
It still works - the jump_block is block we are going to remove
and cbranch_dest_block is the destination of cbranch after the jump_block.
All the can_fallthrdu does as extra compared to the index test above is
to verify, that there is no jump table lurking around.
>
> > 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));
>
> This would be fine if you used the variables that already
> contain cbranch_jump_edge->src and cbranch_jump_edge->dest.
Because the code above changed the destination of edges, I expected to
be easier to read if I use values in the edge to make it more self
contained.
I am just testing following patch. Do you preffer it instead of
this solution?
Mon Jul 23 22:56:44 CEST 2001 Jan Hubicka <jh@suse.cz>
* flow.c (try_simplify_condjump): Use variables holding the edge
destinations instead of getting it directly.
Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.436
diff -c -3 -p -r1.436 flow.c
*** flow.c 2001/07/23 15:27:33 1.436
--- flow.c 2001/07/23 20:56:07
*************** try_simplify_condjump (cbranch_block)
*** 3081,3089 ****
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;
}
--- 3081,3089 ----
flow_delete_block (jump_block);
/* Selectively unlink the sequence. */
! if (cbranch_block->end != PREV_INSN (cbranch_dest_block->head))
! flow_delete_insn_chain (NEXT_INSN (cbranch_block->end),
! PREV_INSN (cbranch_dest_block->head));
return true;
}
>
>
> r~