diff mbox

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

Message ID CAEwic4a50Z4Jv1j-HVqQBVcKVR_z9VdD1BwYUgax2z9_H_tHBQ@mail.gmail.com
State New
Headers show

Commit Message

Kai Tietz Sept. 18, 2014, 10:14 p.m. UTC
Here it is. Hope I didn't made here typos.

Kai

Comments

FX Coudert Sept. 20, 2014, 4:22 p.m. UTC | #1
Hi Kai,

The patch you sent (copied below) does not fix the darwin regression. It still fails with the same ICE on attached valid code (in 64-bit mode; it compiles with -m32).

FX
> 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"
diff mbox

Patch

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"