combine.c (force_to_mode): Handle FLOAT_MODE destinations for CONST_INT.
authorRichard Henderson <rth@redhat.com>
Mon, 30 Sep 2002 03:26:47 +0000 (20:26 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 30 Sep 2002 03:26:47 +0000 (20:26 -0700)
        * combine.c (force_to_mode): Handle FLOAT_MODE destinations
        for CONST_INT.

From-SVN: r57634

gcc/ChangeLog
gcc/combine.c

index f265ac7c3c8a2999eeb91dc3644ad963375250b7..e0d7735f1166ebf75cb1319a34b530b4378da7f6 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-29  Richard Henderson  <rth@redhat.com>
+
+       * combine.c (force_to_mode): Handle FLOAT_MODE destinations
+       for CONST_INT.
+
 2002-09-29  David Edelsohn  <edelsohn@gnu.org>
 
        * real.h (ibm_extended_format): Declare.
index e735519ad12bdee2eaa0cedcce18893a3233ea54..ea12e05c2d2ceda4c6f3cf6bbc24665e7f26f945 100644 (file)
@@ -6817,12 +6817,20 @@ force_to_mode (x, mode, mask, reg, just_select)
 
   /* If none of the bits in X are needed, return a zero.  */
   if (! just_select && (nonzero & mask) == 0)
-    return const0_rtx;
+    x = const0_rtx;
 
   /* If X is a CONST_INT, return a new one.  Do this here since the
      test below will fail.  */
   if (GET_CODE (x) == CONST_INT)
-    return gen_int_mode (INTVAL (x) & mask, mode);
+    {
+      if (SCALAR_INT_MODE_P (mode))
+        return gen_int_mode (INTVAL (x) & mask, mode);
+      else
+       {
+         x = GEN_INT (INTVAL (x) & mask);
+         return gen_lowpart_common (mode, x);
+       }
+    }
 
   /* If X is narrower than MODE and we want all the bits in X's mode, just
      get X in the proper mode.  */