This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: CASESI: GCC is optimising away my cases
- To: pmw at uk dot research dot att dot com (Paul Webster)
- Subject: Re: CASESI: GCC is optimising away my cases
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 14 Dec 1999 10:48:09 -0700
- cc: gcc-help at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <199912141720.RAA11121@rocoto>you write:
>
> I've created a `casesi' pattern which outputs code for jumping via the
> table. This produces the expected code. However, when I run the compiler
> with any optimisation enabled, it removes the blocks of code referred to
> in the dispatch table.
>
> What it looks like is happening is that the jump optimisation cannot find a
> jump which refers to the routines (as they are done indirectly via the
> dispatch table),
This is your problem. You need to show at the RTL level that each label
is used.
Your casesi pattern should be followed by an ADDR_VEC or ADDR_DIFF_VEC insn
which should contain a reference to each target label. Why is that not
happening?
jeff