From: Jeffrey A Law Date: Wed, 10 Jun 1998 01:14:54 +0000 (+0000) Subject: reload.c (find_reloads_toplev): Use gen_lowpart common to convert between constant... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0365438d33268e5541586feb37fd1e490e1a874c;p=gcc.git reload.c (find_reloads_toplev): Use gen_lowpart common to convert between constant representations when... * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 18b99650e55..8f0f748b185 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 * h8300.c (get_shift_alg): Add special cases for shifts of 8 and 24. diff --git a/gcc/reload.c b/gcc/reload.c index 1604a7b0ba0..172fa67340e 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -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