This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Fix length of mips16 calls
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 15 Jul 2004 20:31:17 +0100
- Subject: [committed] Fix length of mips16 calls
I noticed while testing another patch that we underestimated the length
of calls when generating mips16 code. Calls, like other unconditional
branches, do have a delay slot in mips16 code. The comment was right,
but the code was wrong.
Tested on mips64vrel-elf. Bootstrapped & regression tested on
mips64{,el}-linux-gnu. Applied to trunk.
Richard
* config/mips/mips.c (mips_adjust_insn_length): Fix handling of
calls in mips16 code.
Index: config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.433
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.433 mips.c
*** config/mips/mips.c 14 Jul 2004 10:02:30 -0000 1.433
--- config/mips/mips.c 14 Jul 2004 10:39:17 -0000
*************** mips_adjust_insn_length (rtx insn, int l
*** 8969,8977 ****
/* A unconditional jump has an unfilled delay slot if it is not part
of a sequence. A conditional jump normally has a delay slot, but
does not on MIPS16. */
! if (simplejump_p (insn)
! || (!TARGET_MIPS16 && (GET_CODE (insn) == JUMP_INSN
! || GET_CODE (insn) == CALL_INSN)))
length += 4;
/* See how many nops might be needed to avoid hardware hazards. */
--- 8969,8975 ----
/* A unconditional jump has an unfilled delay slot if it is not part
of a sequence. A conditional jump normally has a delay slot, but
does not on MIPS16. */
! if (CALL_P (insn) || (TARGET_MIPS16 ? simplejump_p (insn) : JUMP_P (insn)))
length += 4;
/* See how many nops might be needed to avoid hardware hazards. */