2014-06-18 12:24 GMT+02:00 Uros Bizjak <ubiz...@gmail.com>:
> Hello!
>
> Attached patch fixes recently added sibcall insns and their
> corresponding peephole2 patterns:
>
> - There is no need for new memory_nox32_operand. A generic
> memory_operand can be used, since new insns and peephole2 patterns
> should be disabled for TARGET_X32 entirely.
> - Adds missing "m" constraint in insn patterns.
> - Macroizes peephole2 patterns
> - Adds check that eliminated register is really dead after the call
> (maybe an overkill, but some hard-to-debug problems surfaced due to
> missing liveness checks in the past)
> - Fixes call RTXes in sibcall_pop related patterns (and fixes two
> newly introduced warnings in i386.md)
>
> 2014-06-18  Uros Bizjak  <ubiz...@gmail.com>
>
>     * config/i386/i386.md (*sibcall_memory): Rename from *sibcall_intern.
>     Do not use unspec as call operand.  Use memory_operand instead of
>     memory_nox32_operand and add "m" operand constraint.  Disable
>     pattern for TARGET_X32.
>     (*sibcall_pop_memory): Ditto.
>     (*sibcall_value_memory): Ditto.
>     (*sibcall_value_pop_memory): Ditto.
>     (sibcall peepholes): Merge SImode and DImode patterns using
>     W mode iterator.  Use memory_operand instead of memory_nox32_operand.
>     Disable pattern for TARGET_X32.  Check if eliminated register is
>     really dead after call insn.  Generate call RTX without unspec operand.
>     (sibcall_value peepholes): Ditto.
>     (sibcall_pop peepholes): Fix call insn RTXes.  Use memory_operand
>     instead of memory_nox32_operand.  Check if eliminated register is
>     really dead after call insn. Generate call RTX without unspec operand.
>     (sibcall_value_pop peepholes): Ditto.
>     * config/i386/predicates.md (memory_nox32_operand): Remove predicate.
>
> The patch was bootstrapped and regression tested on
> x86_64-pc-linux-gnu {,-m32} and was committed to mainline SVN.
>
> Uros.

The following change in predicates.md seems to be a bit premature.
There is still the point about Darwin's PIC issue for unspec-gotpcrel.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61387

  return ANY_QI_REG_P (op);
})

+;; Return true if OP is a memory operands that can be used in sibcalls.
(define_predicate "sibcall_memory_operand"
-  (match_operand 0 "memory_operand")
-{
-  return CONSTANT_P (XEXP (op, 0));
-})
+  (and (match_operand 0 "memory_operand")
+       (match_test "CONSTANT_P (XEXP (op, 0))")))

as we might to pessimize for Darwin UNSPEC_GOTPCREL at that point.
 In general there is still the question why this issue just happens
for Darwin, but not for linux.  For linux that gotpcrel-code path
seems not to be hit at all (at least is that what Ians told).

Kai

Reply via email to