This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Another bug in your lastest checkin.
Jan Hubicka wrote:
>
> > set_block_for_new_insns requires a basic_block and note an edge.
> > I've no idea how this apparently works assuming that the else part
> > of the code actually gets exercised.
> >
> > /* If optimization is off, and perhaps in an empty function,
> > the entry block will have no successors. */
> > if (ENTRY_BLOCK_PTR->succ)
> > {
> > /* Can't deal with multiple successsors of the entry block. */
> > if (ENTRY_BLOCK_PTR->succ->succ_next)
> > abort ();
> >
> > insert_insn_on_edge (seq, ENTRY_BLOCK_PTR->succ);
> > inserted = 1;
> > }
> > else
> > set_block_for_new_insns (emit_insn_after (seq, f),
> > ENTRY_BLOCK_PTR->succ);
> > ^requires BB and not EDGE!
> Hmm, the change came from sanity checking every emit_insn, but after
> closer look, it looks like the code is dead now. We always do have CFG
> built (even when not optimizing) and so we always excercise the first
> part of if.
>
> Richard, looks sane to just remove the the if?
>
If it is always now supposed to execute the if part then I would
suggest you change the code to keep a sanity check, thus:
/* If optimization is off, and perhaps in an empty function,
the entry block will have no successors. */
if (! ENTRY_BLOCK_PTR->succ)
abort ();
/* Can't deal with multiple successsors of the entry block. */
if (ENTRY_BLOCK_PTR->succ->succ_next)
abort ();
insert_insn_on_edge (seq, ENTRY_BLOCK_PTR->succ);
inserted = 1;
> Honza
> >
> > Graham
Graham