Commit b3d31392 by Andreas Krebbel Committed by Ulrich Weigand

s390.c (s390_backchain_string): Removed.

2004-11-23  Andreas Krebbel  <krebbel1@de.ibm.com>

	* config/s390/s390.c (s390_backchain_string): Removed.
	(s390_return_addr_rtx, s390_back_chain_rtx, s390_frame_info)
	(s390_emit_prologue, s390_va_start, s390_gimplify_va_arg):
	Changed users of TARGET_BACKCHAIN, TARGET_NO_BACKCHAIN and
	TARGET_KERNEL_BACKCHAIN to reflect the new options.
	* config/s390/s390.h (MASK_BACKCHAIN, MASK_PACKED_STACK): New macros.
	(TARGET_KERNEL_BACKCHAIN): Removed.
	(TARGET_BACKCHAIN): Former triple state option change to a target flag.
	(TARGET_PACKED_STACK): New macro.
	(TARGET_SWITCHES): New switches added.
	(TARGET_OPTIONS): "backchain", "no-backchain" and "kernel-backchain"
	removed.
	(DYNAMIC_CHAIN_ADDRESS): Use TARGET_PACKED_STACK.
	* config/s390/s390.md ("allocate_stack", "restore_stack_block")
	("save_stack_nonlocal", "restore_stack_nonlocal"): Modified to reflect
	the change in target switch semantics.
	* config/s390/tpf.h (TARGET_DEFAULT_BACKCHAIN): Removed.
	(TARGET_DEFAULT): MASK_BACKCHAIN added.
	* doc/invoke.texi: Added documentation for the new/changed options.

From-SVN: r91096
parent 27b28c6d
2004-11-23 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.c (s390_backchain_string): Removed.
(s390_return_addr_rtx, s390_back_chain_rtx, s390_frame_info)
(s390_emit_prologue, s390_va_start, s390_gimplify_va_arg):
Changed users of TARGET_BACKCHAIN, TARGET_NO_BACKCHAIN and
TARGET_KERNEL_BACKCHAIN to reflect the new options.
* config/s390/s390.h (MASK_BACKCHAIN, MASK_PACKED_STACK): New macros.
(TARGET_KERNEL_BACKCHAIN): Removed.
(TARGET_BACKCHAIN): Former triple state option change to a target flag.
(TARGET_PACKED_STACK): New macro.
(TARGET_SWITCHES): New switches added.
(TARGET_OPTIONS): "backchain", "no-backchain" and "kernel-backchain"
removed.
(DYNAMIC_CHAIN_ADDRESS): Use TARGET_PACKED_STACK.
* config/s390/s390.md ("allocate_stack", "restore_stack_block")
("save_stack_nonlocal", "restore_stack_nonlocal"): Modified to reflect
the change in target switch semantics.
* config/s390/tpf.h (TARGET_DEFAULT_BACKCHAIN): Removed.
(TARGET_DEFAULT): MASK_BACKCHAIN added.
* doc/invoke.texi: Added documentation for the new/changed options.
2004-11-23 Uros Bizjak <uros@kss-loka.si> 2004-11-23 Uros Bizjak <uros@kss-loka.si>
PR rtl-optimization/18614 PR rtl-optimization/18614
......
...@@ -205,10 +205,6 @@ enum processor_flags s390_arch_flags; ...@@ -205,10 +205,6 @@ enum processor_flags s390_arch_flags;
const char *s390_tune_string; /* for -mtune=<xxx> */ const char *s390_tune_string; /* for -mtune=<xxx> */
const char *s390_arch_string; /* for -march=<xxx> */ const char *s390_arch_string; /* for -march=<xxx> */
/* String to specify backchain mode:
"" no-backchain, "1" backchain, "2" kernel-backchain. */
const char *s390_backchain_string = TARGET_DEFAULT_BACKCHAIN;
const char *s390_warn_framesize_string; const char *s390_warn_framesize_string;
const char *s390_warn_dynamicstack_string; const char *s390_warn_dynamicstack_string;
const char *s390_stack_size_string; const char *s390_stack_size_string;
...@@ -6083,7 +6079,7 @@ s390_return_addr_rtx (int count, rtx frame ATTRIBUTE_UNUSED) ...@@ -6083,7 +6079,7 @@ s390_return_addr_rtx (int count, rtx frame ATTRIBUTE_UNUSED)
/* Without backchain, we fail for all but the current frame. */ /* Without backchain, we fail for all but the current frame. */
if (!TARGET_BACKCHAIN && !TARGET_KERNEL_BACKCHAIN && count > 0) if (!TARGET_BACKCHAIN && count > 0)
return NULL_RTX; return NULL_RTX;
/* For the current frame, we need to make sure the initial /* For the current frame, we need to make sure the initial
...@@ -6095,10 +6091,10 @@ s390_return_addr_rtx (int count, rtx frame ATTRIBUTE_UNUSED) ...@@ -6095,10 +6091,10 @@ s390_return_addr_rtx (int count, rtx frame ATTRIBUTE_UNUSED)
return gen_rtx_MEM (Pmode, return_address_pointer_rtx); return gen_rtx_MEM (Pmode, return_address_pointer_rtx);
} }
if (TARGET_BACKCHAIN) if (TARGET_PACKED_STACK)
offset = RETURN_REGNUM * UNITS_PER_WORD;
else
offset = -2 * UNITS_PER_WORD; offset = -2 * UNITS_PER_WORD;
else
offset = RETURN_REGNUM * UNITS_PER_WORD;
addr = plus_constant (frame, offset); addr = plus_constant (frame, offset);
addr = memory_address (Pmode, addr); addr = memory_address (Pmode, addr);
...@@ -6113,13 +6109,13 @@ s390_back_chain_rtx (void) ...@@ -6113,13 +6109,13 @@ s390_back_chain_rtx (void)
{ {
rtx chain; rtx chain;
gcc_assert (TARGET_BACKCHAIN || TARGET_KERNEL_BACKCHAIN); gcc_assert (TARGET_BACKCHAIN);
if (TARGET_BACKCHAIN) if (TARGET_PACKED_STACK)
chain = stack_pointer_rtx;
else
chain = plus_constant (stack_pointer_rtx, chain = plus_constant (stack_pointer_rtx,
STACK_POINTER_OFFSET - UNITS_PER_WORD); STACK_POINTER_OFFSET - UNITS_PER_WORD);
else
chain = stack_pointer_rtx;
chain = gen_rtx_MEM (Pmode, chain); chain = gen_rtx_MEM (Pmode, chain);
return chain; return chain;
...@@ -6287,10 +6283,9 @@ s390_frame_info (void) ...@@ -6287,10 +6283,9 @@ s390_frame_info (void)
if (!TARGET_64BIT && cfun_frame_layout.frame_size > 0x7fff0000) if (!TARGET_64BIT && cfun_frame_layout.frame_size > 0x7fff0000)
fatal_error ("Total size of local variables exceeds architecture limit."); fatal_error ("Total size of local variables exceeds architecture limit.");
cfun_frame_layout.save_backchain_p = (TARGET_BACKCHAIN cfun_frame_layout.save_backchain_p = TARGET_BACKCHAIN;
|| TARGET_KERNEL_BACKCHAIN);
if (TARGET_BACKCHAIN) if (!TARGET_PACKED_STACK)
{ {
cfun_frame_layout.backchain_offset = 0; cfun_frame_layout.backchain_offset = 0;
cfun_frame_layout.f0_offset = 16 * UNITS_PER_WORD; cfun_frame_layout.f0_offset = 16 * UNITS_PER_WORD;
...@@ -6299,7 +6294,7 @@ s390_frame_info (void) ...@@ -6299,7 +6294,7 @@ s390_frame_info (void)
cfun_frame_layout.gprs_offset = (cfun_frame_layout.first_save_gpr cfun_frame_layout.gprs_offset = (cfun_frame_layout.first_save_gpr
* UNITS_PER_WORD); * UNITS_PER_WORD);
} }
else if (TARGET_KERNEL_BACKCHAIN) else if (TARGET_BACKCHAIN) /* kernel stack layout */
{ {
cfun_frame_layout.backchain_offset = (STACK_POINTER_OFFSET cfun_frame_layout.backchain_offset = (STACK_POINTER_OFFSET
- UNITS_PER_WORD); - UNITS_PER_WORD);
...@@ -6354,7 +6349,7 @@ s390_frame_info (void) ...@@ -6354,7 +6349,7 @@ s390_frame_info (void)
&& !current_function_stdarg) && !current_function_stdarg)
return; return;
if (TARGET_BACKCHAIN) if (!TARGET_PACKED_STACK)
cfun_frame_layout.frame_size += (STARTING_FRAME_OFFSET cfun_frame_layout.frame_size += (STARTING_FRAME_OFFSET
+ cfun_frame_layout.high_fprs * 8); + cfun_frame_layout.high_fprs * 8);
else else
...@@ -6753,7 +6748,7 @@ s390_emit_prologue (void) ...@@ -6753,7 +6748,7 @@ s390_emit_prologue (void)
save_fpr (stack_pointer_rtx, offset, i + 16); save_fpr (stack_pointer_rtx, offset, i + 16);
offset += 8; offset += 8;
} }
else if (TARGET_BACKCHAIN) else if (!TARGET_PACKED_STACK)
offset += 8; offset += 8;
} }
...@@ -6771,11 +6766,11 @@ s390_emit_prologue (void) ...@@ -6771,11 +6766,11 @@ s390_emit_prologue (void)
if (!call_really_used_regs[i + 16]) if (!call_really_used_regs[i + 16])
RTX_FRAME_RELATED_P (insn) = 1; RTX_FRAME_RELATED_P (insn) = 1;
} }
else if (TARGET_BACKCHAIN) else if (!TARGET_PACKED_STACK)
offset += 8; offset += 8;
} }
if (!TARGET_BACKCHAIN if (TARGET_PACKED_STACK
&& cfun_save_high_fprs_p && cfun_save_high_fprs_p
&& cfun_frame_layout.f8_offset + cfun_frame_layout.high_fprs * 8 > 0) && cfun_frame_layout.f8_offset + cfun_frame_layout.high_fprs * 8 > 0)
{ {
...@@ -6794,7 +6789,7 @@ s390_emit_prologue (void) ...@@ -6794,7 +6789,7 @@ s390_emit_prologue (void)
next_fpr = i + 16; next_fpr = i + 16;
} }
if (TARGET_BACKCHAIN) if (!TARGET_PACKED_STACK)
next_fpr = cfun_save_high_fprs_p ? 31 : 0; next_fpr = cfun_save_high_fprs_p ? 31 : 0;
/* Decrement stack pointer. */ /* Decrement stack pointer. */
...@@ -7050,7 +7045,7 @@ s390_emit_epilogue (bool sibcall) ...@@ -7050,7 +7045,7 @@ s390_emit_epilogue (bool sibcall)
offset + next_offset, i); offset + next_offset, i);
next_offset += 8; next_offset += 8;
} }
else if (TARGET_BACKCHAIN) else if (!TARGET_PACKED_STACK)
next_offset += 8; next_offset += 8;
} }
...@@ -7516,7 +7511,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED) ...@@ -7516,7 +7511,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
/* Find the register save area. */ /* Find the register save area. */
t = make_tree (TREE_TYPE (sav), return_address_pointer_rtx); t = make_tree (TREE_TYPE (sav), return_address_pointer_rtx);
if (TARGET_KERNEL_BACKCHAIN) if (TARGET_BACKCHAIN && TARGET_PACKED_STACK) /* kernel stack layout */
t = build (PLUS_EXPR, TREE_TYPE (sav), t, t = build (PLUS_EXPR, TREE_TYPE (sav), t,
build_int_cst (NULL_TREE, build_int_cst (NULL_TREE,
-(RETURN_REGNUM - 2) * UNITS_PER_WORD -(RETURN_REGNUM - 2) * UNITS_PER_WORD
...@@ -7589,11 +7584,11 @@ s390_gimplify_va_arg (tree valist, tree type, tree *pre_p, ...@@ -7589,11 +7584,11 @@ s390_gimplify_va_arg (tree valist, tree type, tree *pre_p,
reg = gpr; reg = gpr;
n_reg = 1; n_reg = 1;
/* TARGET_KERNEL_BACKCHAIN on 31 bit: It is assumed here that no padding /* kernel stack layout on 31 bit: It is assumed here that no padding
will be added by s390_frame_info because for va_args always an even will be added by s390_frame_info because for va_args always an even
number of gprs has to be saved r15-r2 = 14 regs. */ number of gprs has to be saved r15-r2 = 14 regs. */
sav_ofs = (TARGET_KERNEL_BACKCHAIN sav_ofs = ((TARGET_BACKCHAIN && TARGET_PACKED_STACK) ?
? (TARGET_64BIT ? 4 : 2) * 8 : 2 * UNITS_PER_WORD); (TARGET_64BIT ? 4 : 2) * 8 : 2 * UNITS_PER_WORD);
sav_scale = UNITS_PER_WORD; sav_scale = UNITS_PER_WORD;
size = UNITS_PER_WORD; size = UNITS_PER_WORD;
max_reg = 4; max_reg = 4;
...@@ -7610,7 +7605,8 @@ s390_gimplify_va_arg (tree valist, tree type, tree *pre_p, ...@@ -7610,7 +7605,8 @@ s390_gimplify_va_arg (tree valist, tree type, tree *pre_p,
indirect_p = 0; indirect_p = 0;
reg = fpr; reg = fpr;
n_reg = 1; n_reg = 1;
sav_ofs = TARGET_KERNEL_BACKCHAIN ? 0 : 16 * UNITS_PER_WORD; sav_ofs = ((TARGET_BACKCHAIN && TARGET_PACKED_STACK) ?
0 : 16 * UNITS_PER_WORD);
sav_scale = 8; sav_scale = 8;
/* TARGET_64BIT has up to 4 parameter in fprs */ /* TARGET_64BIT has up to 4 parameter in fprs */
max_reg = TARGET_64BIT ? 3 : 1; max_reg = TARGET_64BIT ? 3 : 1;
...@@ -7628,11 +7624,11 @@ s390_gimplify_va_arg (tree valist, tree type, tree *pre_p, ...@@ -7628,11 +7624,11 @@ s390_gimplify_va_arg (tree valist, tree type, tree *pre_p,
reg = gpr; reg = gpr;
n_reg = (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; n_reg = (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
/* TARGET_KERNEL_BACKCHAIN on 31 bit: It is assumed here that no padding /* kernel stack layout on 31 bit: It is assumed here that no padding
will be added by s390_frame_info because for va_args always an even will be added by s390_frame_info because for va_args always an even
number of gprs has to be saved r15-r2 = 14 regs. */ number of gprs has to be saved r15-r2 = 14 regs. */
sav_ofs = TARGET_KERNEL_BACKCHAIN ? sav_ofs = ((TARGET_BACKCHAIN && TARGET_PACKED_STACK) ?
(TARGET_64BIT ? 4 : 2) * 8 : 2*UNITS_PER_WORD; (TARGET_64BIT ? 4 : 2) * 8 : 2 * UNITS_PER_WORD);
if (size < UNITS_PER_WORD) if (size < UNITS_PER_WORD)
sav_ofs += UNITS_PER_WORD - size; sav_ofs += UNITS_PER_WORD - size;
......
...@@ -60,8 +60,6 @@ extern enum processor_type s390_arch; ...@@ -60,8 +60,6 @@ extern enum processor_type s390_arch;
extern enum processor_flags s390_arch_flags; extern enum processor_flags s390_arch_flags;
extern const char *s390_arch_string; extern const char *s390_arch_string;
extern const char *s390_backchain_string;
extern const char *s390_warn_framesize_string; extern const char *s390_warn_framesize_string;
extern const char *s390_warn_dynamicstack_string; extern const char *s390_warn_dynamicstack_string;
extern const char *s390_stack_size_string; extern const char *s390_stack_size_string;
...@@ -106,6 +104,8 @@ extern int target_flags; ...@@ -106,6 +104,8 @@ extern int target_flags;
#define MASK_MVCLE 0x40 #define MASK_MVCLE 0x40
#define MASK_TPF_PROFILING 0x80 #define MASK_TPF_PROFILING 0x80
#define MASK_NO_FUSED_MADD 0x100 #define MASK_NO_FUSED_MADD 0x100
#define MASK_BACKCHAIN 0x200
#define MASK_PACKED_STACK 0x400
#define TARGET_HARD_FLOAT (target_flags & MASK_HARD_FLOAT) #define TARGET_HARD_FLOAT (target_flags & MASK_HARD_FLOAT)
#define TARGET_SOFT_FLOAT (!(target_flags & MASK_HARD_FLOAT)) #define TARGET_SOFT_FLOAT (!(target_flags & MASK_HARD_FLOAT))
...@@ -117,9 +117,8 @@ extern int target_flags; ...@@ -117,9 +117,8 @@ extern int target_flags;
#define TARGET_TPF_PROFILING (target_flags & MASK_TPF_PROFILING) #define TARGET_TPF_PROFILING (target_flags & MASK_TPF_PROFILING)
#define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD) #define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD)
#define TARGET_FUSED_MADD (! TARGET_NO_FUSED_MADD) #define TARGET_FUSED_MADD (! TARGET_NO_FUSED_MADD)
#define TARGET_BACKCHAIN (target_flags & MASK_BACKCHAIN)
#define TARGET_BACKCHAIN (s390_backchain_string[0] == '1') #define TARGET_PACKED_STACK (target_flags & MASK_PACKED_STACK)
#define TARGET_KERNEL_BACKCHAIN (s390_backchain_string[0] == '2')
/* ??? Once this actually works, it could be made a runtime option. */ /* ??? Once this actually works, it could be made a runtime option. */
#define TARGET_IBM_FLOAT 0 #define TARGET_IBM_FLOAT 0
...@@ -131,25 +130,27 @@ extern int target_flags; ...@@ -131,25 +130,27 @@ extern int target_flags;
#define TARGET_DEFAULT MASK_HARD_FLOAT #define TARGET_DEFAULT MASK_HARD_FLOAT
#endif #endif
#define TARGET_DEFAULT_BACKCHAIN "" #define TARGET_SWITCHES \
{ { "hard-float", 1, N_("Use hardware fp")}, \
#define TARGET_SWITCHES \ { "soft-float", -1, N_("Don't use hardware fp")}, \
{ { "hard-float", 1, N_("Use hardware fp")}, \ { "small-exec", 4, N_("Use bras for executable < 64k")}, \
{ "soft-float", -1, N_("Don't use hardware fp")}, \ { "no-small-exec", -4, N_("Don't use bras")}, \
{ "small-exec", 4, N_("Use bras for executable < 64k")}, \ { "debug", 8, N_("Additional debug prints")}, \
{ "no-small-exec", -4, N_("Don't use bras")}, \ { "no-debug", -8, N_("Don't print additional debug prints")}, \
{ "debug", 8, N_("Additional debug prints")}, \ { "64", 16, N_("64 bit ABI")}, \
{ "no-debug", -8, N_("Don't print additional debug prints")}, \ { "31", -16, N_("31 bit ABI")}, \
{ "64", 16, N_("64 bit ABI")}, \ { "zarch", 32, N_("z/Architecture")}, \
{ "31", -16, N_("31 bit ABI")}, \ { "esa", -32, N_("ESA/390 architecture")}, \
{ "zarch", 32, N_("z/Architecture")}, \ { "mvcle", 64, N_("mvcle use")}, \
{ "esa", -32, N_("ESA/390 architecture")}, \ { "no-mvcle", -64, N_("mvc&ex")}, \
{ "mvcle", 64, N_("mvcle use")}, \ { "tpf-trace", 128, N_("Enable tpf OS tracing code")}, \
{ "no-mvcle", -64, N_("mvc&ex")}, \ { "no-tpf-trace", -128, N_("Disable tpf OS tracing code")}, \
{ "tpf-trace", 128, N_("enable tpf OS tracing code")}, \ { "no-fused-madd", 256, N_("Disable fused multiply/add instructions")},\
{ "no-tpf-trace", -128, N_("disable tpf OS tracing code")}, \ { "fused-madd", -256, N_("Enable fused multiply/add instructions")}, \
{ "no-fused-madd", 256, N_("disable fused multiply/add instructions")},\ { "backchain", 512, N_("Maintain backchain pointer")}, \
{ "fused-madd", -256, N_("enable fused multiply/add instructions")}, \ { "no-backchain", -512, N_("Don't maintain backchain pointer")}, \
{ "packed-stack", 1024, N_("Use packed stack layout")}, \
{ "no-packed-stack", -1024, N_("Don't use packed stack layout")}, \
{ "", TARGET_DEFAULT, 0 } } { "", TARGET_DEFAULT, 0 } }
#define TARGET_OPTIONS \ #define TARGET_OPTIONS \
...@@ -157,12 +158,6 @@ extern int target_flags; ...@@ -157,12 +158,6 @@ extern int target_flags;
N_("Schedule code for given CPU"), 0}, \ N_("Schedule code for given CPU"), 0}, \
{ "arch=", &s390_arch_string, \ { "arch=", &s390_arch_string, \
N_("Generate code for given CPU"), 0}, \ N_("Generate code for given CPU"), 0}, \
{ "backchain", &s390_backchain_string, \
N_("Set backchain"), "1"}, \
{ "no-backchain", &s390_backchain_string, \
N_("Do not set backchain"), ""}, \
{ "kernel-backchain", &s390_backchain_string, \
N_("Set backchain appropriate for the linux kernel"), "2"}, \
{ "warn-framesize=", &s390_warn_framesize_string, \ { "warn-framesize=", &s390_warn_framesize_string, \
N_("Warn if a single function's framesize exceeds the given framesize"), \ N_("Warn if a single function's framesize exceeds the given framesize"), \
0}, \ 0}, \
...@@ -623,12 +618,12 @@ extern int current_function_outgoing_args_size; ...@@ -623,12 +618,12 @@ extern int current_function_outgoing_args_size;
the corresponding RETURN_REGNUM register was saved. */ the corresponding RETURN_REGNUM register was saved. */
#define DYNAMIC_CHAIN_ADDRESS(FRAME) \ #define DYNAMIC_CHAIN_ADDRESS(FRAME) \
(TARGET_BACKCHAIN ? \ (TARGET_PACKED_STACK ? \
((FRAME) != hard_frame_pointer_rtx ? (FRAME) : \
plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET)) : \
((FRAME) != hard_frame_pointer_rtx ? \ ((FRAME) != hard_frame_pointer_rtx ? \
plus_constant ((FRAME), STACK_POINTER_OFFSET - UNITS_PER_WORD) : \ plus_constant ((FRAME), STACK_POINTER_OFFSET - UNITS_PER_WORD) : \
plus_constant (arg_pointer_rtx, -UNITS_PER_WORD))) plus_constant (arg_pointer_rtx, -UNITS_PER_WORD)) : \
((FRAME) != hard_frame_pointer_rtx ? (FRAME) : \
plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET)))
#define RETURN_ADDR_RTX(COUNT, FRAME) \ #define RETURN_ADDR_RTX(COUNT, FRAME) \
s390_return_addr_rtx ((COUNT), DYNAMIC_CHAIN_ADDRESS ((FRAME))) s390_return_addr_rtx ((COUNT), DYNAMIC_CHAIN_ADDRESS ((FRAME)))
......
...@@ -7892,7 +7892,7 @@ ...@@ -7892,7 +7892,7 @@
(define_expand "allocate_stack" (define_expand "allocate_stack"
[(match_operand 0 "general_operand" "") [(match_operand 0 "general_operand" "")
(match_operand 1 "general_operand" "")] (match_operand 1 "general_operand" "")]
"TARGET_BACKCHAIN || TARGET_KERNEL_BACKCHAIN" "TARGET_BACKCHAIN"
{ {
rtx temp = gen_reg_rtx (Pmode); rtx temp = gen_reg_rtx (Pmode);
...@@ -7942,7 +7942,7 @@ ...@@ -7942,7 +7942,7 @@
(define_expand "restore_stack_block" (define_expand "restore_stack_block"
[(match_operand 0 "register_operand" "") [(match_operand 0 "register_operand" "")
(match_operand 1 "register_operand" "")] (match_operand 1 "register_operand" "")]
"TARGET_BACKCHAIN || TARGET_KERNEL_BACKCHAIN" "TARGET_BACKCHAIN"
{ {
rtx temp = gen_reg_rtx (Pmode); rtx temp = gen_reg_rtx (Pmode);
...@@ -7964,7 +7964,7 @@ ...@@ -7964,7 +7964,7 @@
/* Copy the backchain to the first word, sp to the second and the /* Copy the backchain to the first word, sp to the second and the
literal pool base to the third. */ literal pool base to the third. */
if (TARGET_BACKCHAIN || TARGET_KERNEL_BACKCHAIN) if (TARGET_BACKCHAIN)
{ {
rtx temp = force_reg (Pmode, s390_back_chain_rtx ()); rtx temp = force_reg (Pmode, s390_back_chain_rtx ());
emit_move_insn (operand_subword (operands[0], 0, 0, mode), temp); emit_move_insn (operand_subword (operands[0], 0, 0, mode), temp);
...@@ -7988,7 +7988,7 @@ ...@@ -7988,7 +7988,7 @@
/* Restore the backchain from the first word, sp from the second and the /* Restore the backchain from the first word, sp from the second and the
literal pool base from the third. */ literal pool base from the third. */
if (TARGET_BACKCHAIN || TARGET_KERNEL_BACKCHAIN) if (TARGET_BACKCHAIN)
temp = force_reg (Pmode, operand_subword (operands[1], 0, 0, mode)); temp = force_reg (Pmode, operand_subword (operands[1], 0, 0, mode));
emit_move_insn (base, operand_subword (operands[1], 2, 0, mode)); emit_move_insn (base, operand_subword (operands[1], 2, 0, mode));
......
...@@ -58,10 +58,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -58,10 +58,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
Also, enable TPF profiling support and the standard backchain by default. */ Also, enable TPF profiling support and the standard backchain by default. */
#undef TARGET_DEFAULT #undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_FLOAT \ #define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_FLOAT \
| MASK_TPF_PROFILING) | MASK_TPF_PROFILING | MASK_BACKCHAIN)
#undef TARGET_DEFAULT_BACKCHAIN
#define TARGET_DEFAULT_BACKCHAIN "1"
/* Exception handling. */ /* Exception handling. */
/* Select a format to encode pointers in exception handling data. */ /* Select a format to encode pointers in exception handling data. */
......
...@@ -623,7 +623,8 @@ See RS/6000 and PowerPC Options. ...@@ -623,7 +623,8 @@ See RS/6000 and PowerPC Options.
@emph{S/390 and zSeries Options} @emph{S/390 and zSeries Options}
@gccoptlist{-mtune=@var{cpu-type} -march=@var{cpu-type} @gol @gccoptlist{-mtune=@var{cpu-type} -march=@var{cpu-type} @gol
-mhard-float -msoft-float -mbackchain -mno-backchain -mkernel-backchain @gol -mhard-float -msoft-float -mbackchain -mno-backchain @gol
-mpacked-stack -mno-packed-stack @gol
-msmall-exec -mno-small-exec -mmvcle -mno-mvcle @gol -msmall-exec -mno-small-exec -mmvcle -mno-mvcle @gol
-m64 -m31 -mdebug -mno-debug -mesa -mzarch @gol -m64 -m31 -mdebug -mno-debug -mesa -mzarch @gol
-mtpf-trace -mno-tpf-trace -mfused-madd -mno-fused-madd @gol -mtpf-trace -mno-tpf-trace -mfused-madd -mno-fused-madd @gol
...@@ -10827,27 +10828,49 @@ generates IEEE floating-point instructions. This is the default. ...@@ -10827,27 +10828,49 @@ generates IEEE floating-point instructions. This is the default.
@item -mbackchain @item -mbackchain
@itemx -mno-backchain @itemx -mno-backchain
@itemx -mkernel-backchain
@opindex mbackchain @opindex mbackchain
@opindex mno-backchain @opindex mno-backchain
@opindex mkernel-backchain Store (do not store) the address of the caller's frame as backchain pointer
In order to provide a backchain the address of the caller's frame into the callee's stack frame.
is stored within the callee's stack frame.
A backchain may be needed to allow debugging using tools that do not understand A backchain may be needed to allow debugging using tools that do not understand
DWARF-2 call frame information. DWARF-2 call frame information.
For @option{-mno-backchain} no backchain is maintained at all which is the When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
default. at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
If one of the other options is present the backchain pointer is placed either the backchain is placed into the topmost word of the 96/160 byte register
on top of the stack frame (@option{-mkernel-backchain}) or on save area.
the bottom (@option{-mbackchain}).
Beside the different backchain location @option{-mkernel-backchain} In general, code compiled with @option{-mbackchain} is call-compatible with
also changes stack frame layout breaking the ABI@. This option code compiled with @option{-mmo-backchain}; however, use of the backchain
is intended to be used for code which internally needs a backchain but has for debugging purposes usually requires that the whole binary is built with
to get by with a limited stack size e.g.@: the linux kernel. @option{-mbackchain}. Note that the combination of @option{-mbackchain} and
Internal unwinding code not using DWARF-2 info has to be able to locate the @option{-mpacked-stack} generates code that is not ABI-compatible.
return address of a function. That will be eased be the fact that
the return address of a function is placed two words below the backchain The default is to not maintain the backchain.
pointer.
@item -mpacked-stack
@item -mno-packed-stack
@opindex mpacked-stack
@opindex mno-packed-stack
Use (do not use) the packed stack layout. When @option{-mno-packed-stack} is
specified, the compiler uses the all fields of the 96/160 byte register save
area only for their default purpose; unused fields still take up stack space.
When @option{-mpacked-stack} is specified, register save slots are densely
packed at the top of the register save area; unused space is reused for other
purposes, allowing for more efficient use of the available stack space.
However, when @option{-mbackchain} is also in effect, the topmost word of
the save area is always used to store the backchain, and the return address
register is always saved two words below the backchain.
As long as the stack frame backchain is not used, code generated with
@option{-mpacked-stack} is call-compatible with code generated with
@option{-mno-packed-stack}. Note that some non-FSF releases of GCC 2.95 for
S/390 or zSeries generated code that uses the stack frame backchain at run
time, not just for debugging purposes. Such code is not call-compatible
with code compiled with @option{-mpacked-stack}. Also, note that the
combination of @option{-mbackchain} and @option{-mpacked-stack} generates code
that is not ABI-compatible.
The default is to not use the packed stack layout.
@item -msmall-exec @item -msmall-exec
@itemx -mno-small-exec @itemx -mno-small-exec
......
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