From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: pmw@uk.research.att.com (Paul Webster) Cc: gcc-help@gcc.gnu.org Subject: Re: CASESI: GCC is optimising away my cases Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: <30635.945193689@upchuck> References: <199912141720.RAA11121@rocoto> X-SW-Source: 1999-12n/msg00219.html Message-ID: <19991231222400.Sijb9H9jbJ4J0wDgLB0vKqUmGby-ZApd4XGf2v0-abM@z> 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