This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: Fix for x64 windows targets the split of PCREL unspecs
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Henderson <rth at redhat dot com>
- Date: Thu, 16 Feb 2012 13:23:04 +0100
- Subject: Re: [patch i386]: Fix for x64 windows targets the split of PCREL unspecs
- References: <CAEwic4ar+Lqfd86yiex-byvQgORKvU_XZJm+ZWX8L-8UqE3NbA@mail.gmail.com>
The hunk about config/i386/predicates.md (x86_64_immediate_operand) I
recet here,
actual it would lead to none-PIC code.
So updated patch:
2012-02-16 Kai Tietz <ktietz@redhat.com>
* config/i386/i386.c (legitimate_pic_address_disp_p): Allow
interger-constant displacement for UNSPEC_PCREL.
Tested for x86_64-w64-mingw32, and x86_64-unkown-linux-gnu for all
languages. Ok for apply?
Regards,
Kai
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 184304)
+++ config/i386/i386.c (working copy)
@@ -11823,6 +11823,13 @@
break;
if (GET_CODE (op0) == LABEL_REF)
return true;
+ if (GET_CODE (op0) == CONST
+ && GET_CODE (XEXP (op0, 0)) == UNSPEC
+ && XINT (XEXP (op0, 0), 1) == UNSPEC_PCREL)
+ return true;
+ if (GET_CODE (op0) == UNSPEC
+ && XINT (op0, 1) == UNSPEC_PCREL)
+ return true;
if (GET_CODE (op0) != SYMBOL_REF)
break;
/* FALLTHRU */