Commit 2de710b9 by Eric Botcazou Committed by Eric Botcazou

cygming.h (STACK_CHECK_STATIC_BUILTIN): Define to 1.

	* config/i386/cygming.h (STACK_CHECK_STATIC_BUILTIN): Define to 1.
	* config/i386/freebsd.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
	* config/i386/linux.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
	* config/i386/linux64.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
	* config/i386/sol2.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
	* config/i386/i386.c (ix86_gen_adjust_stack_and_probe): New variable.
	(ix86_gen_probe_stack_range): Likewise.
	(override_options): Set them.
	(ix86_target_stack_probe): New function.
	(ix86_compute_frame_layout): Force use of push instructions to
	save registers if stack checking with probes is enabled.
	(get_scratch_register_on_entry): New function.
	(release_scratch_register_on_entry): Likewise.
	(ix86_adjust_stack_and_probe): Likewise.
	(output_adjust_stack_and_probe): Likewise.
	(ix86_emit_probe_stack_range): Likewise.
	(output_probe_stack_range): Likewise.
	(ix86_expand_prologue): Emit stack checking code if static built-in
	stack checking is enabled.
	Test ix86_target_stack_probe instead of TARGET_STACK_PROBE.
	* config/i386/i386-protos.h (ix86_target_stack_probe): Declare.
	(output_adjust_stack_and_probe): Likewise.
	(output_probe_stack_range): Likewise.
	* config/i386/i386.md (UNSPECV_PROBE_STACK_RANGE): New constant.
	(allocate_stack_worker_32): Test ix86_target_stack_probe instead of
	TARGET_STACK_PROBE.
	(allocate_stack_worker_64): Likewise.
	(allocate_stack): Likewise.
	(adjust_stack_and_probe): New insn.
	(probe_stack_range): Likewise.

