diff options
author | J"orn Rennecke <amylaar@cygnus.co.uk> | 1998-02-09 19:39:35 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 1998-02-09 19:39:35 +0000 |
commit | 2fd0af53a1498e221236a5f63cb1700420006c67 (patch) | |
tree | 779a35f1417b6e7f4e3c864e530815c72d8d5e57 | |
parent | a96c354489da8ca6529d8c4c31e5b42b81d591fa (diff) | |
download | gcc-2fd0af53a1498e221236a5f63cb1700420006c67.zip gcc-2fd0af53a1498e221236a5f63cb1700420006c67.tar.gz gcc-2fd0af53a1498e221236a5f63cb1700420006c67.tar.bz2 |
reload.c (find_reloads_toplev): Handle arbitrary non-paradoxical SUBREGs of CONST_INTs.
* reload.c (find_reloads_toplev): Handle arbitrary non-paradoxical
SUBREGs of CONST_INTs.
From-SVN: r17809
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/reload.c | 25 |
2 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8b8eaa7..56cd65e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 10 03:35:43 1998 J"orn Rennecke <amylaar@cygnus.co.uk> + + * reload.c (find_reloads_toplev): Handle arbitrary non-paradoxical + SUBREGs of CONST_INTs. + Mon Feb 9 17:52:36 1998 John Carr <jfc@mit.edu> * mips.c (print_operand, function_prologue): Make printf format diff --git a/gcc/reload.c b/gcc/reload.c index 6006357..22c8c4e 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -1,5 +1,5 @@ /* Search an insn for pseudo regs that must be in hard regs and are not. - Copyright (C) 1987, 88, 89, 92-6, 1997 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 89, 92-7, 1998 Free Software Foundation, Inc. This file is part of GNU CC. @@ -4163,6 +4163,29 @@ find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest) GET_MODE (SUBREG_REG (x)))) != 0) 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 + for a 16 bit target, or a DImode SUBREG of a TImode SUBREG_REG for + a 32 bit target. We still can - and have to - handle this + for non-paradoxical subregs of CONST_INTs. */ + if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0 + && reg_equiv_constant[regno] != 0 + && GET_CODE (reg_equiv_constant[regno]) == CONST_INT + && (GET_MODE_SIZE (GET_MODE (x)) + < GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))) + { + int shift = SUBREG_WORD (x) * BITS_PER_WORD; + if (WORDS_BIG_ENDIAN) + shift = (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) + - GET_MODE_BITSIZE (GET_MODE (x)) + - shift); + /* Here we use the knowledge that CONST_INTs have a + HOST_WIDE_INT field. */ + if (shift >= HOST_BITS_PER_WIDE_INT) + shift = HOST_BITS_PER_WIDE_INT - 1; + return GEN_INT (INTVAL (reg_equiv_constant[regno]) >> shift); + } + if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0 && reg_equiv_constant[regno] != 0 && GET_MODE (reg_equiv_constant[regno]) == VOIDmode) |