reload.c (find_reloads_toplev): Use gen_lowpart common to convert between constant...
authorJeffrey A Law <law@cygnus.com>
Wed, 10 Jun 1998 01:14:54 +0000 (01:14 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 10 Jun 1998 01:14:54 +0000 (19:14 -0600)
        * reload.c (find_reloads_toplev): Use gen_lowpart common to convert
        between constant representations when we have (SUBREG (REG)) with
        REG equivalent to a constant.

From-SVN: r20398

gcc/ChangeLog
gcc/reload.c

index 18b99650e55889bf4ef02730a69e87bdba6ba00b..8f0f748b185870be5ef0bf03409f7da592166872 100644 (file)
@@ -1,3 +1,9 @@
+Wed Jun 10 02:11:55 1998  Jeffrey A Law  (law@cygnus.com)
+
+       * reload.c (find_reloads_toplev): Use gen_lowpart common to convert
+       between constant representations when we have (SUBREG (REG)) with
+       REG equivalent to a constant.
+
 Wed Jun 10 01:39:00 1998  Juha Sarlin <juha@c3l.tyreso.se> 
 
        * h8300.c (get_shift_alg): Add special cases for shifts of 8 and 24.
index 1604a7b0ba0ec9b8802c6c483c9bea383aaedce1..172fa67340eb5111d08d954edebce1762e5eb19c 100644 (file)
@@ -4289,7 +4289,18 @@ find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest)
          && (tem = operand_subword (reg_equiv_constant[regno],
                                     SUBREG_WORD (x), 0,
                                     GET_MODE (SUBREG_REG (x)))) != 0)
-       return tem;
+       {
+         /* TEM is now a word sized constant for the bits from X that
+            we wanted.  However, TEM may be the wrong representation.
+
+            Use gen_lowpart_common to convert a CONST_INT into a
+            CONST_DOUBLE and vice versa as needed according to by the mode
+            of the SUBREG.  */
+         tem = gen_lowpart_common (GET_MODE (x), tem);
+         if (!tem)
+           abort ();
+         return tem;
+       }
 
       /* If the SUBREG is wider than a word, the above test will fail.
         For example, we might have a SImode SUBREG of a DImode SUBREG_REG