This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Detecting casesi insns
- To: law at cygnus dot com
- Subject: Re: Detecting casesi insns
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Thu, 21 Oct 1999 10:46:49 +0100
- Cc: gcc-patches at gcc dot gnu dot org
- Cc: richard dot earnshaw at arm dot com
- Organization: ARM Ltd.
- Reply-To: richard dot earnshaw at arm dot com
law@cygnus.com said:
> FWIW, rth and I have have kicked around the idea of revamping this
> stuff; the number of places we have to special case code because
> ADDR_VECs are not attached to the casesi/tablejump is huge. And most
> places get it wrong in one way or another.
I noticed comments that alluded to this while trying to track down the
split_edge bug I fixed yesterday.
Another thing that sprung to mind was that JUMP_LABEL is dangerous as it
stands if a target has any insns that can contain more than one code
label. In these circumstances there are many occasions where you have to
rescan the whole insn to ensure that you have fixed all the labels within
it (this is precisely the problem with the casesi insn, which contains two
labels, the label preceeding the ADDR_VEC and the label for the default
branch).
I wonder if it would make sense for JUMP_LABEL to be made into a vector?
It could then contain a list of all the labels mentioned in an insn. For
some optimizations it might make sense only to try with the first element
of the vector, but when fixing other things up it would save having to
rescan the insn; in particular, it would be a good reminder to programmers
that there isn't guaranteed to be exactly one label to fix.