This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Abort in redirect_edge_and_branch on vax at line 866
- From: Jan Hubicka <jh at suse dot cz>
- To: law at redhat dot com
- Cc: Richard Henderson <rth at redhat dot com>, Jan Hubicka <jh at suse dot cz>, John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>, gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Jan 2002 18:12:38 +0100
- Subject: Re: Abort in redirect_edge_and_branch on vax at line 866
- References: <20020109152523.A31895@redhat.com> <28078.1010681947@porcupine.cygnus.com>
> > Really? I'd have thought that only merging basic blocks would
> > cause problems. We're not doing that.
> Nope. My recollection was that removing the jump itself along with
> removing any code which becomes unreachable as a side effect of removing
> the jump as causing implementation problems.
>
> I see that delete_insn no longer has the side effect of deleting code
> which becomes unreachable due to deleting the original insn. That makes
> me feel a lot better! Boy I need to keep up with development better.
>
> Probably the only problem that I can envision arising now would be
> looking at BLOCK_{HEAD,END} and getting back an insn that has been deleted
The remove_insn called from delete_insn does the trick for you as well,
so it should be OK.
> and removed from the chain of insns. That would make a loop like this
> do the wrong thing:
>
> for (insn = BLOCK_HEAD (bb);
> insn != NULL && insn != NEXT_INSN (BLOCK_END (bb));
> insn = NEXT_INSN (insn))
The deleteed insn remains in memory and NEXT_INSN still points to the
NEXT_INSN (BLOCK_END) - the original predecesor of deleted insn, so
the loop terminates.
We use similar construction in other parts too - even when it does look
tricky, it is most convenient I was able to come with.
Honza