Commit c795bca9 by Bernd Schmidt Committed by Jeff Law

expr.c (STACK_BYTES): Delete unused macro.

	* expr.c (STACK_BYTES): Delete unused macro.
	* calls.c: Provide default for PREFERRED_STACK_BOUNDARY.
	(STACK_BYTES): Use PREFERRED_STACK_BOUNDARY, not STACK_BOUNDARY.
	(expand_call): Likewise.
	(emit_library_call): Likewise.
	(emit_library_call_value): Likewise.
	* function.c: Provide default for PREFERRED_STACK_BOUNDARY.
	(STACK_BYTES): Use PREFERRED_STACK_BOUNDARY, not STACK_BOUNDARY.
	* explow.c: Provide default for PREFERRED_STACK_BOUNDARY.
	(round_push): Use PREFERRED_STACK_BOUNDARY, not STACK_BOUNDARY.
	(allocate_dynamic_stack_space): Likewise.
	* tm.texi (PREFERRED_STACK_BOUNDARY): Document new macro.
	(STACK_BOUNDARY): Update description to reflect the new situation.

From-SVN: r23730
parent 9f5a2691
Thu Nov 19 23:44:38 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* expr.c (STACK_BYTES): Delete unused macro.
* calls.c: Provide default for PREFERRED_STACK_BOUNDARY.
(STACK_BYTES): Use PREFERRED_STACK_BOUNDARY, not STACK_BOUNDARY.
(expand_call): Likewise.
(emit_library_call): Likewise.
(emit_library_call_value): Likewise.
* function.c: Provide default for PREFERRED_STACK_BOUNDARY.
(STACK_BYTES): Use PREFERRED_STACK_BOUNDARY, not STACK_BOUNDARY.
* explow.c: Provide default for PREFERRED_STACK_BOUNDARY.
(round_push): Use PREFERRED_STACK_BOUNDARY, not STACK_BOUNDARY.
(allocate_dynamic_stack_space): Likewise.
* tm.texi (PREFERRED_STACK_BOUNDARY): Document new macro.
(STACK_BOUNDARY): Update description to reflect the new situation.
Thu Nov 19 22:20:51 1998 Jeffrey A Law (law@cygnus.com) Thu Nov 19 22:20:51 1998 Jeffrey A Law (law@cygnus.com)
* reorg.c (relax_delay_slots): When optimizing for code size, if a * reorg.c (relax_delay_slots): When optimizing for code size, if a
......
...@@ -29,6 +29,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -29,6 +29,10 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h" #include "toplev.h"
#include "output.h" #include "output.h"
#if !defined PREFERRED_STACK_BOUNDARY && defined STACK_BOUNDARY
#define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
#endif
/* Decide whether a function's arguments should be processed /* Decide whether a function's arguments should be processed
from first to last or from last to first. from first to last or from last to first.
...@@ -43,8 +47,8 @@ Boston, MA 02111-1307, USA. */ ...@@ -43,8 +47,8 @@ Boston, MA 02111-1307, USA. */
#endif #endif
/* Like STACK_BOUNDARY but in units of bytes, not bits. */ /* Like PREFERRED_STACK_BOUNDARY but in units of bytes, not bits. */
#define STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT) #define STACK_BYTES (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)
/* Data structure and subroutines used within expand_call. */ /* Data structure and subroutines used within expand_call. */
...@@ -311,7 +315,7 @@ prepare_call_address (funexp, fndecl, call_fusage, reg_parm_seen) ...@@ -311,7 +315,7 @@ prepare_call_address (funexp, fndecl, call_fusage, reg_parm_seen)
says that the pointer to this aggregate is to be popped by the callee. says that the pointer to this aggregate is to be popped by the callee.
STACK_SIZE is the number of bytes of arguments on the stack, STACK_SIZE is the number of bytes of arguments on the stack,
rounded up to STACK_BOUNDARY; zero if the size is variable. rounded up to PREFERRED_STACK_BOUNDARY; zero if the size is variable.
This is both to put into the call insn and This is both to put into the call insn and
to generate explicit popping code if necessary. to generate explicit popping code if necessary.
...@@ -1240,8 +1244,8 @@ expand_call (exp, target, ignore) ...@@ -1240,8 +1244,8 @@ expand_call (exp, target, ignore)
args_size.var = ARGS_SIZE_TREE (args_size); args_size.var = ARGS_SIZE_TREE (args_size);
args_size.constant = 0; args_size.constant = 0;
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
if (STACK_BOUNDARY != BITS_PER_UNIT) if (PREFERRED_STACK_BOUNDARY != BITS_PER_UNIT)
args_size.var = round_up (args_size.var, STACK_BYTES); args_size.var = round_up (args_size.var, STACK_BYTES);
#endif #endif
...@@ -1262,7 +1266,7 @@ expand_call (exp, target, ignore) ...@@ -1262,7 +1266,7 @@ expand_call (exp, target, ignore)
} }
else else
{ {
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
args_size.constant = (((args_size.constant + (STACK_BYTES - 1)) args_size.constant = (((args_size.constant + (STACK_BYTES - 1))
/ STACK_BYTES) * STACK_BYTES); / STACK_BYTES) * STACK_BYTES);
#endif #endif
...@@ -1589,7 +1593,7 @@ expand_call (exp, target, ignore) ...@@ -1589,7 +1593,7 @@ expand_call (exp, target, ignore)
} }
#ifdef PUSH_ARGS_REVERSED #ifdef PUSH_ARGS_REVERSED
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
/* If we push args individually in reverse order, perform stack alignment /* If we push args individually in reverse order, perform stack alignment
before the first push (the last arg). */ before the first push (the last arg). */
if (argblock == 0) if (argblock == 0)
...@@ -1838,7 +1842,7 @@ expand_call (exp, target, ignore) ...@@ -1838,7 +1842,7 @@ expand_call (exp, target, ignore)
args_size.var != 0, reg_parm_stack_space); args_size.var != 0, reg_parm_stack_space);
#ifndef PUSH_ARGS_REVERSED #ifndef PUSH_ARGS_REVERSED
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
/* If we pushed args in forward order, perform stack alignment /* If we pushed args in forward order, perform stack alignment
after pushing the last arg. */ after pushing the last arg. */
if (argblock == 0) if (argblock == 0)
...@@ -2386,7 +2390,7 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode, ...@@ -2386,7 +2390,7 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
assemble_external_libcall (fun); assemble_external_libcall (fun);
original_args_size = args_size; original_args_size = args_size;
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
args_size.constant = (((args_size.constant + (STACK_BYTES - 1)) args_size.constant = (((args_size.constant + (STACK_BYTES - 1))
/ STACK_BYTES) * STACK_BYTES); / STACK_BYTES) * STACK_BYTES);
#endif #endif
...@@ -2454,7 +2458,7 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode, ...@@ -2454,7 +2458,7 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
#endif #endif
#ifdef PUSH_ARGS_REVERSED #ifdef PUSH_ARGS_REVERSED
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
/* If we push args individually in reverse order, perform stack alignment /* If we push args individually in reverse order, perform stack alignment
before the first push (the last arg). */ before the first push (the last arg). */
if (argblock == 0) if (argblock == 0)
...@@ -2599,7 +2603,7 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode, ...@@ -2599,7 +2603,7 @@ emit_library_call VPROTO((rtx orgfun, int no_queue, enum machine_mode outmode,
} }
#ifndef PUSH_ARGS_REVERSED #ifndef PUSH_ARGS_REVERSED
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
/* If we pushed args in forward order, perform stack alignment /* If we pushed args in forward order, perform stack alignment
after pushing the last arg. */ after pushing the last arg. */
if (argblock == 0) if (argblock == 0)
...@@ -2950,7 +2954,7 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue, ...@@ -2950,7 +2954,7 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
assemble_external_libcall (fun); assemble_external_libcall (fun);
original_args_size = args_size; original_args_size = args_size;
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
args_size.constant = (((args_size.constant + (STACK_BYTES - 1)) args_size.constant = (((args_size.constant + (STACK_BYTES - 1))
/ STACK_BYTES) * STACK_BYTES); / STACK_BYTES) * STACK_BYTES);
#endif #endif
...@@ -3018,7 +3022,7 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue, ...@@ -3018,7 +3022,7 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
#endif #endif
#ifdef PUSH_ARGS_REVERSED #ifdef PUSH_ARGS_REVERSED
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
/* If we push args individually in reverse order, perform stack alignment /* If we push args individually in reverse order, perform stack alignment
before the first push (the last arg). */ before the first push (the last arg). */
if (argblock == 0) if (argblock == 0)
...@@ -3164,7 +3168,7 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue, ...@@ -3164,7 +3168,7 @@ emit_library_call_value VPROTO((rtx orgfun, rtx value, int no_queue,
} }
#ifndef PUSH_ARGS_REVERSED #ifndef PUSH_ARGS_REVERSED
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
/* If we pushed args in forward order, perform stack alignment /* If we pushed args in forward order, perform stack alignment
after pushing the last arg. */ after pushing the last arg. */
if (argblock == 0) if (argblock == 0)
......
...@@ -31,6 +31,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -31,6 +31,10 @@ Boston, MA 02111-1307, USA. */
#include "insn-flags.h" #include "insn-flags.h"
#include "insn-codes.h" #include "insn-codes.h"
#if !defined PREFERRED_STACK_BOUNDARY && defined STACK_BOUNDARY
#define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
#endif
static rtx break_out_memory_refs PROTO((rtx)); static rtx break_out_memory_refs PROTO((rtx));
static void emit_stack_probe PROTO((rtx)); static void emit_stack_probe PROTO((rtx));
/* Return an rtx for the sum of X and the integer C. /* Return an rtx for the sum of X and the integer C.
...@@ -830,8 +834,8 @@ rtx ...@@ -830,8 +834,8 @@ rtx
round_push (size) round_push (size)
rtx size; rtx size;
{ {
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
int align = STACK_BOUNDARY / BITS_PER_UNIT; int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
if (align == 1) if (align == 1)
return size; return size;
if (GET_CODE (size) == CONST_INT) if (GET_CODE (size) == CONST_INT)
...@@ -851,7 +855,7 @@ round_push (size) ...@@ -851,7 +855,7 @@ round_push (size)
NULL_RTX, 1); NULL_RTX, 1);
size = expand_mult (Pmode, size, GEN_INT (align), NULL_RTX, 1); size = expand_mult (Pmode, size, GEN_INT (align), NULL_RTX, 1);
} }
#endif /* STACK_BOUNDARY */ #endif /* PREFERRED_STACK_BOUNDARY */
return size; return size;
} }
...@@ -1124,10 +1128,10 @@ allocate_dynamic_stack_space (size, target, known_align) ...@@ -1124,10 +1128,10 @@ allocate_dynamic_stack_space (size, target, known_align)
If we have to align, we must leave space in SIZE for the hole If we have to align, we must leave space in SIZE for the hole
that might result from the alignment operation. */ that might result from the alignment operation. */
#if defined (STACK_DYNAMIC_OFFSET) || defined (STACK_POINTER_OFFSET) || ! defined (STACK_BOUNDARY) #if defined (STACK_DYNAMIC_OFFSET) || defined (STACK_POINTER_OFFSET) || ! defined (PREFERRED_STACK_BOUNDARY)
#define MUST_ALIGN 1 #define MUST_ALIGN 1
#else #else
#define MUST_ALIGN (STACK_BOUNDARY < BIGGEST_ALIGNMENT) #define MUST_ALIGN (PREFERRED_STACK_BOUNDARY < BIGGEST_ALIGNMENT)
#endif #endif
if (MUST_ALIGN) if (MUST_ALIGN)
...@@ -1154,12 +1158,12 @@ allocate_dynamic_stack_space (size, target, known_align) ...@@ -1154,12 +1158,12 @@ allocate_dynamic_stack_space (size, target, known_align)
if (!current_function_calls_setjmp) if (!current_function_calls_setjmp)
{ {
int align = STACK_BOUNDARY / BITS_PER_UNIT; int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
/* See optimize_save_area_alloca to understand what is being /* See optimize_save_area_alloca to understand what is being
set up here. */ set up here. */
#if !defined(STACK_BOUNDARY) || !defined(MUST_ALIGN) || (STACK_BOUNDARY != BIGGEST_ALIGNMENT) #if !defined(PREFERRED_STACK_BOUNDARY) || !defined(MUST_ALIGN) || (PREFERRED_STACK_BOUNDARY != BIGGEST_ALIGNMENT)
/* If anyone creates a target with these characteristics, let them /* If anyone creates a target with these characteristics, let them
know that our optimization cannot work correctly in such a case. */ know that our optimization cannot work correctly in such a case. */
abort(); abort();
...@@ -1209,11 +1213,11 @@ allocate_dynamic_stack_space (size, target, known_align) ...@@ -1209,11 +1213,11 @@ allocate_dynamic_stack_space (size, target, known_align)
way of knowing which systems have this problem. So we avoid even way of knowing which systems have this problem. So we avoid even
momentarily mis-aligning the stack. */ momentarily mis-aligning the stack. */
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
/* If we added a variable amount to SIZE, /* If we added a variable amount to SIZE,
we can no longer assume it is aligned. */ we can no longer assume it is aligned. */
#if !defined (SETJMP_VIA_SAVE_AREA) #if !defined (SETJMP_VIA_SAVE_AREA)
if (MUST_ALIGN || known_align % STACK_BOUNDARY != 0) if (MUST_ALIGN || known_align % PREFERRED_STACK_BOUNDARY != 0)
#endif #endif
size = round_push (size); size = round_push (size);
#endif #endif
......
...@@ -65,9 +65,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -65,9 +65,6 @@ Boston, MA 02111-1307, USA. */
#endif #endif
#endif #endif
/* Like STACK_BOUNDARY but in units of bytes, not bits. */
#define STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT)
/* Assume that case vectors are not pc-relative. */ /* Assume that case vectors are not pc-relative. */
#ifndef CASE_VECTOR_PC_RELATIVE #ifndef CASE_VECTOR_PC_RELATIVE
#define CASE_VECTOR_PC_RELATIVE 0 #define CASE_VECTOR_PC_RELATIVE 0
......
...@@ -57,6 +57,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -57,6 +57,10 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h" #include "obstack.h"
#include "toplev.h" #include "toplev.h"
#if !defined PREFERRED_STACK_BOUNDARY && defined STACK_BOUNDARY
#define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
#endif
#ifndef TRAMPOLINE_ALIGNMENT #ifndef TRAMPOLINE_ALIGNMENT
#define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY #define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY
#endif #endif
...@@ -669,7 +673,7 @@ void pop_function_context () ...@@ -669,7 +673,7 @@ void pop_function_context ()
/* Allocate fixed slots in the stack frame of the current function. */ /* Allocate fixed slots in the stack frame of the current function. */
/* Return size needed for stack frame based on slots so far allocated. /* Return size needed for stack frame based on slots so far allocated.
This size counts from zero. It is not rounded to STACK_BOUNDARY; This size counts from zero. It is not rounded to PREFERRED_STACK_BOUNDARY;
the caller may have to do that. */ the caller may have to do that. */
HOST_WIDE_INT HOST_WIDE_INT
...@@ -4645,8 +4649,8 @@ assign_parms (fndecl, second_time) ...@@ -4645,8 +4649,8 @@ assign_parms (fndecl, second_time)
#endif #endif
#endif #endif
#ifdef STACK_BOUNDARY #ifdef PREFERRED_STACK_BOUNDARY
#define STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT) #define STACK_BYTES (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)
current_function_args_size current_function_args_size
= ((current_function_args_size + STACK_BYTES - 1) = ((current_function_args_size + STACK_BYTES - 1)
......
...@@ -790,15 +790,24 @@ size of an integer. ...@@ -790,15 +790,24 @@ size of an integer.
@findex STACK_BOUNDARY @findex STACK_BOUNDARY
@item STACK_BOUNDARY @item STACK_BOUNDARY
Define this macro if there is a guaranteed alignment for the stack
pointer on this machine. The definition is a C expression
for the desired alignment (measured in bits). This value is used as a
default if PREFERRED_STACK_BOUNDARY is not defined.
@findex PREFERRED_STACK_BOUNDARY
@item PREFERRED_STACK_BOUNDARY
Define this macro if you wish to preserve a certain alignment for Define this macro if you wish to preserve a certain alignment for
the stack pointer. The definition is a C expression the stack pointer. The definition is a C expression
for the desired alignment (measured in bits). for the desired alignment (measured in bits). If STACK_BOUNDARY is
also defined, this macro must evaluate to a value equal to or larger
than STACK_BOUNDARY.
@cindex @code{PUSH_ROUNDING}, interaction with @code{STACK_BOUNDARY} @cindex @code{PUSH_ROUNDING}, interaction with @code{PREFERRED_STACK_BOUNDARY}
If @code{PUSH_ROUNDING} is not defined, the stack will always be aligned If @code{PUSH_ROUNDING} is not defined, the stack will always be aligned
to the specified boundary. If @code{PUSH_ROUNDING} is defined and specifies a to the specified boundary. If @code{PUSH_ROUNDING} is defined and specifies
less strict alignment than @code{STACK_BOUNDARY}, the stack may be a less strict alignment than @code{PREFERRED_STACK_BOUNDARY}, the stack may
momentarily unaligned while pushing arguments. be momentarily unaligned while pushing arguments.
@findex FUNCTION_BOUNDARY @findex FUNCTION_BOUNDARY
@item FUNCTION_BOUNDARY @item FUNCTION_BOUNDARY
......
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