This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cfgrtl
- From: Jan Hubicka <jh at suse dot cz>
- To: law at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 4 Feb 2002 20:15:00 +0100
- Subject: Re: cfgrtl
- References: <9523.1012838421@porcupine.cygnus.com>
>
>
> You'll see that we left in the code label at 33 and the jump table at 34.
> Not good. Worse yet, the jump table at 34 references non-existent labels.
> This can cause problems in non-cfg aware code that scans the insn chain.
>
> There's actually two approaches to fixing this problem. The first is to
> arrange for the useless label and jump table to be removed at the same
> time we replace the tablejump with a simplejump. The second would be to
> have a pass which removed code that was not contained within basic blocks
> (the code label and tablejump are _outside_ existing basic blocks). The
> former seems a lot cleaner to me.
This should be removed by delete_dead_jumptables in flow.c. At time of implementing
try_redirect_edge_and_branch, the idea of deleting tablejump when existing instruction
still may reference it looked very curious, so thats why it is in the code.
On cfg branch I did expreimentally same change as you and it appears to work now
(it did caused gcc to crash at time we still used old jump pass).
I would suggest to remove the delete_dead_jumptables then :)
One of drawbacks of your sollution is the fact that we will create DELETED_LABEL
note during delete_insn_chain that will not be elliminated and remaing in the
soutput sequence.
Honza