On Tue, May 28, 2013 at 10:39 PM, Steven Bosscher <[email protected]> wrote:
> On Tue, May 28, 2013 at 9:36 PM, Richard Sandiford
> <[email protected]> wrote:
>> Hi Steven,
>>
>> Steven Bosscher <[email protected]> writes:
>>> Imho the active-insn "idiom" is the best solution for the moment. I
>>> will fix this mess properly asap, probably next week.
>>
>> Just wondering, how are things going with this? (I assume fixing it
>> properly means getting rid of the FIXME in next_active_insn?)
>
> Yes, it involves getting this to work:
And I can't get it to fail. I also can't find any place where the
label and jump table might get separated. I was expecting some trouble
with cross-jumping but it seems that it takes care of updating the
label reference, and skip_insns_after_block already expects the label
and table to be adjacent.
So let's just see if/what breaks...
Bootstrapped&tested on powerpc64-unknown-linux-gnu (unix{,-m32}).
Bootstrapped&tested on x86_64-unknown-linux-gnu (unix{,-m32}).
Build&tested powerpc64 X mips-elf.
OK for trunk?
If it causes any trouble, please file a PR and assign it to me.
And when the dust has settled, I can clean up the FIXME for
JUMP_TABLE_DATA in next_active_insn, and fix up the back ends.
Ciao!
Steven
* rtlanal.c (tablejump_p): Expect table and label to be adjacent.
Index: rtlanal.c
===================================================================
--- rtlanal.c (revision 199324)
+++ rtlanal.c (working copy)
@@ -2711,6 +2711,7 @@ tablejump_p (const_rtx insn, rtx *labelp, rtx *tab
&& (table = next_active_insn (label)) != NULL_RTX
&& JUMP_TABLE_DATA_P (table))
{
+ gcc_assert (table == NEXT_INSN (label));
if (labelp)
*labelp = label;
if (tablep)