From 508940bebe9d116a1452c1c0b515201929d0738f Mon Sep 17 00:00:00 2001 From: Jonathan Yong <10walls@gmail.com> Date: Sat, 28 Jun 2014 09:52:21 +0800 Subject: [PATCH 15/24] handle dllimport properly in medium model --- gcc/config/i386/predicates.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index 2ef1384..3fc6104 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -164,6 +164,7 @@ switch (XINT (XEXP (op, 0), 1)) { case UNSPEC_GOTPCREL: + if (TARGET_PECOFF) break; case UNSPEC_DTPOFF: case UNSPEC_GOTNTPOFF: case UNSPEC_NTPOFF: @@ -268,6 +269,10 @@ /* TLS symbols are not constant. */ if (SYMBOL_REF_TLS_MODEL (op)) return false; + /* Dll-imported symbols are always external. */ + if (TARGET_DLLIMPORT_DECL_ATTRIBUTES && SYMBOL_REF_DLLIMPORT_P (op)) + return false; + return (ix86_cmodel == CM_SMALL || (ix86_cmodel == CM_MEDIUM && !SYMBOL_REF_FAR_ADDR_P (op))); -- 2.1.1