diff options
author | Kai Tietz <kai.tietz@onevision.com> | 2008-04-07 12:44:14 +0000 |
---|---|---|
committer | Kai Tietz <ktietz@gcc.gnu.org> | 2008-04-07 14:44:14 +0200 |
commit | 8502420b678709358d5993bb6ed5d72eb3fd4353 (patch) | |
tree | e8e25cb45abe08a61536c01c031f44a7a742f6dc /gcc/config | |
parent | cd035e343a0a5c5930bba6d8584072dcce27a1aa (diff) | |
download | gcc-8502420b678709358d5993bb6ed5d72eb3fd4353.zip gcc-8502420b678709358d5993bb6ed5d72eb3fd4353.tar.gz gcc-8502420b678709358d5993bb6ed5d72eb3fd4353.tar.bz2 |
i386.c (legitimize_pic_address): Add treating of dllimport SYM_REF's.
2008-04-07 Kai Tietz <kai.tietz@onevision.com>
PR/35842
* config/i386/i386.c (legitimize_pic_address): Add treating
of dllimport SYM_REF's.
(legitimize_dllimport_symbol): Add prototype.
From-SVN: r133981
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 161f9e4..59d06c4 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) { |