OSDN Git Service

From Jie Zhang <jie.zhang@analog.com>:
[pf3gnuchains/gcc-fork.git] / gcc / recog.c
index 9b88c66..c1e25d7 100644 (file)
@@ -389,6 +389,8 @@ verify_changes (int num)
             assemblies if they have been defined as register asm ("x").  */
          break;
        }
+      else if (DEBUG_INSN_P (object))
+       continue;
       else if (insn_invalid_p (object))
        {
          rtx pat = PATTERN (object);
@@ -429,7 +431,8 @@ verify_changes (int num)
              validate_change (object, &PATTERN (object), newpat, 1);
              continue;
            }
-         else if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER)
+         else if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER
+                  || GET_CODE (pat) == VAR_LOCATION)
            /* If this insn is a CLOBBER or USE, it is always valid, but is
               never recognized.  */
            continue;
@@ -738,6 +741,17 @@ validate_replace_rtx_1 (rtx *loc, rtx from, rtx to, rtx object,
     simplify_while_replacing (loc, to, object, op0_mode);
 }
 
+/* Try replacing every occurrence of FROM in subexpression LOC of INSN
+   with TO.  After all changes have been made, validate by seeing
+   if INSN is still valid.  */
+
+int
+validate_replace_rtx_subexp (rtx from, rtx to, rtx insn, rtx *loc)
+{
+  validate_replace_rtx_1 (loc, from, to, insn, true);
+  return apply_change_group ();
+}
+
 /* Try replacing every occurrence of FROM in INSN with TO.  After all
    changes have been made, validate by seeing if INSN is still valid.  */
 
@@ -2028,6 +2042,7 @@ extract_insn (rtx insn)
     case ASM_INPUT:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
+    case VAR_LOCATION:
       return;
 
     case SET:
@@ -3108,7 +3123,7 @@ peephole2_optimize (void)
       for (insn = BB_END (bb); ; insn = prev)
        {
          prev = PREV_INSN (insn);
-         if (INSN_P (insn))
+         if (NONDEBUG_INSN_P (insn))
            {
              rtx attempt, before_try, x;
              int match_len;