From-SVN: r161952
parent f076deba
2010-07-08 Eric Botcazou <ebotcazou@adacore.com>
* config/i386/cygming.h (STACK_CHECK_STATIC_BUILTIN): Define to 1.
* config/i386/freebsd.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
* config/i386/linux.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
* config/i386/linux64.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
* config/i386/sol2.h (STACK_CHECK_STATIC_BUILTIN): Likewise.
* config/i386/i386.c (ix86_gen_adjust_stack_and_probe): New variable.
(ix86_gen_probe_stack_range): Likewise.
(override_options): Set them.
(ix86_target_stack_probe): New function.
(ix86_compute_frame_layout): Force use of push instructions to
save registers if stack checking with probes is enabled.
(get_scratch_register_on_entry): New function.
(release_scratch_register_on_entry): Likewise.
(ix86_adjust_stack_and_probe): Likewise.
(output_adjust_stack_and_probe): Likewise.
(ix86_emit_probe_stack_range): Likewise.
(output_probe_stack_range): Likewise.
(ix86_expand_prologue): Emit stack checking code if static built-in
stack checking is enabled.
Test ix86_target_stack_probe instead of TARGET_STACK_PROBE.
* config/i386/i386-protos.h (ix86_target_stack_probe): Declare.
(output_adjust_stack_and_probe): Likewise.
(output_probe_stack_range): Likewise.
* config/i386/i386.md (UNSPECV_PROBE_STACK_RANGE): New constant.
(allocate_stack_worker_32): Test ix86_target_stack_probe instead of
TARGET_STACK_PROBE.
(allocate_stack_worker_64): Likewise.
(allocate_stack): Likewise.
(adjust_stack_and_probe): New insn.
(probe_stack_range): Likewise.
2010-07-08 Richard Guenther <rguenther@suse.de> 2010-07-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/44831 PR tree-optimization/44831
......
...@@ -429,6 +429,9 @@ do { \ ...@@ -429,6 +429,9 @@ do { \
#define TARGET_CXX_ADJUST_CLASS_AT_DEFINITION i386_pe_adjust_class_at_definition #define TARGET_CXX_ADJUST_CLASS_AT_DEFINITION i386_pe_adjust_class_at_definition
#define TARGET_MANGLE_DECL_ASSEMBLER_NAME i386_pe_mangle_decl_assembler_name #define TARGET_MANGLE_DECL_ASSEMBLER_NAME i386_pe_mangle_decl_assembler_name
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
#undef TREE #undef TREE
#ifndef BUFSIZ #ifndef BUFSIZ
......
...@@ -138,3 +138,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -138,3 +138,6 @@ along with GCC; see the file COPYING3. If not see
compiler get the contents of <float.h> and std::numeric_limits correct. */ compiler get the contents of <float.h> and std::numeric_limits correct. */
#undef TARGET_96_ROUND_53_LONG_DOUBLE #undef TARGET_96_ROUND_53_LONG_DOUBLE
#define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT) #define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT)
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
...@@ -24,6 +24,7 @@ extern void override_options (bool); ...@@ -24,6 +24,7 @@ extern void override_options (bool);
extern void optimization_options (int, int); extern void optimization_options (int, int);
extern void ix86_conditional_register_usage (void); extern void ix86_conditional_register_usage (void);
extern bool ix86_target_stack_probe (void);
extern int ix86_can_use_return_insn_p (void); extern int ix86_can_use_return_insn_p (void);
extern void ix86_setup_frame_addresses (void); extern void ix86_setup_frame_addresses (void);
...@@ -71,6 +72,8 @@ extern const char *output_387_binary_op (rtx, rtx*); ...@@ -71,6 +72,8 @@ extern const char *output_387_binary_op (rtx, rtx*);
extern const char *output_387_reg_move (rtx, rtx*); extern const char *output_387_reg_move (rtx, rtx*);
extern const char *output_fix_trunc (rtx, rtx*, int); extern const char *output_fix_trunc (rtx, rtx*, int);
extern const char *output_fp_compare (rtx, rtx*, int, int); extern const char *output_fp_compare (rtx, rtx*, int, int);
extern const char *output_adjust_stack_and_probe (rtx);
extern const char *output_probe_stack_range (rtx, rtx);
extern void ix86_expand_clear (rtx); extern void ix86_expand_clear (rtx);
extern void ix86_expand_move (enum machine_mode, rtx[]); extern void ix86_expand_move (enum machine_mode, rtx[]);
......
...@@ -233,6 +233,7 @@ ...@@ -233,6 +233,7 @@
(define_c_enum "unspecv" [ (define_c_enum "unspecv" [
UNSPECV_BLOCKAGE UNSPECV_BLOCKAGE
UNSPECV_STACK_PROBE UNSPECV_STACK_PROBE
UNSPECV_PROBE_STACK_RANGE
UNSPECV_EMMS UNSPECV_EMMS
UNSPECV_LDMXCSR UNSPECV_LDMXCSR
UNSPECV_STMXCSR UNSPECV_STMXCSR
...@@ -16441,7 +16442,7 @@ ...@@ -16441,7 +16442,7 @@
UNSPECV_STACK_PROBE)) UNSPECV_STACK_PROBE))
(set (reg:SI SP_REG) (minus:SI (reg:SI SP_REG) (match_dup 1))) (set (reg:SI SP_REG) (minus:SI (reg:SI SP_REG) (match_dup 1)))
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"!TARGET_64BIT && TARGET_STACK_PROBE" "!TARGET_64BIT && ix86_target_stack_probe ()"
"call\t___chkstk" "call\t___chkstk"
[(set_attr "type" "multi") [(set_attr "type" "multi")
(set_attr "length" "5")]) (set_attr "length" "5")])
...@@ -16454,7 +16455,7 @@ ...@@ -16454,7 +16455,7 @@
(clobber (reg:DI R10_REG)) (clobber (reg:DI R10_REG))
(clobber (reg:DI R11_REG)) (clobber (reg:DI R11_REG))
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && TARGET_STACK_PROBE" "TARGET_64BIT && ix86_target_stack_probe ()"
"call\t___chkstk" "call\t___chkstk"
[(set_attr "type" "multi") [(set_attr "type" "multi")
(set_attr "length" "5")]) (set_attr "length" "5")])
...@@ -16462,7 +16463,7 @@ ...@@ -16462,7 +16463,7 @@
(define_expand "allocate_stack" (define_expand "allocate_stack"
[(match_operand 0 "register_operand" "") [(match_operand 0 "register_operand" "")
(match_operand 1 "general_operand" "")] (match_operand 1 "general_operand" "")]
"TARGET_STACK_PROBE" "ix86_target_stack_probe ()"
{ {
rtx x; rtx x;
...@@ -16509,6 +16510,28 @@ ...@@ -16509,6 +16510,28 @@
DONE; DONE;
}) })
(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")]
UNSPECV_PROBE_STACK_RANGE))
(set (reg:P SP_REG)
(minus:P (reg:P SP_REG) (match_operand:P 2 "const_int_operand" "n")))
(clobber (reg:CC FLAGS_REG))
(clobber (mem:BLK (scratch)))]
""
"* return output_adjust_stack_and_probe (operands[0]);"
[(set_attr "type" "multi")])
(define_insn "probe_stack_range<mode>"
[(set (match_operand:P 0 "register_operand" "=r")
(unspec_volatile:P [(match_operand:P 1 "register_operand" "0")
(match_operand:P 2 "const_int_operand" "n")]
UNSPECV_PROBE_STACK_RANGE))
(clobber (reg:CC FLAGS_REG))]
""
"* return output_probe_stack_range (operands[0], operands[2]);"
[(set_attr "type" "multi")])
(define_expand "builtin_setjmp_receiver" (define_expand "builtin_setjmp_receiver"
[(label_ref (match_operand 0 "" ""))] [(label_ref (match_operand 0 "" ""))]
"!TARGET_64BIT && flag_pic" "!TARGET_64BIT && flag_pic"
......
...@@ -209,6 +209,9 @@ along with GCC; see the file COPYING3. If not see ...@@ -209,6 +209,9 @@ along with GCC; see the file COPYING3. If not see
/* The stack pointer needs to be moved while checking the stack. */ /* The stack pointer needs to be moved while checking the stack. */
#define STACK_CHECK_MOVING_SP 1 #define STACK_CHECK_MOVING_SP 1
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
/* This macro may be overridden in i386/k*bsd-gnu.h. */ /* This macro may be overridden in i386/k*bsd-gnu.h. */
#define REG_NAME(reg) reg #define REG_NAME(reg) reg
......
...@@ -112,6 +112,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ...@@ -112,6 +112,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* The stack pointer needs to be moved while checking the stack. */ /* The stack pointer needs to be moved while checking the stack. */
#define STACK_CHECK_MOVING_SP 1 #define STACK_CHECK_MOVING_SP 1
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
/* This macro may be overridden in i386/k*bsd-gnu.h. */ /* This macro may be overridden in i386/k*bsd-gnu.h. */
#define REG_NAME(reg) reg #define REG_NAME(reg) reg
......
...@@ -154,6 +154,9 @@ along with GCC; see the file COPYING3. If not see ...@@ -154,6 +154,9 @@ along with GCC; see the file COPYING3. If not see
#undef X86_FILE_START_VERSION_DIRECTIVE #undef X86_FILE_START_VERSION_DIRECTIVE
#define X86_FILE_START_VERSION_DIRECTIVE false #define X86_FILE_START_VERSION_DIRECTIVE false
/* Static stack checking is supported by means of probes. */
#define STACK_CHECK_STATIC_BUILTIN 1
/* Only recent versions of Solaris 11 ld properly support hidden .gnu.linkonce /* Only recent versions of Solaris 11 ld properly support hidden .gnu.linkonce
sections, so don't use them. */ sections, so don't use them. */
#ifndef TARGET_GNU_LD #ifndef TARGET_GNU_LD
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment