aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2005-06-26 07:18:53 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2005-06-26 07:18:53 +0200
commitf62c8a5c7996b97c736e3242de0d5527ec299a34 (patch)
tree390776c633d81d423d7316acdfdfa13dcefb5a65
parent567fb6602c70e0c7341a0b1a39b017419669027b (diff)
downloadgcc-f62c8a5c7996b97c736e3242de0d5527ec299a34.zip
gcc-f62c8a5c7996b97c736e3242de0d5527ec299a34.tar.gz
gcc-f62c8a5c7996b97c736e3242de0d5527ec299a34.tar.bz2
defaults.h (FRAME_GROWS_DOWNWARD): Define to 0 if not defined.
* 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
-rw-r--r--gcc/ChangeLog46
-rw-r--r--gcc/cfgexpand.c7
-rw-r--r--gcc/config/alpha/alpha.h4
-rw-r--r--gcc/config/alpha/unicosmk.h2
-rw-r--r--gcc/config/arc/arc.h4
-rw-r--r--gcc/config/arm/arm.h2
-rw-r--r--gcc/config/bfin/bfin.h4
-rw-r--r--gcc/config/c4x/c4x.h4
-rw-r--r--gcc/config/cris/cris.h2
-rw-r--r--gcc/config/fr30/fr30.h4
-rw-r--r--gcc/config/frv/frv.h6
-rw-r--r--gcc/config/h8300/h8300.h4
-rw-r--r--gcc/config/i386/i386.h4
-rw-r--r--gcc/config/i860/i860.h4
-rw-r--r--gcc/config/ia64/ia64.h6
-rw-r--r--gcc/config/iq2000/iq2000.h2
-rw-r--r--gcc/config/m68hc11/m68hc11.h6
-rw-r--r--gcc/config/m68k/m68k.h2
-rw-r--r--gcc/config/mmix/mmix.h2
-rw-r--r--gcc/config/mn10300/mn10300.h4
-rw-r--r--gcc/config/ns32k/ns32k.h4
-rw-r--r--gcc/config/pa/pa.h4
-rw-r--r--gcc/config/pdp11/pdp11.h4
-rw-r--r--gcc/config/rs6000/rs6000.h4
-rw-r--r--gcc/config/s390/s390.h2
-rw-r--r--gcc/config/sh/sh.h6
-rw-r--r--gcc/config/sparc/sparc.h4
-rw-r--r--gcc/config/stormy16/stormy16.h2
-rw-r--r--gcc/config/v850/v850.h4
-rw-r--r--gcc/config/vax/vax.h4
-rw-r--r--gcc/defaults.h4
-rw-r--r--gcc/doc/rtl.texi6
-rw-r--r--gcc/doc/tm.texi4
-rw-r--r--gcc/function.c66
34 files changed, 137 insertions, 100 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 18c7e41..db5ef09 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,45 @@
+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
@@ -147,8 +189,8 @@
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>
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index cfd955a..1747309 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -88,13 +88,6 @@ failed:
#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. */
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 78b3392..19668e9 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -735,11 +735,11 @@ extern int alpha_memory_latency;
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
diff --git a/gcc/config/alpha/unicosmk.h b/gcc/config/alpha/unicosmk.h
index 251e366..da7d375 100644
--- a/gcc/config/alpha/unicosmk.h
+++ b/gcc/config/alpha/unicosmk.h
@@ -96,7 +96,7 @@ Boston, MA 02110-1301, USA. */
/* 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
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index d9b51c0..f4e4648 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -456,11 +456,11 @@ extern enum reg_class arc_regno_reg_class[FIRST_PSEUDO_REGISTER];
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
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index fe3e7a6..65b4bad 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1334,7 +1334,7 @@ enum reg_class
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. */
diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h
index edea77e..c366fbc 100644
--- a/gcc/config/bfin/bfin.h
+++ b/gcc/config/bfin/bfin.h
@@ -79,11 +79,11 @@ extern const char *bfin_library_id_string;
#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. */
diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h
index c397257..895a34b 100644
--- a/gcc/config/c4x/c4x.h
+++ b/gcc/config/c4x/c4x.h
@@ -863,12 +863,12 @@ enum reg_class
/* #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. */
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 786e63c..25c0cd4 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -681,7 +681,7 @@ enum reg_class
/* 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. */
diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h
index b2a0a26..37ed63a 100644
--- a/gcc/config/fr30/fr30.h
+++ b/gcc/config/fr30/fr30.h
@@ -463,8 +463,8 @@ enum reg_class
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
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index 2cbcb29..b33805c 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -1445,9 +1445,9 @@ typedef struct frv_stack {
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.
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index da43488..3b38e31 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -485,12 +485,12 @@ enum reg_class {
#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
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index bc8fa0e..11e0a3c 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1356,11 +1356,11 @@ enum reg_class
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
diff --git a/gcc/config/i860/i860.h b/gcc/config/i860/i860.h
index 0a22447..07da9b9 100644
--- a/gcc/config/i860/i860.h
+++ b/gcc/config/i860/i860.h
@@ -356,11 +356,11 @@ enum reg_class { NO_REGS, GENERAL_REGS, FP_REGS, ALL_REGS, LIM_REG_CLASSES };
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
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 342a243..e97bf07 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -949,9 +949,9 @@ enum reg_class
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. */
diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h
index e4471af..f60b627 100644
--- a/gcc/config/iq2000/iq2000.h
+++ b/gcc/config/iq2000/iq2000.h
@@ -301,7 +301,7 @@ enum reg_class
#define STACK_GROWS_DOWNWARD
-/* #define FRAME_GROWS_DOWNWARD */
+#define FRAME_GROWS_DOWNWARD 0
#define STARTING_FRAME_OFFSET \
(current_function_outgoing_args_size)
diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index 95cf68b..b033d6e 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -800,14 +800,14 @@ extern enum reg_class m68hc11_tmp_regs_class;
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. */
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index a60f06e..e986f11 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -448,7 +448,7 @@ extern enum reg_class regno_reg_class[];
/* 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.
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 0fe3359..9ae7bc7 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -534,7 +534,7 @@ enum reg_class
/* Node: Frame Layout */
#define STACK_GROWS_DOWNWARD
-#define FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 1
#define STARTING_FRAME_OFFSET \
mmix_starting_frame_offset ()
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index 7ecf001..e86c7b5 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -480,12 +480,12 @@ enum reg_class {
#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
diff --git a/gcc/config/ns32k/ns32k.h b/gcc/config/ns32k/ns32k.h
index 504a63b..1e503cf 100644
--- a/gcc/config/ns32k/ns32k.h
+++ b/gcc/config/ns32k/ns32k.h
@@ -452,11 +452,11 @@ enum reg_class
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
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index e2ce631..b20a1b7 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -494,11 +494,11 @@ extern struct rtx_def *hppa_pic_save_rtx (void);
/* 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
diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
index 6cf36d4..bb83fdf 100644
--- a/gcc/config/pdp11/pdp11.h
+++ b/gcc/config/pdp11/pdp11.h
@@ -415,12 +415,12 @@ loading is easier into LOAD_FPU_REGS than FPU_REGS! */
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
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index cde6ac6..fdc1dc1 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1218,14 +1218,14 @@ extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */
/* 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 \
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index c92acac..77387e6 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -506,7 +506,7 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
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
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index eabdc30..fafa09e 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1694,11 +1694,11 @@ extern enum reg_class reg_class_from_letter[];
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. */
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index b39530b..95fd760 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1360,11 +1360,11 @@ extern char leaf_reg_remap[];
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
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 1bcaf3f..d224271 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -337,7 +337,7 @@ enum reg_class
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
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index bc8b040..4b0af76 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -434,12 +434,12 @@ enum reg_class
#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
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 8d29b58..ca806fe 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -314,11 +314,11 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
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
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 9314d9d..8474978 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -842,4 +842,8 @@ do { fputs (integer_asm_op (POINTER_SIZE / BITS_PER_UNIT, TRUE), FILE); \
#define MAX_OFILE_ALIGNMENT BIGGEST_ALIGNMENT
#endif
+#ifndef FRAME_GROWS_DOWNWARD
+#define FRAME_GROWS_DOWNWARD 0
+#endif
+
#endif /* ! GCC_DEFAULTS_H */
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index daca4cb..72853a6 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -1505,9 +1505,9 @@ value of @code{FIRST_PARM_OFFSET}.
@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
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index b2310e0..fbf5cd1 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -2752,8 +2752,8 @@ which is often wrong.
@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
diff --git a/gcc/function.c b/gcc/function.c
index 45f1316..c5c8dd8 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -347,11 +347,10 @@ free_after_compilation (struct function *f)
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.
@@ -412,9 +411,8 @@ assign_stack_local_1 (enum machine_mode mode, HOST_WIDE_INT size, int align,
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)
@@ -440,17 +438,16 @@ assign_stack_local_1 (enum machine_mode mode, HOST_WIDE_INT size, int align,
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,
@@ -471,9 +468,8 @@ assign_stack_local_1 (enum machine_mode mode, HOST_WIDE_INT size, int align,
(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);
@@ -698,20 +694,22 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size,
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;