summaryrefslogtreecommitdiff
path: root/gcc/regmove.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-10 16:03:44 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-10 16:03:44 +0000
commit5d92a54845c0cd1ca923744a5334b7459520f4ec (patch)
treea0186dcc34dc8e70af183411fc3bdd7a33f9780b /gcc/regmove.c
parent28bae3bfae2510c9f355d12bb59538b811582ee7 (diff)
downloadgcc-5d92a54845c0cd1ca923744a5334b7459520f4ec.tar.gz
* regmove.c (optimize_reg_copy_3): Honor TRULY_NOOP_TRUNCATION.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22977 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regmove.c')
-rw-r--r--gcc/regmove.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 41235f13704..35ddf12d6f3 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -552,6 +552,14 @@ optimize_reg_copy_3 (insn, dest, src)
|| GET_CODE (SET_SRC (set)) != MEM
|| SET_DEST (set) != src_reg)
return;
+
+ /* Do not use a SUBREG to truncate from one mode to another if truncation
+ is not a nop. */
+ if (GET_MODE_BITSIZE (GET_MODE (src_reg)) <= GET_MODE_BITSIZE (GET_MODE (src))
+ && !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (GET_MODE (src)),
+ GET_MODE_BITSIZE (GET_MODE (src_reg))))
+ return;
+
old_mode = GET_MODE (src_reg);
PUT_MODE (src_reg, GET_MODE (src));
XEXP (src, 0) = SET_SRC (set);