Commit f1dfe704 by Bob Wilson Committed by Bob Wilson

xtensa.c (call_insn_operand): Check SYMBOL_REF_EXTERNAL_P in addition to SYMBOL_REF_LOCAL_P.

	* config/xtensa/xtensa.c (call_insn_operand): Check
	SYMBOL_REF_EXTERNAL_P in addition to SYMBOL_REF_LOCAL_P.
	* config/xtensa/xtensa.h (LEGITIMATE_PIC_OPERAND): Likewise.
	* config/xtensa/xtensa.md (call, call_value): Likewise.

From-SVN: r81228
parent 80408cac
2004-04-27 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.c (call_insn_operand): Check
SYMBOL_REF_EXTERNAL_P in addition to SYMBOL_REF_LOCAL_P.
* config/xtensa/xtensa.h (LEGITIMATE_PIC_OPERAND): Likewise.
* config/xtensa/xtensa.md (call, call_value): Likewise.
2004-04-27 Wu Yongwei <adah@sh163.net> 2004-04-27 Wu Yongwei <adah@sh163.net>
* gthr-win32.h (__gthread_mutex_t): Change typedef to new structure. * gthr-win32.h (__gthread_mutex_t): Change typedef to new structure.
......
...@@ -572,7 +572,8 @@ call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) ...@@ -572,7 +572,8 @@ call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{ {
tree callee, callee_sec, caller_sec; tree callee, callee_sec, caller_sec;
if (GET_CODE (op) != SYMBOL_REF || !SYMBOL_REF_LOCAL_P (op)) if (GET_CODE (op) != SYMBOL_REF
|| !SYMBOL_REF_LOCAL_P (op) || SYMBOL_REF_EXTERNAL_P (op))
return FALSE; return FALSE;
/* Don't attempt a direct call if the callee is known to be in /* Don't attempt a direct call if the callee is known to be in
......
...@@ -1060,7 +1060,8 @@ typedef struct xtensa_args ...@@ -1060,7 +1060,8 @@ typedef struct xtensa_args
operand on the target machine when generating position independent operand on the target machine when generating position independent
code. */ code. */
#define LEGITIMATE_PIC_OPERAND_P(X) \ #define LEGITIMATE_PIC_OPERAND_P(X) \
((GET_CODE (X) != SYMBOL_REF || SYMBOL_REF_LOCAL_P (X)) \ ((GET_CODE (X) != SYMBOL_REF \
|| (SYMBOL_REF_LOCAL_P (X) && !SYMBOL_REF_EXTERNAL_P (X))) \
&& GET_CODE (X) != LABEL_REF \ && GET_CODE (X) != LABEL_REF \
&& GET_CODE (X) != CONST) && GET_CODE (X) != CONST)
......
...@@ -1999,7 +1999,8 @@ ...@@ -1999,7 +1999,8 @@
"" ""
{ {
rtx addr = XEXP (operands[0], 0); rtx addr = XEXP (operands[0], 0);
if (flag_pic && GET_CODE (addr) == SYMBOL_REF && !SYMBOL_REF_LOCAL_P (addr)) if (flag_pic && GET_CODE (addr) == SYMBOL_REF
&& (!SYMBOL_REF_LOCAL_P (addr) || SYMBOL_REF_EXTERNAL_P (addr)))
addr = gen_sym_PLT (addr); addr = gen_sym_PLT (addr);
if (!call_insn_operand (addr, VOIDmode)) if (!call_insn_operand (addr, VOIDmode))
XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, addr); XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, addr);
...@@ -2023,7 +2024,8 @@ ...@@ -2023,7 +2024,8 @@
"" ""
{ {
rtx addr = XEXP (operands[1], 0); rtx addr = XEXP (operands[1], 0);
if (flag_pic && GET_CODE (addr) == SYMBOL_REF && !SYMBOL_REF_LOCAL_P (addr)) if (flag_pic && GET_CODE (addr) == SYMBOL_REF
&& (!SYMBOL_REF_LOCAL_P (addr) || SYMBOL_REF_EXTERNAL_P (addr)))
addr = gen_sym_PLT (addr); addr = gen_sym_PLT (addr);
if (!call_insn_operand (addr, VOIDmode)) if (!call_insn_operand (addr, VOIDmode))
XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, addr); XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, addr);
......
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