]> gcc.gnu.org Git - gcc.git/commitdiff
recog.c (general_operand, [...]): Require CONST_INTs to be sign-extended values for...
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 12 Apr 2001 05:25:55 +0000 (05:25 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 12 Apr 2001 05:25:55 +0000 (05:25 +0000)
* recog.c (general_operand, immediate_operand,
nonmemory_operand): Require CONST_INTs to be sign-extended
values for their modes.

From-SVN: r41286

gcc/ChangeLog
gcc/recog.c

index 83ec61933ce865cd36e9a091256af79d0f649f6b..20cf366553d255b9a8f01a64d8d7d78a84a128ce 100644 (file)
@@ -1,3 +1,9 @@
+2001-04-12  Alexandre Oliva  <aoliva@redhat.com>
+
+       * recog.c (general_operand, immediate_operand,
+       nonmemory_operand): Require CONST_INTs to be sign-extended
+       values for their modes.
+
 2001-04-12  Alexandre Oliva  <aoliva@redhat.com>
 
        * expmed.c (store_bit_field): Truncate CONST_INTs.
index bbecd5b719e10385c805680c43cb40ea3d036f10..1c9fdf90e6e467f407eaf266e396c87a6c6dcdcd 100644 (file)
@@ -1114,6 +1114,10 @@ general_operand (op, mode)
       && GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
     return 0;
 
+  if (GET_CODE (op) == CONST_INT
+      && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
+    return 0;
+
   if (CONSTANT_P (op))
     return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode
             || mode == VOIDmode)
@@ -1290,6 +1294,10 @@ immediate_operand (op, mode)
       && GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
     return 0;
 
+  if (GET_CODE (op) == CONST_INT
+      && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
+    return 0;
+
   /* Accept CONSTANT_P_RTX, since it will be gone by CSE1 and
      result in 0/1.  It seems a safe assumption that this is
      in range for everyone.  */
@@ -1361,6 +1369,10 @@ nonmemory_operand (op, mode)
          && GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
        return 0;
 
+      if (GET_CODE (op) == CONST_INT
+         && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
+       return 0;
+
       return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode
              || mode == VOIDmode)
 #ifdef LEGITIMATE_PIC_OPERAND_P
This page took 0.076835 seconds and 5 git commands to generate.