OSDN Git Service

* expmed.c (store_bit_field): Prevent generation of CONCATs;
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Mar 2002 08:13:04 +0000 (08:13 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Mar 2002 08:13:04 +0000 (08:13 +0000)
        pun complex values as integers; use gen_lowpart instead of
        gen_rtx_SUBREG.
        (extract_bit_field): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50185 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expmed.c

index 00ced4e..df3eded 100644 (file)
@@ -1,3 +1,10 @@
+2002-02-28  Richard Henderson  <rth@redhat.com>
+
+       * expmed.c (store_bit_field): Prevent generation of CONCATs;
+       pun complex values as integers; use gen_lowpart instead of
+       gen_rtx_SUBREG.
+       (extract_bit_field): Likewise.
+
 2002-03-01  Alan Modra  <amodra@bigpond.net.au>
            David Edelsohn  <edelsohn@gnu.org>
 
index 46007a3..6f9a939 100644 (file)
@@ -325,7 +325,12 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size)
   value = protect_from_queue (value, 0);
 
   if (flag_force_mem)
-    value = force_not_mem (value);
+    {
+      int old_generating_concat_p = generating_concat_p;
+      generating_concat_p = 0;
+      value = force_not_mem (value);
+      generating_concat_p = old_generating_concat_p;
+    }
 
   /* If the target is a register, overwriting the entire object, or storing
      a full-word or multi-word field can be done with just a SUBREG.
@@ -519,12 +524,9 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size)
      corresponding size.  This can occur on a machine with 64 bit registers
      that uses SFmode for float.  This can also occur for unaligned float
      structure fields.  */
-  if (GET_MODE_CLASS (GET_MODE (value)) == MODE_FLOAT)
-    {
-      if (GET_CODE (value) != REG)
-       value = copy_to_reg (value);
-      value = gen_rtx_SUBREG (word_mode, value, 0);
-    }
+  if (GET_MODE_CLASS (GET_MODE (value)) != MODE_INT
+      && GET_MODE_CLASS (GET_MODE (value)) != MODE_PARTIAL_INT)
+    value = gen_lowpart (word_mode, value);
 
   /* Now OFFSET is nonzero only if OP0 is memory
      and is therefore always measured in bytes.  */
@@ -1516,14 +1518,13 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp,
       /* If the target mode is floating-point, first convert to the
         integer mode of that size and then access it as a floating-point
         value via a SUBREG.  */
-      if (GET_MODE_CLASS (tmode) == MODE_FLOAT)
+      if (GET_MODE_CLASS (tmode) != MODE_INT
+         && GET_MODE_CLASS (tmode) != MODE_PARTIAL_INT)
        {
          target = convert_to_mode (mode_for_size (GET_MODE_BITSIZE (tmode),
                                                   MODE_INT, 0),
                                    target, unsignedp);
-         if (GET_CODE (target) != REG)
-           target = copy_to_reg (target);
-         return gen_rtx_SUBREG (tmode, target, 0);
+         return gen_lowpart (tmode, target);
        }
       else
        return convert_to_mode (tmode, target, unsignedp);