aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-06-10 01:14:54 +0000
committerJeff Law <law@gcc.gnu.org>1998-06-09 19:14:54 -0600
commit0365438d33268e5541586feb37fd1e490e1a874c (patch)
tree431bc695301bcebe9110846311e9adda1846f827 /gcc/reload.c
parent93ec7bc577c7da136780a6a7e2196c7b6e1b9cc4 (diff)
downloadgcc-0365438d33268e5541586feb37fd1e490e1a874c.zip
gcc-0365438d33268e5541586feb37fd1e490e1a874c.tar.gz
gcc-0365438d33268e5541586feb37fd1e490e1a874c.tar.bz2
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
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index 1604a7b..172fa67 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