summaryrefslogtreecommitdiff
path: root/gcc/config/i386/predicates.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/i386/predicates.md')
-rw-r--r--gcc/config/i386/predicates.md15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 292d46e52fe..f8ff8049d0f 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -110,7 +110,8 @@
/* TLS symbols are not constant. */
if (tls_symbolic_operand (op, Pmode))
return false;
- return (ix86_cmodel == CM_SMALL || ix86_cmodel == CM_KERNEL);
+ return (ix86_cmodel == CM_SMALL || ix86_cmodel == CM_KERNEL
+ || (ix86_cmodel == CM_MEDIUM && !SYMBOL_REF_FAR_ADDR_P (op)));
case LABEL_REF:
/* For certain code models, the code is near as well. */
@@ -150,7 +151,9 @@
end of 31bits boundary. We may also accept pretty
large negative constants knowing that all objects are
in the positive half of address space. */
- if (ix86_cmodel == CM_SMALL
+ if ((ix86_cmodel == CM_SMALL
+ || (ix86_cmodel == CM_MEDIUM
+ && !SYMBOL_REF_FAR_ADDR_P (op1)))
&& offset < 16*1024*1024
&& trunc_int_for_mode (offset, SImode) == offset)
return 1;
@@ -224,7 +227,9 @@
/* TLS symbols are not constant. */
if (tls_symbolic_operand (op, Pmode))
return false;
- return ix86_cmodel == CM_SMALL;
+ return (ix86_cmodel == CM_SMALL
+ || (ix86_cmodel == CM_MEDIUM
+ && !SYMBOL_REF_FAR_ADDR_P (op)));
case LABEL_REF:
/* For certain code models, the code is near as well. */
@@ -247,7 +252,9 @@
offsets, since one bit is available for free. Negative
offsets are limited by the size of NULL pointer area
specified by the ABI. */
- if (ix86_cmodel == CM_SMALL
+ if ((ix86_cmodel == CM_SMALL
+ || (ix86_cmodel == CM_MEDIUM
+ && !SYMBOL_REF_FAR_ADDR_P (op1)))
&& GET_CODE (op2) == CONST_INT
&& trunc_int_for_mode (INTVAL (op2), DImode) > -0x10000
&& trunc_int_for_mode (INTVAL (op2), SImode) == INTVAL (op2))