OSDN Git Service

(__objc_send_message_in_list): When setting a new entry in
[pf3gnuchains/gcc-fork.git] / gcc / recog.c
index 5e78336..888a2f5 100644 (file)
@@ -961,8 +961,12 @@ general_operand (op, mode)
 #endif
       /* Avoid memories with nonzero SUBREG_BYTE, as offsetting the memory
          may result in incorrect reference.  We should simplify all valid
-         subregs of MEM anyway.  */
-      if (SUBREG_BYTE (op) && GET_CODE (SUBREG_REG (op)) == MEM)
+         subregs of MEM anyway.  But allow this after reload because we
+        might be called from cleanup_subreg_operands. 
+
+        ??? This is a kludge.  */
+      if (!reload_completed && SUBREG_BYTE (op) != 0
+         && GET_CODE (SUBREG_REG (op)) == MEM)
         return 0;
 
       op = SUBREG_REG (op);
@@ -1141,9 +1145,16 @@ immediate_operand (op, mode)
 int
 const_int_operand (op, mode)
      register rtx op;
-     enum machine_mode mode ATTRIBUTE_UNUSED;
+     enum machine_mode mode;
 {
-  return GET_CODE (op) == CONST_INT;
+  if (GET_CODE (op) != CONST_INT)
+    return 0;
+
+  if (mode != VOIDmode
+      && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
+    return 0;
+
+  return 1;
 }
 
 /* Returns 1 if OP is an operand that is a constant integer or constant