This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch,committed] Fix PR/target 32313, MIPS bootstrap failure running gengtype in stage 2.
- From: David Daney <ddaney at avtrex dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 Jun 2007 10:47:19 -0700
- Subject: [Patch,committed] Fix PR/target 32313, MIPS bootstrap failure running gengtype in stage 2.
Committed as approved by Eric Christopher in the PR:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32313#c7
2007-06-18 David Daney <ddaney@avtrex.com
PR target/32313
* config/mips/mips.c (mips_expand_call): Mark $gp as used by
local function call.
Index: config/mips/mips.c
===================================================================
--- config/mips/mips.c (revision 125765)
+++ config/mips/mips.c (working copy)
@@ -3562,8 +3562,13 @@ mips_expand_call (rtx result, rtx addr,
insn = emit_call_insn (pattern);
- /* Lazy-binding stubs require $gp to be valid on entry. */
- if (mips_ok_for_lazy_binding_p (orig_addr))
+ /* Lazy-binding stubs require $gp to be valid on entry. So does the
+ case of calling a local function with TARGET_ABICALLS and
+ -mno-shared (a.k.a. TARGET_ABSOLUTE_ABICALLS). */
+ if (mips_ok_for_lazy_binding_p (orig_addr)
+ || (TARGET_ABSOLUTE_ABICALLS
+ && (GET_CODE (orig_addr) == SYMBOL_REF)
+ && targetm.binds_local_p (SYMBOL_REF_DECL (orig_addr))))
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
}