diff --git a/gcc/recog.c b/gcc/recog.c
index a73d6d7ccd5ba6053766ff60ed7511f5e1f0624f..dd5318ba476cb30f8103b4db3cca642d7d40f199 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -512,7 +512,7 @@ validate_replace_rtx_1 (loc, from, to, object)
          separated from this function.  */
       if (GET_CODE (XEXP (x, 1)) == CONST_INT)
 	validate_change (object, loc,
-			 plus_constant (XEXP (x, 0), XEXP (x, 1)), 1);
+			 plus_constant (XEXP (x, 0), INTVAL (XEXP (x, 1))), 1);
       break;
     case MINUS:
       if (GET_CODE (XEXP (x, 1)) == CONST_INT