This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: Sibcall tail-call improvement and partial fix PR/60104
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: FX <fxcoudert at gmail dot com>
- Cc: Jeff Law <law at redhat dot com>, Iain Sandoe <iain at codesourcery dot com>, Mike Stump <mikestump at comcast dot net>, Kai Tietz <ktietz at redhat dot com>, Segher Boessenkool <segher at kernel dot crashing dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>
- Date: Fri, 19 Sep 2014 00:14:25 +0200
- Subject: Re: [patch i386]: Sibcall tail-call improvement and partial fix PR/60104
- Authentication-results: sourceware.org; auth=none
- References: <1478265243 dot 5697739 dot 1400792508558 dot JavaMail dot zimbra at redhat dot com> <AD1FD69F-389F-47A9-83F5-7584696E2677 at comcast dot net> <20140915004309 dot GA29543 at gate dot crashing dot org> <95EF5F55-098D-49F3-B6E6-79C1316D5148 at comcast dot net> <C2DD5222-FD32-407B-95DD-74E8D434A42C at codesourcery dot com> <A4344E8F-58D4-48A1-A9BC-B4C38378A1D9 at gmail dot com> <541708CF dot 2000708 at redhat dot com> <C7CEDD5C-EE8B-4B7F-A6CC-7983A1824BBB at gmail dot com> <CAEwic4bN5p+p+WTrwx00b9XJbXsre0CyyqK-VYGYexAtjgaBdQ at mail dot gmail dot com> <C9E55C41-5500-483F-9623-10D0E6C7761F at gmail dot com> <CAEwic4Y+sjNK-JURYZiK5W8Kq_MhZ6GV64mzQmOAhVdpGiXy0g at mail dot gmail dot com> <52368B3D-91AD-44CC-B451-9BEC03189625 at gmail dot com>
Here it is. Hope I didn't made here typos.
Kai
Index: config/i386/predicates.md
===================================================================
--- config/i386/predicates.md (Revision 215364)
+++ config/i386/predicates.md (Arbeitskopie)
@@ -73,8 +73,15 @@
;; Return true if OP is a memory operands that can be used in sibcalls.
(define_predicate "sibcall_memory_operand"
- (and (match_operand 0 "memory_operand")
- (match_test "CONSTANT_P (XEXP (op, 0))")))
+ (match_operand 0 "memory_operand")
+{
+ if (TARGET_MACHO && TARGET_64BIT
+ && GET_CODE (op) == CONST
+ && GET_CODE (XEXP (op, 0)) == UNSPEC
+ && XINT (XEXP (op, 0), 1) == UNSPEC_GOTPCREL)
+ return false;
+ return CONSTANT_P (XEXP (op, 0));
+})
;; Match an SI or HImode register for a zero_extract.
(define_special_predicate "ext_register_operand"