+2016-04-15 Bernd Schmidt <bschmidt@redhat.com>
+
+ * config/i386/i386-protos.h (ix86_using_red_zone): Declare.
+ * config/i386/i386.c (ix86_using_red_zone): No longer static.
+ * config/i386/i386.md (stack decrement to push peepholes): Guard
+ with !x86_using_red_zone ().
+
2016-04-15 Jakub Jelinek <jakub@redhat.com>
PR c++/70675
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
"(TARGET_SINGLE_PUSH || optimize_insn_for_size_p ())
- && INTVAL (operands[0]) == -GET_MODE_SIZE (word_mode)"
+ && INTVAL (operands[0]) == -GET_MODE_SIZE (word_mode)
+ && !ix86_using_red_zone ()"
[(clobber (match_dup 1))
(parallel [(set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1))
(clobber (mem:BLK (scratch)))])])
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))])]
"(TARGET_DOUBLE_PUSH || optimize_insn_for_size_p ())
- && INTVAL (operands[0]) == -2*GET_MODE_SIZE (word_mode)"
+ && INTVAL (operands[0]) == -2*GET_MODE_SIZE (word_mode)
+ && !ix86_using_red_zone ()"
[(clobber (match_dup 1))
(set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1))
(parallel [(set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1))
(match_operand:P 0 "const_int_operand")))
(clobber (reg:CC FLAGS_REG))])]
"(TARGET_SINGLE_PUSH || optimize_insn_for_size_p ())
- && INTVAL (operands[0]) == -GET_MODE_SIZE (word_mode)"
+ && INTVAL (operands[0]) == -GET_MODE_SIZE (word_mode)
+ && !ix86_using_red_zone ()"
[(clobber (match_dup 1))
(set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1))])
(match_operand:P 0 "const_int_operand")))
(clobber (reg:CC FLAGS_REG))])]
"(TARGET_DOUBLE_PUSH || optimize_insn_for_size_p ())
- && INTVAL (operands[0]) == -2*GET_MODE_SIZE (word_mode)"
+ && INTVAL (operands[0]) == -2*GET_MODE_SIZE (word_mode)
+ && !ix86_using_red_zone ()"
[(clobber (match_dup 1))
(set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1))
(set (mem:W (pre_dec:P (reg:P SP_REG))) (match_dup 1))])
/* These options are selected to ensure 1 word needs to be allocated
on the stack to maintain alignment for the call. This should be
transformed to push+pop. We also want to force unwind info updates. */
-/* { dg-options "-Os -fomit-frame-pointer -fasynchronous-unwind-tables" } */
+/* { dg-options "-Os -fomit-frame-pointer -fasynchronous-unwind-tables -mno-red-zone" } */
/* { dg-options "-Os -fomit-frame-pointer -mpreferred-stack-boundary=3 -fasynchronous-unwind-tables" { target ia32 } } */
/* ms_abi has reserved stack-region. */
/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */