From: Bob Wilson Date: Tue, 27 Apr 2004 22:47:56 +0000 (+0000) Subject: xtensa.c (call_insn_operand): Check SYMBOL_REF_EXTERNAL_P in addition to SYMBOL_REF_L... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f1dfe7049d4c81118be3e7e53c007cce8be81021;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7bd874a42f5..b72cf396a23 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-04-27 Bob Wilson + + * 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 * gthr-win32.h (__gthread_mutex_t): Change typedef to new structure. diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 6c059ff6999..d1103681345 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -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 diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index 3d2432be9e1..d04560b8c7c 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -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) diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index 6e13568a651..0b557c12e8c 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -1999,7 +1999,8 @@ "" { 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); @@ -2023,7 +2024,8 @@ "" { 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);