Commit 9d05bbce by Kazu Hirata Committed by Kazu Hirata

flow.c (EXIT_IGNORE_STACK): Move to ...

	* flow.c (EXIT_IGNORE_STACK): Move to ...
	* defaults.h (EXIT_IGNORE_STACK): ... here.
	* dojump.c (clear_pending_stack_adjust): Don't use #ifdef
	EXIT_IGNORE_STACK.
	* function.c (expand_function_end): Likewise.
	* global.c (global_alloc): Likewise.
	* ra.c (init_ra): Likewise.
	* reload1.c (init_elim_table): Likewise.
	* reorg.c (fill_simple_delay_slots): Likewise.
	* resource.c (init_resource_info): Likewise.
	* doc/tm.texi (EXIT_IGNORE_STACK): Document that the default
	is 0.

From-SVN: r74654
parent cbc278f4
2003-12-15 Kazu Hirata <kazu@cs.umass.edu>
* flow.c (EXIT_IGNORE_STACK): Move to ...
* defaults.h (EXIT_IGNORE_STACK): ... here.
* dojump.c (clear_pending_stack_adjust): Don't use #ifdef
EXIT_IGNORE_STACK.
* function.c (expand_function_end): Likewise.
* global.c (global_alloc): Likewise.
* ra.c (init_ra): Likewise.
* reload1.c (init_elim_table): Likewise.
* reorg.c (fill_simple_delay_slots): Likewise.
* resource.c (init_resource_info): Likewise.
* doc/tm.texi (EXIT_IGNORE_STACK): Document that the default
is 0.
2003-12-15 J"orn Rennecke <joern.rennecke@superh.com> 2003-12-15 J"orn Rennecke <joern.rennecke@superh.com>
* reload.c (reg_overlap_mentioned_for_reload_p): * reload.c (reg_overlap_mentioned_for_reload_p):
......
...@@ -689,4 +689,11 @@ You Lose! You must define PREFERRED_DEBUGGING_TYPE! ...@@ -689,4 +689,11 @@ You Lose! You must define PREFERRED_DEBUGGING_TYPE!
#define LOCAL_REGNO(REGNO) 0 #define LOCAL_REGNO(REGNO) 0
#endif #endif
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in
functions that have frame pointers. */
#ifndef EXIT_IGNORE_STACK
#define EXIT_IGNORE_STACK 0
#endif
#endif /* ! GCC_DEFAULTS_H */ #endif /* ! GCC_DEFAULTS_H */
...@@ -4196,7 +4196,8 @@ function. ...@@ -4196,7 +4196,8 @@ function.
Define this macro as a C expression that is nonzero if the return Define this macro as a C expression that is nonzero if the return
instruction or the function epilogue ignores the value of the stack instruction or the function epilogue ignores the value of the stack
pointer; in other words, if it is safe to delete an instruction to pointer; in other words, if it is safe to delete an instruction to
adjust the stack pointer before a return from the function. adjust the stack pointer before a return from the function. The
default is 0.
Note that this macro's value is relevant only for functions for which Note that this macro's value is relevant only for functions for which
frame pointers are maintained. It is never safe to delete a final frame pointers are maintained. It is never safe to delete a final
......
...@@ -57,7 +57,6 @@ init_pending_stack_adjust (void) ...@@ -57,7 +57,6 @@ init_pending_stack_adjust (void)
void void
clear_pending_stack_adjust (void) clear_pending_stack_adjust (void)
{ {
#ifdef EXIT_IGNORE_STACK
if (optimize > 0 if (optimize > 0
&& (! flag_omit_frame_pointer || current_function_calls_alloca) && (! flag_omit_frame_pointer || current_function_calls_alloca)
&& EXIT_IGNORE_STACK && EXIT_IGNORE_STACK
...@@ -67,7 +66,6 @@ clear_pending_stack_adjust (void) ...@@ -67,7 +66,6 @@ clear_pending_stack_adjust (void)
stack_pointer_delta -= pending_stack_adjust, stack_pointer_delta -= pending_stack_adjust,
pending_stack_adjust = 0; pending_stack_adjust = 0;
} }
#endif
} }
/* Pop any previously-pushed arguments that have not been popped yet. */ /* Pop any previously-pushed arguments that have not been popped yet. */
......
...@@ -141,14 +141,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -141,14 +141,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "obstack.h" #include "obstack.h"
#include "splay-tree.h" #include "splay-tree.h"
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in
functions that have frame pointers.
No definition is equivalent to always zero. */
#ifndef EXIT_IGNORE_STACK
#define EXIT_IGNORE_STACK 0
#endif
#ifndef HAVE_epilogue #ifndef HAVE_epilogue
#define HAVE_epilogue 0 #define HAVE_epilogue 0
#endif #endif
......
...@@ -7038,16 +7038,14 @@ expand_function_end (void) ...@@ -7038,16 +7038,14 @@ expand_function_end (void)
/* If we had calls to alloca, and this machine needs /* If we had calls to alloca, and this machine needs
an accurate stack pointer to exit the function, an accurate stack pointer to exit the function,
insert some code to save and restore the stack pointer. */ insert some code to save and restore the stack pointer. */
#ifdef EXIT_IGNORE_STACK if (! EXIT_IGNORE_STACK
if (! EXIT_IGNORE_STACK) && current_function_calls_alloca)
#endif {
if (current_function_calls_alloca) rtx tem = 0;
{
rtx tem = 0;
emit_stack_save (SAVE_FUNCTION, &tem, parm_birth_insn); emit_stack_save (SAVE_FUNCTION, &tem, parm_birth_insn);
emit_stack_restore (SAVE_FUNCTION, tem, NULL_RTX); emit_stack_restore (SAVE_FUNCTION, tem, NULL_RTX);
} }
/* If scalar return value was computed in a pseudo-reg, or was a named /* If scalar return value was computed in a pseudo-reg, or was a named
return value that got dumped to the stack, copy that to the hard return value that got dumped to the stack, copy that to the hard
......
...@@ -323,9 +323,7 @@ global_alloc (FILE *file) ...@@ -323,9 +323,7 @@ global_alloc (FILE *file)
#endif #endif
int need_fp int need_fp
= (! flag_omit_frame_pointer = (! flag_omit_frame_pointer
#ifdef EXIT_IGNORE_STACK
|| (current_function_calls_alloca && EXIT_IGNORE_STACK) || (current_function_calls_alloca && EXIT_IGNORE_STACK)
#endif
|| FRAME_POINTER_REQUIRED); || FRAME_POINTER_REQUIRED);
size_t i; size_t i;
......
...@@ -455,9 +455,7 @@ init_ra (void) ...@@ -455,9 +455,7 @@ init_ra (void)
#endif #endif
int need_fp int need_fp
= (! flag_omit_frame_pointer = (! flag_omit_frame_pointer
#ifdef EXIT_IGNORE_STACK
|| (current_function_calls_alloca && EXIT_IGNORE_STACK) || (current_function_calls_alloca && EXIT_IGNORE_STACK)
#endif
|| FRAME_POINTER_REQUIRED); || FRAME_POINTER_REQUIRED);
ra_colorize_init (); ra_colorize_init ();
......
...@@ -3443,7 +3443,6 @@ init_elim_table (void) ...@@ -3443,7 +3443,6 @@ init_elim_table (void)
/* Does this function require a frame pointer? */ /* Does this function require a frame pointer? */
frame_pointer_needed = (! flag_omit_frame_pointer frame_pointer_needed = (! flag_omit_frame_pointer
#ifdef EXIT_IGNORE_STACK
/* ?? If EXIT_IGNORE_STACK is set, we will not save /* ?? If EXIT_IGNORE_STACK is set, we will not save
and restore sp for alloca. So we can't eliminate and restore sp for alloca. So we can't eliminate
the frame pointer in that case. At some point, the frame pointer in that case. At some point,
...@@ -3451,7 +3450,6 @@ init_elim_table (void) ...@@ -3451,7 +3450,6 @@ init_elim_table (void)
sp-adjusting insns for this case. */ sp-adjusting insns for this case. */
|| (current_function_calls_alloca || (current_function_calls_alloca
&& EXIT_IGNORE_STACK) && EXIT_IGNORE_STACK)
#endif
|| FRAME_POINTER_REQUIRED); || FRAME_POINTER_REQUIRED);
num_eliminable = 0; num_eliminable = 0;
......
...@@ -2427,10 +2427,8 @@ fill_simple_delay_slots (int non_jumps_p) ...@@ -2427,10 +2427,8 @@ fill_simple_delay_slots (int non_jumps_p)
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
SET_HARD_REG_BIT (needed.regs, HARD_FRAME_POINTER_REGNUM); SET_HARD_REG_BIT (needed.regs, HARD_FRAME_POINTER_REGNUM);
#endif #endif
#ifdef EXIT_IGNORE_STACK
if (! EXIT_IGNORE_STACK if (! EXIT_IGNORE_STACK
|| current_function_sp_is_unchanging) || current_function_sp_is_unchanging)
#endif
SET_HARD_REG_BIT (needed.regs, STACK_POINTER_REGNUM); SET_HARD_REG_BIT (needed.regs, STACK_POINTER_REGNUM);
} }
else else
......
...@@ -1167,10 +1167,8 @@ init_resource_info (rtx epilogue_insn) ...@@ -1167,10 +1167,8 @@ init_resource_info (rtx epilogue_insn)
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
SET_HARD_REG_BIT (end_of_function_needs.regs, HARD_FRAME_POINTER_REGNUM); SET_HARD_REG_BIT (end_of_function_needs.regs, HARD_FRAME_POINTER_REGNUM);
#endif #endif
#ifdef EXIT_IGNORE_STACK
if (! EXIT_IGNORE_STACK if (! EXIT_IGNORE_STACK
|| current_function_sp_is_unchanging) || current_function_sp_is_unchanging)
#endif
SET_HARD_REG_BIT (end_of_function_needs.regs, STACK_POINTER_REGNUM); SET_HARD_REG_BIT (end_of_function_needs.regs, STACK_POINTER_REGNUM);
} }
else else
......
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