MIPS branch out of range
Jeffrey A Law
law@upchuck.cygnus.com
Mon May 31 21:06:00 GMT 1999
In message < 199905241931.MAA01491@pizda.davem.net >you write:
> Date: Mon, 24 May 1999 12:29:00 -0700
> From: Jim Wilson <wilson@cygnus.com>
>
> We can avoid the problem by measuring instruction lengths in bytes
> instead of instruction counts.
>
> So, in essence, the issue is that branch shortening speaks the
> language of bytes and therefore this is the language the instruction
> length values should speak as well, correct?
Effectively, yes.
In addition to Jim's loop alignment example, I believe the code to compute
the size of ADDR_VEC/ADDR_DIFF_VEC counts them as bytes based on the mode
of the ADDR_DIFF.
This is what finally caused me to bite the bullet and fix the PA -- each
ADDR_VEC entry is 8 bytes (2 insns). Unfortunately the backend was counting
instructions. So the branch shortening code over-estimated the size of each
jump table by 4x. That over-estimation was adding up and causing long
branches instead of short ones in some code the UofU found important.
jeff
More information about the Gcc-bugs
mailing list