From 27f8bb476f5a2aa91dc8078c566cf2c6bc36cbc5 Mon Sep 17 00:00:00 2001 From: rsandifo Date: Mon, 2 Jun 2008 21:13:20 +0000 Subject: [PATCH] gcc/ * config/mips/mips.c (mips_emit_loadgp): Return early if there is nothing do to, otherwise emit a blockage if !TARGET_EXPLICIT_RELOCS || crtl->profile. * config/mips/mips.md (loadgp_blockage): Use SI rather than DI. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136294 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/mips/mips.c | 11 ++++++----- gcc/config/mips/mips.md | 3 +-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7edcf2ef94a..8db8a555253 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-06-02 Richard Sandiford + + * config/mips/mips.c (mips_emit_loadgp): Return early if + there is nothing do to, otherwise emit a blockage if + !TARGET_EXPLICIT_RELOCS || crtl->profile. + * config/mips/mips.md (loadgp_blockage): Use SI rather than DI. + 2008-06-02 Ralf Wildenhues * configure.ac: Drop unneeded backslash ending up in config.in. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 551159c9e94..41fc6d03009 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -8516,8 +8516,6 @@ mips_emit_loadgp (void) emit_insn (Pmode == SImode ? gen_loadgp_newabi_si (pic_reg, offset, incoming_address) : gen_loadgp_newabi_di (pic_reg, offset, incoming_address)); - if (!TARGET_EXPLICIT_RELOCS) - emit_insn (gen_loadgp_blockage ()); break; case LOADGP_RTP: @@ -8526,13 +8524,16 @@ mips_emit_loadgp (void) emit_insn (Pmode == SImode ? gen_loadgp_rtp_si (pic_reg, base, index) : gen_loadgp_rtp_di (pic_reg, base, index)); - if (!TARGET_EXPLICIT_RELOCS) - emit_insn (gen_loadgp_blockage ()); break; default: - break; + return; } + /* Emit a blockage if there are implicit uses of the GP register. + This includes profiled functions, because FUNCTION_PROFILE uses + a jal macro. */ + if (!TARGET_EXPLICIT_RELOCS || crtl->profile) + emit_insn (gen_loadgp_blockage ()); } /* Expand the "prologue" pattern. */ diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 3370d9958c8..29b8e703890 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -4350,12 +4350,11 @@ } [(set_attr "length" "8")]) -;; The use of gp is hidden when not using explicit relocations. ;; This blockage instruction prevents the gp load from being ;; scheduled after an implicit use of gp. It also prevents ;; the load from being deleted as dead. (define_insn "loadgp_blockage" - [(unspec_volatile [(reg:DI 28)] UNSPEC_BLOCKAGE)] + [(unspec_volatile [(reg:SI 28)] UNSPEC_BLOCKAGE)] "" "" [(set_attr "type" "ghost") -- 2.11.0