[4.0/mainline] PR 21562
Jan Hubicka
jh@suse.cz
Sat May 28 12:13:00 GMT 2005
> > On Fri, May 27, 2005 at 02:18:21AM +0200, Jan Hubicka wrote:
> > > ! if (!(e2->flags & EDGE_ABNORMAL))
> > > ! {
> > > ! /* Multiple entry points not supported yet. */
> > > ! gcc_assert (!e);
> > > e = e2;
> >
> > Under what conditions are you seeing EDGE_ABNORMAL from ENTRY?
>
> I guess I don't. I somehow believe that it is how multiple return
> functions (setjmp) are represented but they are not. I think I did it
> in my tree once in the past tought.
> I am re-testing the patch without this check.
OK, here is updated patch.
Index: cfgexpand.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgexpand.c,v
retrieving revision 2.39
diff -c -3 -p -r2.39 cfgexpand.c
*** cfgexpand.c 19 May 2005 03:05:38 -0000 2.39
--- cfgexpand.c 28 May 2005 00:01:35 -0000
*************** static basic_block
*** 1157,1178 ****
construct_init_block (void)
{
basic_block init_block, first_block;
! edge e = NULL, e2;
! edge_iterator ei;
! FOR_EACH_EDGE (e2, ei, ENTRY_BLOCK_PTR->succs)
! {
! /* Clear EDGE_EXECUTABLE. This flag is never used in the backend.
! For all other blocks this edge flag is cleared while expanding
! a basic block in expand_gimple_basic_block, but there we never
! looked at the successors of the entry block.
! This caused PR17513. */
! e2->flags &= ~EDGE_EXECUTABLE;
! if (e2->dest == ENTRY_BLOCK_PTR->next_bb)
! e = e2;
}
init_block = create_basic_block (NEXT_INSN (get_insns ()),
get_last_insn (),
--- 1157,1181 ----
construct_init_block (void)
{
basic_block init_block, first_block;
! edge e = NULL;
! int flags;
! /* Multiple entry points not supported yet. */
! gcc_assert (EDGE_COUNT (ENTRY_BLOCK_PTR->succs) == 1);
! e = EDGE_SUCC (ENTRY_BLOCK_PTR, 0);
! /* When entry edge points to first basic block, we don't need jump,
! otherwise we have to jump into proper target. */
! if (e && e->dest != ENTRY_BLOCK_PTR->next_bb)
! {
! tree label = tree_block_label (e->dest);
!
! emit_jump (label_rtx (label));
! flags = 0;
}
+ else
+ flags = EDGE_FALLTHRU;
init_block = create_basic_block (NEXT_INSN (get_insns ()),
get_last_insn (),
*************** construct_init_block (void)
*** 1183,1189 ****
{
first_block = e->dest;
redirect_edge_succ (e, init_block);
! e = make_edge (init_block, first_block, EDGE_FALLTHRU);
}
else
e = make_edge (init_block, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
--- 1186,1192 ----
{
first_block = e->dest;
redirect_edge_succ (e, init_block);
! e = make_edge (init_block, first_block, flags);
}
else
e = make_edge (init_block, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
More information about the Gcc-patches
mailing list