xtensa.c (call_insn_operand): Check SYMBOL_REF_EXTERNAL_P in addition to SYMBOL_REF_L...
authorBob Wilson <bob.wilson@acm.org>
Tue, 27 Apr 2004 22:47:56 +0000 (22:47 +0000)
committerBob Wilson <bwilson@gcc.gnu.org>
Tue, 27 Apr 2004 22:47:56 +0000 (22:47 +0000)
* 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

gcc/ChangeLog
gcc/config/xtensa/xtensa.c
gcc/config/xtensa/xtensa.h
gcc/config/xtensa/xtensa.md

index 7bd874a..b72cf39 100644 (file)
@@ -1,3 +1,10 @@
+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>
 
        * gthr-win32.h (__gthread_mutex_t): Change typedef to new structure.
index 6c059ff..d110368 100644 (file)
@@ -572,7 +572,8 @@ call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
        {
          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;
 
          /* Don't attempt a direct call if the callee is known to be in
index 3d2432b..d04560b 100644 (file)
@@ -1060,7 +1060,8 @@ typedef struct xtensa_args
    operand on the target machine when generating position independent
    code.  */
 #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) != CONST)
 
index 6e13568..0b557c1 100644 (file)
   ""
 {
   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);
   if (!call_insn_operand (addr, VOIDmode))
     XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, addr);
   ""
 {
   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);
   if (!call_insn_operand (addr, VOIDmode))
     XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, addr);