mips.c (mips_adjust_insn_length): Add checks for JUMP_P and INSN_P.
authorRichard Sandiford <rdsandiford@googlemail.com>
Mon, 19 Aug 2013 17:29:59 +0000 (17:29 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 19 Aug 2013 17:29:59 +0000 (17:29 +0000)
gcc/
* config/mips/mips.c (mips_adjust_insn_length): Add checks for
JUMP_P and INSN_P.

From-SVN: r201847

gcc/ChangeLog
gcc/config/mips/mips.c

index dd6559d20171583a94967870c0282ea16d39a6e8..8c96b96a9112887efabeb3de2a1e50771bbde251 100644 (file)
@@ -1,3 +1,8 @@
+2013-08-19  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * config/mips/mips.c (mips_adjust_insn_length): Add checks for
+       JUMP_P and INSN_P.
+
 2013-08-19  Aldy Hernandez  <aldyh@redhat.com>
 
        * doc/invoke.texi (-fcilkplus): Clarify that implementation is
index 4da80f42e7b248aa61681dd0facc97844f30fa4f..5993aabe5781e1f6a010b4b0006d11dda3cda368 100644 (file)
@@ -12297,6 +12297,7 @@ mips_adjust_insn_length (rtx insn, int length)
   /* 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 length)
     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: