diff mbox

[i386] : Sibcall tail-call improvement and partial fix PR/60104

Message ID CAEwic4a09AxJ0AyYt=5tjP6cnPrUf7DW4Jt8HmgCzinR1STbMQ@mail.gmail.com
State New
Headers show

Commit Message

Kai Tietz Sept. 20, 2014, 5:52 p.m. UTC
Hi FX,

I missed that op points still on the memory here.  So corrected patch
is inlined below.

Kai

Comments

Mike Stump Sept. 22, 2014, 6:24 p.m. UTC | #1
On Sep 20, 2014, at 10:52 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> I missed that op points still on the memory here.  So corrected patch
> is inlined below.

So, I’m wondering if the x86 maintainers want me to review and approve a patch, or if they want to.  I was assuming they wanted to.
Uros Bizjak Sept. 22, 2014, 6:43 p.m. UTC | #2
On Mon, Sep 22, 2014 at 8:24 PM, Mike Stump <mikestump@comcast.net> wrote:
> On Sep 20, 2014, at 10:52 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>> I missed that op points still on the memory here.  So corrected patch
>> is inlined below.
>
> So, I’m wondering if the x86 maintainers want me to review and approve a patch, or if they want to.  I was assuming they wanted to.

As far as I'm concerned, this is Darwin specific  patch, so it needs
an approval from Darwin maintainer. The patch just happens to live in
i386 directory ;)

Thanks,
Uros.
Mike Stump Sept. 22, 2014, 6:46 p.m. UTC | #3
On Sep 22, 2014, at 11:43 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> As far as I'm concerned, this is Darwin specific  patch, so it needs
> an approval from Darwin maintainer. The patch just happens to live in
> i386 directory ;)

Ok, thanks.
diff mbox

Patch

Index: predicates.md
===================================================================
--- predicates.md       (Revision 215364)
+++ predicates.md       (Arbeitskopie)
@@ -73,9 +73,18 @@ 

 ;; 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")
+{
+  op = XEXP (op, 0);

+  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 (op);
+})
+
 ;; Match an SI or HImode register for a zero_extract.
 (define_special_predicate "ext_register_operand"
   (match_operand 0 "register_operand")