diff options
author | Steve Ellcey <sje@cup.hp.com> | 2009-11-30 22:06:19 +0000 |
---|---|---|
committer | Steve Ellcey <sje@gcc.gnu.org> | 2009-11-30 22:06:19 +0000 |
commit | f7ce0951b70d925d2c10e8927afdf74fea2669f1 (patch) | |
tree | fb16f209e57818115437c91ffbfdfdfbcbf18c3d /gcc | |
parent | d64728cf05af8eeb2c26c9cc97f8cbb774b39093 (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/function.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 417e4b6..2ded17f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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. + 2009-11-30 Anatoly Sokolov <aesok@post.ru> * config/sh/sh.c (sh_promote_prototypes): Make static. 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) |