summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-26 06:08:48 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-26 06:08:48 +0000
commit7be9cf34730bc4c652297872e2a8ecd367e5e965 (patch)
treebcba3cef0778f2f0b0d3e849894990e81a56635a
parent9b46e58b5f991b44214160833eb1ee64fdc43718 (diff)
downloadgcc-7be9cf34730bc4c652297872e2a8ecd367e5e965.tar.gz
* expr.c (emit_move_insn_1): If there is no move pattern for the
original mode, try using a pattern for the corresponding integer mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71816 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expr.c11
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6ead1c02d1b..534e99b493a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2003-09-26 Richard Sandiford <rsandifo@redhat.com>
+ * expr.c (emit_move_insn_1): If there is no move pattern for the
+ original mode, try using a pattern for the corresponding integer mode.
+
+2003-09-26 Richard Sandiford <rsandifo@redhat.com>
+
* combine.c (if_then_else_cond): Tighten mode check.
2003-09-25 Nathanael Nerode <neroden@gcc.gnu.org>
diff --git a/gcc/expr.c b/gcc/expr.c
index 633f4a75537..6ad93c506ab 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3491,6 +3491,17 @@ emit_move_insn_1 (rtx x, rtx y)
return emit_insn (GEN_FCN (insn_code) (x, y));
}
+ /* Try using a move pattern for the corresponding integer mode. This is
+ only safe when simplify_subreg can convert MODE constants into integer
+ constants. At present, it can only do this reliably if the value
+ fits within a HOST_WIDE_INT. */
+ else if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
+ && (submode = int_mode_for_mode (mode)) != BLKmode
+ && mov_optab->handlers[submode].insn_code != CODE_FOR_nothing)
+ return emit_insn (GEN_FCN (mov_optab->handlers[submode].insn_code)
+ (simplify_gen_subreg (submode, x, mode, 0),
+ simplify_gen_subreg (submode, y, mode, 0)));
+
/* This will handle any multi-word or full-word mode that lacks a move_insn
pattern. However, you will get better code if you define such patterns,
even if they must turn into multiple assembler instructions. */