diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2010-11-14 10:29:15 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2010-11-14 10:29:15 +0000 |
commit | 8a7a250d322e4913add44c4bd6d854d25650d389 (patch) | |
tree | 63392bf86d394b857bfc2fdecba35d98613ce065 /gcc | |
parent | f0852409765073db85d8e804cf2aaf2bf9e6453a (diff) | |
download | gcc-8a7a250d322e4913add44c4bd6d854d25650d389.zip gcc-8a7a250d322e4913add44c4bd6d854d25650d389.tar.gz gcc-8a7a250d322e4913add44c4bd6d854d25650d389.tar.bz2 |
mips.c (machine_function): Remove initialized_mips16_gp_pseudo_p.
gcc/
* config/mips/mips.c (machine_function): Remove
initialized_mips16_gp_pseudo_p.
(mips16_gp_pseudo_reg): Use cfun->machine->mips16_gp_pseudo_rtx to
detect whether a pseudo has already been created. Unconditionally
create a new one if not.
(mips_pic_base_register): Only call mips16_gp_pseudo_reg when
expanding to rtl. Create a new pseudo otherwise, if allowed.
From-SVN: r166729
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 20 |
2 files changed, 16 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 44e051f..d1aef39 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2010-11-14 Richard Sandiford <rdsandiford@googlemail.com> + + * config/mips/mips.c (machine_function): Remove + initialized_mips16_gp_pseudo_p. + (mips16_gp_pseudo_reg): Use cfun->machine->mips16_gp_pseudo_rtx to + detect whether a pseudo has already been created. Unconditionally + create a new one if not. + (mips_pic_base_register): Only call mips16_gp_pseudo_reg when + expanding to rtl. Create a new pseudo otherwise, if allowed. + 2010-11-13 Richard Earnshaw <rearnsha@arm.com> PR target/43440 diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 242cc27..6e7d500 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -374,10 +374,6 @@ struct GTY(()) machine_function { split_insns pass; see mips_must_initialize_gp_p () for details. */ bool must_restore_gp_when_clobbered_p; - /* True if we have emitted an instruction to initialize - mips16_gp_pseudo_rtx. */ - bool initialized_mips16_gp_pseudo_p; - /* True if this is an interrupt handler. */ bool interrupt_handler_p; @@ -2654,16 +2650,11 @@ static rtx mips16_gp_pseudo_reg (void) { if (cfun->machine->mips16_gp_pseudo_rtx == NULL_RTX) - cfun->machine->mips16_gp_pseudo_rtx = gen_reg_rtx (Pmode); - - /* Don't emit an instruction to initialize the pseudo register if - we are being called from the tree optimizers' cost-calculation - routines. */ - if (!cfun->machine->initialized_mips16_gp_pseudo_p - && (current_ir_type () != IR_GIMPLE || currently_expanding_to_rtl)) { rtx insn, scan; + cfun->machine->mips16_gp_pseudo_rtx = gen_reg_rtx (Pmode); + push_topmost_sequence (); scan = get_insns (); @@ -2674,8 +2665,6 @@ mips16_gp_pseudo_reg (void) emit_insn_after (insn, scan); pop_topmost_sequence (); - - cfun->machine->initialized_mips16_gp_pseudo_p = true; } return cfun->machine->mips16_gp_pseudo_rtx; @@ -2690,9 +2679,12 @@ mips_pic_base_register (rtx temp) if (!TARGET_MIPS16) return pic_offset_table_rtx; - if (can_create_pseudo_p ()) + if (currently_expanding_to_rtl) return mips16_gp_pseudo_reg (); + if (can_create_pseudo_p ()) + temp = gen_reg_rtx (Pmode); + if (TARGET_USE_GOT) /* The first post-reload split exposes all references to $gp (both uses and definitions). All references must remain |