On Fri, Apr 29, 2016 at 9:58 AM, Eric Botcazou <ebotca...@adacore.com> wrote: >> We can put it back, but prehaps implemented as unspec, so it won't >> interfere with peepholes? > > No strong opinion, as long as the final assembly is the same as before.
I'm testing the attached patch. Does it fix your ada failures? Uros.
Index: i386.md =================================================================== --- i386.md (revision 235620) +++ i386.md (working copy) @@ -88,6 +88,7 @@ UNSPEC_SET_GOT_OFFSET UNSPEC_MEMORY_BLOCKAGE UNSPEC_STACK_CHECK + UNSPEC_PROBE_STACK ;; TLS support UNSPEC_TP @@ -17552,6 +17553,23 @@ DONE; }) +(define_expand "probe_stack" + [(parallel + [(set (match_operand 0 "memory_operand") + (unspec [(const_int 0)] UNSPEC_PROBE_STACK)) + (clobber (reg:CC FLAGS_REG))])]) + +;; Use OR for stack probes, this is shorter. +(define_insn "*probe_stack_<mode>" + [(set (match_operand:W 0 "memory_operand" "=m") + (unspec:W [(const_int 0)] UNSPEC_PROBE_STACK)) + (clobber (reg:CC FLAGS_REG))] + "" + "or{<imodesuffix>}\t{$0, %0|%0, 0}" + [(set_attr "type" "alu1") + (set_attr "mode" "<MODE>") + (set_attr "length_immediate" "1")]) + (define_insn "adjust_stack_and_probe<mode>" [(set (match_operand:P 0 "register_operand" "=r") (unspec_volatile:P [(match_operand:P 1 "register_operand" "0")]