[MIPS, committed] Fix rtl checking failure in gcc.dg/pr27531-1.c

Richard Sandiford rdsandiford@googlemail.com
Mon Aug 19 17:36:00 GMT 2013


gcc.dg/pr27531-1.c was failing with rtl checking enabled for -mips16 -mabi=32
on mips64-linux-gnu.  The problem was that mips_adjust_insn_length didn't cope
properly with the new(ish) JUMP_TABLE_DATA rtx, which has no insn code.

Tested on mips64-linux-gnu and applied.

Richard


gcc/
	* config/mips/mips.c (mips_adjust_insn_length): Add checks for
	JUMP_P and INSN_P.

Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c	2013-08-13 08:57:15.711421748 +0100
+++ gcc/config/mips/mips.c	2013-08-18 21:00:01.382816765 +0100
@@ -12297,6 +12297,7 @@ mips_adjust_insn_length (rtx insn, int l
   /* mips.md uses MAX_PIC_BRANCH_LENGTH as a placeholder for the length
      of a PIC long-branch sequence.  Substitute the correct value.  */
   if (length == MAX_PIC_BRANCH_LENGTH
+      && JUMP_P (insn)
       && INSN_CODE (insn) >= 0
       && get_attr_type (insn) == TYPE_BRANCH)
     {
@@ -12318,7 +12319,9 @@ mips_adjust_insn_length (rtx insn, int l
     length += TARGET_MIPS16 ? 2 : 4;
 
   /* See how many nops might be needed to avoid hardware hazards.  */
-  if (!cfun->machine->ignore_hazard_length_p && INSN_CODE (insn) >= 0)
+  if (!cfun->machine->ignore_hazard_length_p
+      && INSN_P (insn)
+      && INSN_CODE (insn) >= 0)
     switch (get_attr_hazard (insn))
       {
       case HAZARD_NONE:



More information about the Gcc-patches mailing list