From f7ce0951b70d925d2c10e8927afdf74fea2669f1 Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Mon, 30 Nov 2009 22:06:19 +0000 Subject: function.c (instantiate_virtual_regs_in_insn): Copy to new reg before forcing mode. 2009-11-30 Steve Ellcey Jakub Jelinek * function.c (instantiate_virtual_regs_in_insn): Copy to new reg before forcing mode. Co-Authored-By: Jakub Jelinek From-SVN: r154843 --- gcc/function.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/function.c') diff --git a/gcc/function.c b/gcc/function.c index 88e036c..b8042d0 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1598,7 +1598,13 @@ instantiate_virtual_regs_in_insn (rtx insn) if (!safe_insn_predicate (insn_code, i, x)) { start_sequence (); - x = force_reg (insn_data[insn_code].operand[i].mode, x); + if (REG_P (x)) + { + gcc_assert (REGNO (x) <= LAST_VIRTUAL_REGISTER); + x = copy_to_reg (x); + } + else + x = force_reg (insn_data[insn_code].operand[i].mode, x); seq = get_insns (); end_sequence (); if (seq) -- cgit v1.1