This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: PR target/49860: [x32] Error: cannot represent relocation type BFD_RELOC_64 in x32 mode
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org, Uros Bizjak <ubizjak at gmail dot com>
- Date: Tue, 26 Jul 2011 21:31:41 -0700
- Subject: PATCH: PR target/49860: [x32] Error: cannot represent relocation type BFD_RELOC_64 in x32 mode
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
The offsetted memory references always work for x32. OK for trunk?
Thanks.
H.J.
----
2011-07-26 H.J. Lu <hongjiu.lu@intel.com>
PR target/49860
* config/i386/predicates.md (x86_64_immediate_operand): Always
allow the offsetted memory references for TARGET_X32.
(x86_64_zext_immediate_operand): Likewise.
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 0515519..7dc690a 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -197,8 +197,10 @@
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)
+ && (TARGET_X32
+ || (offset < 16*1024*1024
+ && (trunc_int_for_mode (offset, SImode)
+ == offset))))
return true;
/* For CM_KERNEL we know that all object resist in the
negative half of 32bits address space. We may not
@@ -302,8 +304,11 @@
|| (ix86_cmodel == CM_MEDIUM
&& !SYMBOL_REF_FAR_ADDR_P (op1)))
&& CONST_INT_P (op2)
- && trunc_int_for_mode (INTVAL (op2), DImode) > -0x10000
- && trunc_int_for_mode (INTVAL (op2), SImode) == INTVAL (op2))
+ && (TARGET_X32
+ || ((trunc_int_for_mode (INTVAL (op2), DImode)
+ > -0x10000)
+ && (trunc_int_for_mode (INTVAL (op2), SImode)
+ == INTVAL (op2)))))
return true;
/* ??? For the kernel, we may accept adjustment of
-0x10000000, since we know that it will just convert