* defaults.h (FRAME_GROWS_DOWNWARD): Define to 0 if not defined.
* function.c (get_func_frame_size): Use if (FRAME_GROWS_DOWNWARD)
instead of preprocessor conditionals.
(assign_stack_local_1, assign_stack_temp_for_type): Likewise.
* cfgexpand.c (FRAME_GROWS_DOWNWARD): Don't redefine to 1 or 0
depending on if it was or was not defined previously.
* doc/rtl.texi (VIRTUAL_STACK_VARS_REGNUM): Mention that only non-zero
definition of FRAME_GROWS_DOWNWARD means frame grows downward.
* doc/tm.texi (FRAME_GROWS_DOWNWARD): Likewise.
* config/m68hc11/m68hc11.h (FRAME_GROWS_DOWNWARD): Define to 0. Update
comment.
* config/pa/pa.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/rs6000/rs6000.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/stormy16/stormy16.h (FRAME_GROWS_DOWNWARD): Define to 0.
* config/c4x/c4x.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/sh/sh.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/ia64/ia64.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/iq2000/iq2000.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/pdp11/pdp11.h (FRAME_GROWS_DOWNWARD): Define to 1. Update
comment.
* config/i860/i860.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/h8300/h8300.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/arc/arc.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/vax/vax.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/sparc/sparc.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/i386/i386.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/fr30/fr30.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/frv/frv.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/mn10300/mn10300.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/bfin/bfin.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/ns32k/ns32k.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/v850/v850.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/alpha/alpha.h (FRAME_GROWS_DOWNWARD): Update comment.
* config/s390/s390.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/arm/arm.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/alpha/unicosmk.h (FRAME_GROWS_DOWNWARD): Define to 1.
* config/cris/cris.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/m68k/m68k.h (FRAME_GROWS_DOWNWARD): Likewise.
* config/mmix/mmix.h (FRAME_GROWS_DOWNWARD): Likewise.
From-SVN: r101329
+2005-06-26 Jakub Jelinek <jakub@redhat.com>
+
+ * defaults.h (FRAME_GROWS_DOWNWARD): Define to 0 if not defined.
+ * function.c (get_func_frame_size): Use if (FRAME_GROWS_DOWNWARD)
+ instead of preprocessor conditionals.
+ (assign_stack_local_1, assign_stack_temp_for_type): Likewise.
+ * cfgexpand.c (FRAME_GROWS_DOWNWARD): Don't redefine to 1 or 0
+ depending on if it was or was not defined previously.
+ * doc/rtl.texi (VIRTUAL_STACK_VARS_REGNUM): Mention that only non-zero
+ definition of FRAME_GROWS_DOWNWARD means frame grows downward.
+ * doc/tm.texi (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/m68hc11/m68hc11.h (FRAME_GROWS_DOWNWARD): Define to 0. Update
+ comment.
+ * config/pa/pa.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/rs6000/rs6000.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/stormy16/stormy16.h (FRAME_GROWS_DOWNWARD): Define to 0.
+ * config/c4x/c4x.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/sh/sh.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/ia64/ia64.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/iq2000/iq2000.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/pdp11/pdp11.h (FRAME_GROWS_DOWNWARD): Define to 1. Update
+ comment.
+ * config/i860/i860.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/h8300/h8300.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/arc/arc.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/vax/vax.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/sparc/sparc.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/i386/i386.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/fr30/fr30.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/frv/frv.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/mn10300/mn10300.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/bfin/bfin.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/ns32k/ns32k.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/v850/v850.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/alpha/alpha.h (FRAME_GROWS_DOWNWARD): Update comment.
+ * config/s390/s390.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/arm/arm.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/alpha/unicosmk.h (FRAME_GROWS_DOWNWARD): Define to 1.
+ * config/cris/cris.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/m68k/m68k.h (FRAME_GROWS_DOWNWARD): Likewise.
+ * config/mmix/mmix.h (FRAME_GROWS_DOWNWARD): Likewise.
+
2005-06-26 Kazu Hirata <kazu@codesourcery.com>
PR tree-optimization/22026
2005-06-21 Jeff Law <law@redhat.com>
- * tree-vrp.c (extract_range_from_unary_expr): Handle type
- conversions better.
+ * tree-vrp.c (extract_range_from_unary_expr): Handle type
+ conversions better.
2005-06-21 Dorit Nuzman <dorit@il.ibm.com>
#define STACK_ALIGNMENT_NEEDED 1
#endif
-#ifdef FRAME_GROWS_DOWNWARD
-# undef FRAME_GROWS_DOWNWARD
-# define FRAME_GROWS_DOWNWARD 1
-#else
-# define FRAME_GROWS_DOWNWARD 0
-#endif
-
/* This structure holds data relevant to one variable that will be
placed in a stack slot. */
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-/* #define FRAME_GROWS_DOWNWARD */
+/* #define FRAME_GROWS_DOWNWARD 0 */
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
\f
/* The stack frame grows downward. */
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* Define the offset between two registers, one to be eliminated, and the
other its replacement, at the start of a routine. This is somewhat
pointer to a smaller address. */
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD 1
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
#define STACK_PUSH_CODE PRE_DEC
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* We define a dummy ARGP register; the parameters start at offset 0 from
it. */
/* #define STACK_GROWS_DOWNWARD. */
/* Like the dsp16xx, i370, i960, and we32k ports. */
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-/* #define FRAME_GROWS_DOWNWARD. */
+#define FRAME_GROWS_DOWNWARD 0
/* Registers That Address the Stack Frame. */
/* Node: Frame Layout */
#define STACK_GROWS_DOWNWARD
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* It seems to be indicated in the code (at least 2.1) that this is
better a constant, and best 0. */
to a smaller address. */
#define STACK_GROWS_DOWNWARD 1
-/* Define this macro if the addresses of local variable slots are at negative
- offsets from the frame pointer. */
+/* Define this to macro non-zero if the addresses of local variable slots
+ are at negative offsets from the frame pointer. */
#define FRAME_GROWS_DOWNWARD 1
/* Offset from the frame pointer to the first local variable slot to be
to a smaller address. */
#define STACK_GROWS_DOWNWARD 1
-/* Define this macro if the addresses of local variable slots are at negative
- offsets from the frame pointer. */
-#define FRAME_GROWS_DOWNWARD
+/* Define this macro to non-zero if the addresses of local variable slots
+ are at negative offsets from the frame pointer. */
+#define FRAME_GROWS_DOWNWARD 1
/* Offset from the frame pointer to the first local variable slot to be
allocated.
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
to a smaller address. */
#define STACK_GROWS_DOWNWARD 1
-/* Define this macro if the addresses of local variable slots are at negative
- offsets from the frame pointer. */
-/* #define FRAME_GROWS_DOWNWARD */
+/* Define this macro to non-zero if the addresses of local variable slots
+ are at negative offsets from the frame pointer. */
+#define FRAME_GROWS_DOWNWARD 0
/* Offset from the frame pointer to the first local variable slot to
be allocated. */
#define STACK_GROWS_DOWNWARD
-/* #define FRAME_GROWS_DOWNWARD */
+#define FRAME_GROWS_DOWNWARD 0
#define STARTING_FRAME_OFFSET \
(current_function_outgoing_args_size)
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame.
- Don't define for 68HC11, the frame pointer is the bottom
+ Define to 0 for 68HC11, the frame pointer is the bottom
of local variables. */
-/* #define FRAME_GROWS_DOWNWARD */
+#define FRAME_GROWS_DOWNWARD 0
/* Define this if successive arguments to a function occupy decreasing
addresses in the stack. */
/* Stack layout; function entry, exit and calling. */
#define STACK_GROWS_DOWNWARD
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
#define STARTING_FRAME_OFFSET 0
/* On the 680x0, sp@- in a byte insn really pushes a word.
/* Node: Frame Layout */
#define STACK_GROWS_DOWNWARD
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
#define STARTING_FRAME_OFFSET \
mmix_starting_frame_offset ()
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
/* Believe it or not. */
#define ARGS_GROW_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-/* #define FRAME_GROWS_DOWNWARD */
+#define FRAME_GROWS_DOWNWARD 0
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame.
*/
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
/* Offsets recorded in opcodes are a multiple of this alignment factor. */
#define DWARF_CIE_DATA_ALIGNMENT (-((int) (TARGET_32BIT ? 4 : 8)))
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame.
On the RS/6000, we grow upwards, from the area after the outgoing
arguments. */
-/* #define FRAME_GROWS_DOWNWARD */
+#define FRAME_GROWS_DOWNWARD 0
/* Size of the outgoing register save area */
#define RS6000_REG_SAVE ((DEFAULT_ABI == ABI_AIX \
are accessed by positive offsets, and function arguments are stored at
increasing addresses. */
#define STACK_GROWS_DOWNWARD
-/* #undef FRAME_GROWS_DOWNWARD */
+/* #define FRAME_GROWS_DOWNWARD 0 */
/* #undef ARGS_GROW_DOWNWARD */
/* The basic stack layout looks like this: the stack pointer points
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD
-/* Define this macro if the addresses of local variable slots are at
- negative offsets from the frame pointer.
+/* Define this macro to non-zero if the addresses of local variable slots
+ are at negative offsets from the frame pointer.
The SH only has positive indexes, so grow the frame up. */
-/* #define FRAME_GROWS_DOWNWARD */
+#define FRAME_GROWS_DOWNWARD 0
/* Offset from the frame pointer to the first local variable slot to
be allocated. */
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
because we don't have any pre-increment ones. */
#define STACK_PUSH_CODE POST_INC
-/* #define FRAME_GROWS_DOWNWARD */
+#define FRAME_GROWS_DOWNWARD 0
#define ARGS_GROW_DOWNWARD 1
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD
-/* Define this if the nominal address of the stack frame
+/* Define this to non-zero if the nominal address of the stack frame
is at the high-address end of the local variables;
that is, each additional local variable allocated
goes at a more negative offset in the frame. */
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
/* Offset within stack frame to start allocating local variables at.
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
#define MAX_OFILE_ALIGNMENT BIGGEST_ALIGNMENT
#endif
+#ifndef FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 0
+#endif
+
#endif /* ! GCC_DEFAULTS_H */
@findex VIRTUAL_STACK_VARS_REGNUM
@cindex @code{FRAME_GROWS_DOWNWARD} and virtual registers
@item VIRTUAL_STACK_VARS_REGNUM
-If @code{FRAME_GROWS_DOWNWARD} is defined, this points to immediately
-above the first variable on the stack. Otherwise, it points to the
-first variable on the stack.
+If @code{FRAME_GROWS_DOWNWARD} is defined to a non-zero value, this points
+to immediately above the first variable on the stack. Otherwise, it points
+to the first variable on the stack.
@cindex @code{STARTING_FRAME_OFFSET} and virtual registers
@cindex @code{FRAME_POINTER_REGNUM} and virtual registers
@end defmac
@defmac FRAME_GROWS_DOWNWARD
-Define this macro if the addresses of local variable slots are at negative
-offsets from the frame pointer.
+Define this macro to non-zero value if the addresses of local variable slots
+are at negative offsets from the frame pointer.
@end defmac
@defmac ARGS_GROW_DOWNWARD
static HOST_WIDE_INT
get_func_frame_size (struct function *f)
{
-#ifdef FRAME_GROWS_DOWNWARD
- return -f->x_frame_offset;
-#else
- return f->x_frame_offset;
-#endif
+ if (FRAME_GROWS_DOWNWARD)
+ return -f->x_frame_offset;
+ else
+ return f->x_frame_offset;
}
/* Return size needed for stack frame based on slots so far allocated.
else
alignment = align / BITS_PER_UNIT;
-#ifdef FRAME_GROWS_DOWNWARD
- function->x_frame_offset -= size;
-#endif
+ if (FRAME_GROWS_DOWNWARD)
+ function->x_frame_offset -= size;
/* Ignore alignment we can't do with expected alignment of the boundary. */
if (alignment * BITS_PER_UNIT > PREFERRED_STACK_BOUNDARY)
division with a negative dividend isn't as well defined as we might
like. So we instead assume that ALIGNMENT is a power of two and
use logical operations which are unambiguous. */
-#ifdef FRAME_GROWS_DOWNWARD
- function->x_frame_offset
- = (FLOOR_ROUND (function->x_frame_offset - frame_phase,
- (unsigned HOST_WIDE_INT) alignment)
- + frame_phase);
-#else
- function->x_frame_offset
- = (CEIL_ROUND (function->x_frame_offset - frame_phase,
- (unsigned HOST_WIDE_INT) alignment)
- + frame_phase);
-#endif
+ if (FRAME_GROWS_DOWNWARD)
+ function->x_frame_offset
+ = (FLOOR_ROUND (function->x_frame_offset - frame_phase,
+ (unsigned HOST_WIDE_INT) alignment)
+ + frame_phase);
+ else
+ function->x_frame_offset
+ = (CEIL_ROUND (function->x_frame_offset - frame_phase,
+ (unsigned HOST_WIDE_INT) alignment)
+ + frame_phase);
}
/* On a big-endian machine, if we are allocating more space than we will use,
(function->x_frame_offset + bigend_correction,
Pmode));
-#ifndef FRAME_GROWS_DOWNWARD
- function->x_frame_offset += size;
-#endif
+ if (!FRAME_GROWS_DOWNWARD)
+ function->x_frame_offset += size;
x = gen_rtx_MEM (mode, addr);
can be either above or below this stack slot depending on which
way the frame grows. We include the extra space if and only if it
is above this slot. */
-#ifdef FRAME_GROWS_DOWNWARD
- p->size = frame_offset_old - frame_offset;
-#else
- p->size = size;
-#endif
+ if (FRAME_GROWS_DOWNWARD)
+ p->size = frame_offset_old - frame_offset;
+ else
+ p->size = size;
/* Now define the fields used by combine_temp_slots. */
-#ifdef FRAME_GROWS_DOWNWARD
- p->base_offset = frame_offset;
- p->full_size = frame_offset_old - frame_offset;
-#else
- p->base_offset = frame_offset_old;
- p->full_size = frame_offset - frame_offset_old;
-#endif
+ if (FRAME_GROWS_DOWNWARD)
+ {
+ p->base_offset = frame_offset;
+ p->full_size = frame_offset_old - frame_offset;
+ }
+ else
+ {
+ p->base_offset = frame_offset_old;
+ p->full_size = frame_offset - frame_offset_old;
+ }
p->address = 0;
selected = p;