aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorSteve Ellcey <sje@cup.hp.com>2009-11-30 22:06:19 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2009-11-30 22:06:19 +0000
commitf7ce0951b70d925d2c10e8927afdf74fea2669f1 (patch)
treefb16f209e57818115437c91ffbfdfdfbcbf18c3d /gcc/function.c
parentd64728cf05af8eeb2c26c9cc97f8cbb774b39093 (diff)
downloadgcc-f7ce0951b70d925d2c10e8927afdf74fea2669f1.zip
gcc-f7ce0951b70d925d2c10e8927afdf74fea2669f1.tar.gz
gcc-f7ce0951b70d925d2c10e8927afdf74fea2669f1.tar.bz2
function.c (instantiate_virtual_regs_in_insn): Copy to new reg before forcing mode.
2009-11-30 Steve Ellcey <sje@cup.hp.com> Jakub Jelinek <jakub@redhat.com> * function.c (instantiate_virtual_regs_in_insn): Copy to new reg before forcing mode. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r154843
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c8
1 files changed, 7 insertions, 1 deletions
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)