Commit de9f679d by Richard Sandiford Committed by Richard Sandiford

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 || crtl->profile.
	* config/mips/mips.md (loadgp_blockage): Use SI rather than DI.

From-SVN: r136294
parent 34523524
2008-06-02 Richard Sandiford <rdsandiford@googlemail.com>
* 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 <Ralf.Wildenhues@gmx.de> 2008-06-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure.ac: Drop unneeded backslash ending up in config.in. * configure.ac: Drop unneeded backslash ending up in config.in.
......
...@@ -8516,8 +8516,6 @@ mips_emit_loadgp (void) ...@@ -8516,8 +8516,6 @@ mips_emit_loadgp (void)
emit_insn (Pmode == SImode emit_insn (Pmode == SImode
? gen_loadgp_newabi_si (pic_reg, offset, incoming_address) ? gen_loadgp_newabi_si (pic_reg, offset, incoming_address)
: gen_loadgp_newabi_di (pic_reg, offset, incoming_address)); : gen_loadgp_newabi_di (pic_reg, offset, incoming_address));
if (!TARGET_EXPLICIT_RELOCS)
emit_insn (gen_loadgp_blockage ());
break; break;
case LOADGP_RTP: case LOADGP_RTP:
...@@ -8526,13 +8524,16 @@ mips_emit_loadgp (void) ...@@ -8526,13 +8524,16 @@ mips_emit_loadgp (void)
emit_insn (Pmode == SImode emit_insn (Pmode == SImode
? gen_loadgp_rtp_si (pic_reg, base, index) ? gen_loadgp_rtp_si (pic_reg, base, index)
: gen_loadgp_rtp_di (pic_reg, base, index)); : gen_loadgp_rtp_di (pic_reg, base, index));
if (!TARGET_EXPLICIT_RELOCS)
emit_insn (gen_loadgp_blockage ());
break; break;
default: 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. */ /* Expand the "prologue" pattern. */
......
...@@ -4350,12 +4350,11 @@ ...@@ -4350,12 +4350,11 @@
} }
[(set_attr "length" "8")]) [(set_attr "length" "8")])
;; The use of gp is hidden when not using explicit relocations.
;; This blockage instruction prevents the gp load from being ;; This blockage instruction prevents the gp load from being
;; scheduled after an implicit use of gp. It also prevents ;; scheduled after an implicit use of gp. It also prevents
;; the load from being deleted as dead. ;; the load from being deleted as dead.
(define_insn "loadgp_blockage" (define_insn "loadgp_blockage"
[(unspec_volatile [(reg:DI 28)] UNSPEC_BLOCKAGE)] [(unspec_volatile [(reg:SI 28)] UNSPEC_BLOCKAGE)]
"" ""
"" ""
[(set_attr "type" "ghost") [(set_attr "type" "ghost")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment