expr.c (expand_expr_real_1): Force subregs into a pseudo before applying gen_lowpart.
authorRichard Henderson <rth@redhat.com>
Thu, 1 Sep 2005 01:06:45 +0000 (18:06 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 1 Sep 2005 01:06:45 +0000 (18:06 -0700)
        * expr.c (expand_expr_real_1) <VIEW_CONVERT_EXPR>: Force subregs
        into a pseudo before applying gen_lowpart.

From-SVN: r103712

gcc/ChangeLog
gcc/expr.c

index 8cf77368a75b191541b9e29b9e60742c48994ca8..f887654193b2e70f824a3e5a303729467a6fe601 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-31  Richard Henderson  <rth@redhat.com>
+
+       * expr.c (expand_expr_real_1) <VIEW_CONVERT_EXPR>: Force subregs
+       into a pseudo before applying gen_lowpart.
+
 2005-08-31  Geoffrey Keating  <geoffk@apple.com>
 
        * doc/install.texi (Specific): Update cctools version required
index e44a54f9729898b97cd99e92ac42ef4da76ae44b..e5f5c3d05c14e3d9cae13ed96f4f981d347c77d4 100644 (file)
@@ -7544,7 +7544,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
       else if (TYPE_MODE (type) != BLKmode && GET_MODE (op0) != BLKmode
               && GET_MODE_SIZE (TYPE_MODE (type))
                   == GET_MODE_SIZE (GET_MODE (op0)))
-       op0 = gen_lowpart (TYPE_MODE (type), op0);
+       {
+         if (GET_CODE (op0) == SUBREG)
+           op0 = force_reg (GET_MODE (op0), op0);
+         op0 = gen_lowpart (TYPE_MODE (type), op0);
+       }
       /* If both modes are integral, then we can convert from one to the
         other.  */
       else if (SCALAR_INT_MODE_P (GET_MODE (op0))