- register is needed. (see mcore.md, addsi). -- DAC 4/2/1998 */
- /*
- if (CONST_OK_FOR_J(INTVAL(op)) || CONST_OK_FOR_L(INTVAL(op)))
- return 1;
- */
+ register is needed. (see mcore.md, addsi). -- DAC 4/2/1998
+
+ if (CONST_OK_FOR_J (INTVAL (op)) || CONST_OK_FOR_L (INTVAL (op)))
+ return 1;
+
+ However we do still need to check to make sure that the constant is not too
+ big, especially if we are running on a 64-bit OS... Nickc 8/1/07. */
+
+ if (trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
+ return 0;
+
+ return 1;
+