combine.c (expand_field_assignment): Don't do bitwise operations on MODE_FLOAT; pun...
authorRichard Henderson <rth@cygnus.com>
Sun, 4 Oct 1998 23:59:58 +0000 (16:59 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 4 Oct 1998 23:59:58 +0000 (16:59 -0700)
        * combine.c (expand_field_assignment): Don't do bitwise operations
        on MODE_FLOAT; pun to MODE_INT if possible.

From-SVN: r22826

gcc/ChangeLog
gcc/combine.c

index 8b04e882d092464d2805a9476f4671f3c1bc4410..7184fe45bdae224e99aeb42bb61ba7358d94a366 100644 (file)
@@ -1,3 +1,8 @@
+Sun Oct  4 23:58:30 1998  Richard Henderson  <rth@cygnus.com>
+
+       * combine.c (expand_field_assignment): Don't do bitwise operations
+       on MODE_FLOAT; pun to MODE_INT if possible.
+
 Sun Oct  4 18:33:24 1998  Jason Merrill  <jason@yorick.cygnus.com>
                          scott snyder  <snyder@d0sgif.fnal.gov>
 
index e2a0095a1db23625ef6bb7f9974bfced604a5a2c..ce488e294c41ea561defed7633ad9e973963bde9 100644 (file)
@@ -5384,6 +5384,24 @@ expand_field_assignment (x)
 
       compute_mode = GET_MODE (inner);
 
+      /* Don't attempt bitwise arithmetic on non-integral modes.  */
+      if (! INTEGRAL_MODE_P (compute_mode))
+       {
+         enum machine_mode imode;
+
+         /* Something is probably seriously wrong if this matches.  */
+         if (! FLOAT_MODE_P (compute_mode))
+           break;
+
+         /* Try to find an integral mode to pun with.  */
+         imode = mode_for_size (GET_MODE_BITSIZE (compute_mode), MODE_INT, 0);
+         if (imode == BLKmode)
+           break;
+
+         compute_mode = imode;
+         inner = gen_lowpart_for_combine (imode, inner);
+       }
+
       /* Compute a mask of LEN bits, if we can do this on the host machine.  */
       if (len < HOST_BITS_PER_WIDE_INT)
        mask = GEN_INT (((HOST_WIDE_INT) 1 << len) - 1);