From: Richard Sandiford Date: Thu, 5 Jun 2008 16:33:42 +0000 (+0000) Subject: mips.c (mips_emit_loadgp): Return early if there is nothing do to... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76fb21a07a7eef585abe81d5b97a0ea674fbdee1;p=thirdparty%2Fgcc.git mips.c (mips_emit_loadgp): Return early if there is nothing do to... gcc/ * config/mips/mips.c (mips_emit_loadgp): Return early if there is nothing do to, otherwise emit a blockage if !TARGET_EXPLICIT_RELOCS || current_function_profile. * config/mips/mips.md (loadgp_blockage): Use SI rather than DI. From-SVN: r136407 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index acb6ecd4b007..fd5a9ff3f933 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-06-05 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 || current_function_profile. + * config/mips/mips.md (loadgp_blockage): Use SI rather than DI. + 2008-05-29 Eric Botcazou * tree-nested.c (check_for_nested_with_variably_modified): Fix typo. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 1abbe49355b3..ff020bf9349f 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -6709,13 +6709,16 @@ mips_emit_loadgp (void) offset = mips_unspec_address (addr, SYMBOL_GOTOFF_LOADGP); incoming_address = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM); emit_insn (gen_loadgp (offset, incoming_address)); - 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 || current_function_profile) + emit_insn (gen_loadgp_blockage ()); } /* Set up the stack and frame (if desired) for the function. */ diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index f22043416b4a..6a940d53ad16 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -4037,12 +4037,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" "unknown")