Richard Sandiford <[EMAIL PROTECTED]> writes: > Ian Lance Taylor <ian@airs.com> writes: > > Richard Sandiford <[EMAIL PROTECTED]> writes: > >> Huh. For the record: it can't. get_attr_length() returns 0 > >> for ADDR_VECs regardless of JUMP_IN_TEXT_SECTION. I'll update > >> the comment when applying the bug-fix patch to mainline. > > > > shorten_branches handles JUMP_TABLES_IN_TEXT_SECTION correctly. You > > don't need ADJUST_INSN_LENGTHS unless you need to call get_attr_length > > somewhere else. > > The code I mentioned isn't related to ADJUST_INSN_LENGTHS. > It's a subroutine of the mips16 constant layout code. > > As far as shorten_branches() goes: I realise that it handles text jump > tables correctly, but the mips16 layout code runs in reorg, before > shorten_branches() has been called. > > I suppose we could call shorten_branches() from the mips16 layout > code, but I don't like the idea of relying on the cached results of > shorten_branches() in a pass that is specifically supposed to > _increase_ the distance between things.
Sorry, I did misunderstand. I thought that bit of code was implementing ADJUST_INSN_LENGTH. I think this is a good reason to move the length calculation out of shorten_branches and into get_attr_length. Except one would have to be careful with CASE_VECTOR_SHORTEN_MODE. Ian