From: Kai Tietz Date: Mon, 7 Apr 2008 12:44:14 +0000 (+0000) Subject: i386.c (legitimize_pic_address): Add treating of dllimport SYM_REF's. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8502420b678709358d5993bb6ed5d72eb3fd4353;p=gcc.git i386.c (legitimize_pic_address): Add treating of dllimport SYM_REF's. 2008-04-07 Kai Tietz PR/35842 * config/i386/i386.c (legitimize_pic_address): Add treating of dllimport SYM_REF's. (legitimize_dllimport_symbol): Add prototype. From-SVN: r133981 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b4e1c51dabb..83c9493b89c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-04-07 Kai Tietz + + PR/35842 + * config/i386/i386.c (legitimize_pic_address): Add treating + of dllimport SYM_REF's. + (legitimize_dllimport_symbol): Add prototype. + 2008-04-07 Eric Botcazou * fold-const.c (fold) : New case. Try to fold constant diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 161f9e4fbd1..59d06c4fdd8 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see #include "params.h" static int x86_builtin_vectorization_cost (bool); +static rtx legitimize_dllimport_symbol (rtx, bool); #ifndef CHECK_STACK_LIMIT #define CHECK_STACK_LIMIT (-1) @@ -7660,10 +7661,18 @@ legitimize_pic_address (rtx orig, rtx reg) see gotoff_operand. */ || (TARGET_VXWORKS_RTP && GET_CODE (addr) == LABEL_REF)) { - /* Given that we've already handled dllimport variables separately - in legitimize_address, and all other variables should satisfy - legitimate_pic_address_disp_p, we should never arrive here. */ - gcc_assert (!TARGET_64BIT_MS_ABI); + if (TARGET_DLLIMPORT_DECL_ATTRIBUTES) + { + if (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_DLLIMPORT_P (addr)) + return legitimize_dllimport_symbol (addr, true); + if (GET_CODE (addr) == CONST && GET_CODE (XEXP (addr, 0)) == PLUS + && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF + && SYMBOL_REF_DLLIMPORT_P (XEXP (XEXP (addr, 0), 0))) + { + rtx t = legitimize_dllimport_symbol (XEXP (XEXP (addr, 0), 0), true); + return gen_rtx_PLUS (Pmode, t, XEXP (XEXP (addr, 0), 1)); + } + } if (TARGET_64BIT && ix86_cmodel != CM_LARGE_PIC) {