From 3dc4195c6a0777d896bdd5c11691d80c54064bbe Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 31 Jul 1992 08:15:14 -0400 Subject: [PATCH] (convert_move): Put FROM into a register if it is a SUBREG. From-SVN: r1732 --- gcc/expr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/expr.c b/gcc/expr.c index 1e4191f9bb0..8bb7e41d740 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -705,6 +705,12 @@ convert_move (to, from, unsignedp) if ((code = can_extend_p (to_mode, from_mode, unsignedp)) != CODE_FOR_nothing) { + /* If FROM is a SUBREG, put it into a register. Do this + so that we always generate the same set of insns for + better cse'ing; if an intermediate assignment occurred, + we won't be doing the operation directly on the SUBREG. */ + if (optimize > 0 && GET_CODE (from) == SUBREG) + from = force_reg (from_mode, from); emit_unop_insn (code, to, from, equiv_code); return; } -- 2.30.2