aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-09-08 11:58:14 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-09-08 11:58:14 -0700
commit431a6ecab3b51c825ecd2f5ad591ca858e4b296a (patch)
treee090dd1ae2b9f0053ff35ad0bab9fd7ba6a7f51c /gcc
parent054b53fe7434be28ba19504ba5c2e8a9928d794f (diff)
downloadgcc-431a6ecab3b51c825ecd2f5ad591ca858e4b296a.zip
gcc-431a6ecab3b51c825ecd2f5ad591ca858e4b296a.tar.gz
gcc-431a6ecab3b51c825ecd2f5ad591ca858e4b296a.tar.bz2
(convert_move): When truncating, call force_reg first if
it is something that gen_lowpart won't understand. From-SVN: r5287
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index cb48acd..0404c6b 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -870,6 +870,13 @@ convert_move (to, from, unsignedp)
if (GET_MODE_BITSIZE (from_mode) > BITS_PER_WORD
&& GET_MODE_BITSIZE (to_mode) <= BITS_PER_WORD)
{
+ if (!((GET_CODE (from) == MEM
+ && ! MEM_VOLATILE_P (from)
+ && direct_load[(int) to_mode]
+ && ! mode_dependent_address_p (XEXP (from, 0)))
+ || GET_CODE (from) == REG
+ || GET_CODE (from) == SUBREG))
+ from = force_reg (from_mode, from);
convert_move (to, gen_lowpart (word_mode, from), 0);
return;
}