aboutsummaryrefslogtreecommitdiff
path: root/gcc/regmove.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-10-10 16:03:44 +0000
committerJeff Law <law@gcc.gnu.org>1998-10-10 10:03:44 -0600
commit937e37cc6e345ed695b7bb5b9d58e2ba403fe427 (patch)
treea0186dcc34dc8e70af183411fc3bdd7a33f9780b /gcc/regmove.c
parent3aeab4377c353ea79fce325761a12892980412d5 (diff)
downloadgcc-937e37cc6e345ed695b7bb5b9d58e2ba403fe427.zip
gcc-937e37cc6e345ed695b7bb5b9d58e2ba403fe427.tar.gz
gcc-937e37cc6e345ed695b7bb5b9d58e2ba403fe427.tar.bz2
* regmove.c (optimize_reg_copy_3): Honor TRULY_NOOP_TRUNCATION.
From-SVN: r22977
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 41235f1..35ddf12 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);