This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Use JUMP_TABLE_DATA_P instead of JUMP_P and GET_CODE tests
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 28 Mar 2013 00:16:27 +0100
- Subject: Re: [patch] Use JUMP_TABLE_DATA_P instead of JUMP_P and GET_CODE tests
- References: <CABu31nO7mQ2URsxtxmzrKN-iV17m=G+zdH5Y5ePQDmFeJugdfQ at mail dot gmail dot com>
On Sat, Mar 23, 2013 at 5:15 PM, Steven Bosscher wrote:
> This patch replaces all tests I could find, where the code is looking
> for jump table data with GET_CODE(..)=ADDR_VEC and similar with
> JUMP_TABLE_DATA_P tests.
> Most replacements are mechanical, but a few are not:
> * The code in s390.c looked odd, I think the replacement code is
> easier to follow.
> * The changed in bfin.c and a few other places assume that ADDR_VEC
> and ADDR_DIFF_VEC can only appear as tablejump data. This appears to
> be assumed in many other places in the compiler (although AFAICT it's
> not documented as such) and it looks like the authors of the changed
> code simply omitted the JUMP_P test before looking at the pattern for
> an ADDR_VEC/ADDR_DIFF_VEC.
> BTW if ADDR_VEC/ADDR_DIFF_VEC really only appear in JUMP_TABLE_DATA_P
> insns then tests for these codes can be removed in all places where
> the insn being looked at must be in a basic block. That's almost all
> places in the middle-end proper (especially as case labels) and I
> intend to clean that up in a follow-up patch.
> But first...
> Bootstrapped&tested on powerpc64-unknown-linux-gnu and on
> OK for trunk?