This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Provide default for FRAME_POINTER_REQUIRED
- From: Anatoly Sokolov <aesok at post dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 2 May 2009 14:56:30 +0400
- Subject: [PATCH] Provide default for FRAME_POINTER_REQUIRED
Hi.
This patch deletes FRAME_POINTER_REQUIRED for ports that have it defined as 0.
I propose this patch for simplify hookize the FRAME_POINTER_REQUIRED macro.
The patch has been bootstrapped on i686-pc-linux-gnu.
Ok?
Anatoly.
2008-04-02 Anatoly Sokolov <aesok@post.ru>
* defaults.h (FRAME_POINTER_REQUIRED): Provide default.
* doc/tm.texi (FRAME_POINTER_REQUIRED): Revise documentation.
* config/alpha/alpha.h (FRAME_POINTER_REQUIRED): Delete.
* config/s390/s390.h (FRAME_POINTER_REQUIRED): Delete.
* config/spu/spu.h (FRAME_POINTER_REQUIRED): Delete.
* config/sh/sh.h (FRAME_POINTER_REQUIRED): Delete.
* config/pdp11/pdp11.h (FRAME_POINTER_REQUIRED): Delete.
* config/stormy16/stormy16.h (FRAME_POINTER_REQUIRED): Delete.
* config/m68hc11/m68hc11.h (FRAME_POINTER_REQUIRED): Delete.
* config/iq2000/iq2000.h (FRAME_POINTER_REQUIRED): Delete.
* config/mn10300/mn10300.h (FRAME_POINTER_REQUIRED): Delete.
* config/ia64/ia64.h (FRAME_POINTER_REQUIRED): Delete.
* config/m68k/m68k.h (FRAME_POINTER_REQUIRED): Delete.
* config/rs6000/rs6000.h (FRAME_POINTER_REQUIRED): Delete.
* config/picochip/picochip.h (FRAME_POINTER_REQUIRED): Delete.
* config/mcore/mcore.h (FRAME_POINTER_REQUIRED): Delete.
* config/h8300/h8300.h (FRAME_POINTER_REQUIRED): Delete.
* config/v850/v850.h (FRAME_POINTER_REQUIRED): Delete.
Index: gcc/doc/tm.texi
===================================================================
--- gcc/doc/tm.texi (revision 147033)
+++ gcc/doc/tm.texi (working copy)
@@ -3738,15 +3738,16 @@
This is about eliminating the frame pointer and arg pointer.
@defmac FRAME_POINTER_REQUIRED
-A C expression which is nonzero if a function must have and use a frame
+A C expression which is @code{true} if a function must have and use a frame
pointer. This expression is evaluated in the reload pass. If its value is
-nonzero the function will have a frame pointer.
+@code{true} the function will have a frame pointer.
The expression can in principle examine the current function and decide
-according to the facts, but on most machines the constant 0 or the
-constant 1 suffices. Use 0 when the machine allows code to be generated
-with no frame pointer, and doing so saves some time or space. Use 1
-when there is no possible advantage to avoiding a frame pointer.
+according to the facts, but on most machines the constant @code{false} or the
+constant @code{true} suffices. Use @code{false} when the machine allows code
+to be generated with no frame pointer, and doing so saves some time or space.
+Use @code{true} when there is no possible advantage to avoiding a frame
+pointer.
In certain cases, the compiler does not know how to produce valid code
without a frame pointer. The compiler recognizes those cases and
@@ -3757,6 +3758,8 @@
In a function that does not require a frame pointer, the frame pointer
register can be allocated for ordinary usage, unless you mark it as a
fixed register. See @code{FIXED_REGISTERS} for more information.
+
+Default value is @code{false}.
@end defmac
@findex get_frame_size
Index: gcc/defaults.h
===================================================================
--- gcc/defaults.h (revision 147033)
+++ gcc/defaults.h (working copy)
@@ -969,4 +969,8 @@
#define GO_IF_MODE_DEPENDENT_ADDRESS(X, WIN)
#endif
+#ifndef FRAME_POINTER_REQUIRED
+#define FRAME_POINTER_REQUIRED false
+#endif
+
#endif /* ! GCC_DEFAULTS_H */
Index: gcc/config/alpha/alpha.h
===================================================================
--- gcc/config/alpha/alpha.h (revision 147033)
+++ gcc/config/alpha/alpha.h (working copy)
@@ -475,12 +475,6 @@
/* Base register for access to local variables of the function. */
#define HARD_FRAME_POINTER_REGNUM 15
-/* Value should be nonzero if functions must have frame pointers.
- Zero means the frame pointer need not be set up (and parms
- may be accessed via the stack pointer) in functions that seem suitable.
- This is computed in `reload', in reload1.c. */
-#define FRAME_POINTER_REQUIRED 0
-
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM 31
Index: gcc/config/s390/s390.h
===================================================================
--- gcc/config/s390/s390.h (revision 147033)
+++ gcc/config/s390/s390.h (working copy)
@@ -644,8 +644,6 @@
/* Frame pointer and argument pointer elimination. */
-#define FRAME_POINTER_REQUIRED 0
-
#define ELIMINABLE_REGS \
{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
{ FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
Index: gcc/config/spu/spu.h
===================================================================
--- gcc/config/spu/spu.h (revision 147033)
+++ gcc/config/spu/spu.h (working copy)
@@ -314,8 +314,6 @@
/* Elimination */
-#define FRAME_POINTER_REQUIRED 0
-
#define ELIMINABLE_REGS \
{{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
Index: gcc/config/sh/sh.h
===================================================================
--- gcc/config/sh/sh.h (revision 147033)
+++ gcc/config/sh/sh.h (working copy)
@@ -1262,12 +1262,6 @@
#define GOT_SYMBOL_NAME "*_GLOBAL_OFFSET_TABLE_"
-/* Value should be nonzero if functions must have frame pointers.
- Zero means the frame pointer need not be set up (and parms may be accessed
- via the stack pointer) in functions that seem suitable. */
-
-#define FRAME_POINTER_REQUIRED 0
-
/* Definitions for register eliminations.
We have three registers that can be eliminated on the SH. First, the
Index: gcc/config/pdp11/pdp11.h
===================================================================
--- gcc/config/pdp11/pdp11.h (revision 147033)
+++ gcc/config/pdp11/pdp11.h (working copy)
@@ -246,14 +246,6 @@
/* Base register for access to local variables of the function. */
#define FRAME_POINTER_REGNUM 5
-/* Value should be nonzero if functions must have frame pointers.
- Zero means the frame pointer need not be set up (and parms
- may be accessed via the stack pointer) in functions that seem suitable.
- This is computed in `reload', in reload1.c.
- */
-
-#define FRAME_POINTER_REQUIRED 0
-
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM 5
Index: gcc/config/stormy16/stormy16.h
===================================================================
--- gcc/config/stormy16/stormy16.h (revision 147033)
+++ gcc/config/stormy16/stormy16.h (working copy)
@@ -367,8 +367,6 @@
/* Eliminating the Frame Pointer and the Arg Pointer */
-#define FRAME_POINTER_REQUIRED 0
-
#define ELIMINABLE_REGS \
{ \
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
Index: gcc/config/m68hc11/m68hc11.h
===================================================================
--- gcc/config/m68hc11/m68hc11.h (revision 147033)
+++ gcc/config/m68hc11/m68hc11.h (working copy)
@@ -883,12 +883,6 @@
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
-/* Value should be nonzero if functions must have frame pointers.
- Zero means the frame pointer need not be set up (and parms may be
- accessed via the stack pointer) in functions that seem suitable.
- This is computed in `reload', in reload1.c. */
-#define FRAME_POINTER_REQUIRED 0
-
/* Given FROM and TO register numbers, say whether this elimination is allowed.
Frame pointer elimination is automatically handled.
Index: gcc/config/iq2000/iq2000.h
===================================================================
--- gcc/config/iq2000/iq2000.h (revision 147033)
+++ gcc/config/iq2000/iq2000.h (working copy)
@@ -345,8 +345,6 @@
/* Eliminating the Frame Pointer and the Arg Pointer. */
-#define FRAME_POINTER_REQUIRED 0
-
#define ELIMINABLE_REGS \
{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
Index: gcc/config/mn10300/mn10300.h
===================================================================
--- gcc/config/mn10300/mn10300.h (revision 147033)
+++ gcc/config/mn10300/mn10300.h (working copy)
@@ -491,7 +491,6 @@
/* We can debug without frame pointers on the mn10300, so eliminate
them whenever possible. */
-#define FRAME_POINTER_REQUIRED 0
#define CAN_DEBUG_WITHOUT_FP
/* Value is the number of bytes of arguments automatically
Index: gcc/config/ia64/ia64.h
===================================================================
--- gcc/config/ia64/ia64.h (revision 147033)
+++ gcc/config/ia64/ia64.h (working copy)
@@ -1005,11 +1005,6 @@
/* Eliminating the Frame Pointer and the Arg Pointer */
-/* A C expression which is nonzero if a function must have and use a frame
- pointer. This expression is evaluated in the reload pass. If its value is
- nonzero the function will have a frame pointer. */
-#define FRAME_POINTER_REQUIRED 0
-
/* Show we can debug even without a frame pointer. */
#define CAN_DEBUG_WITHOUT_FP
Index: gcc/config/m68k/m68k.h
===================================================================
--- gcc/config/m68k/m68k.h (revision 147033)
+++ gcc/config/m68k/m68k.h (working copy)
@@ -453,8 +453,6 @@
pointer is shifted to %a5 on this target. */
#define FRAME_POINTER_REGNUM A6_REG
-#define FRAME_POINTER_REQUIRED 0
-
/* Base register for access to arguments of the function.
* This isn't a hardware register. It will be eliminated to the
* stack pointer or frame pointer.
Index: gcc/config/rs6000/rs6000.h
===================================================================
--- gcc/config/rs6000/rs6000.h (revision 147033)
+++ gcc/config/rs6000/rs6000.h (working copy)
@@ -1027,12 +1027,6 @@
/* Base register for access to local variables of the function. */
#define FRAME_POINTER_REGNUM 113
-/* Value should be nonzero if functions must have frame pointers.
- Zero means the frame pointer need not be set up (and parms
- may be accessed via the stack pointer) in functions that seem suitable.
- This is computed in `reload', in reload1.c. */
-#define FRAME_POINTER_REQUIRED 0
-
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM 67
Index: gcc/config/picochip/picochip.h
===================================================================
--- gcc/config/picochip/picochip.h (revision 147033)
+++ gcc/config/picochip/picochip.h (working copy)
@@ -409,9 +409,6 @@
pointers are eliminated wherever possible, by replacing them with
offsets from the stack pointer. */
-/* We want to get rid of the frame pointer. */
-#define FRAME_POINTER_REQUIRED 0
-
#define ELIMINABLE_REGS \
{{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
Index: gcc/config/mcore/mcore.h
===================================================================
--- gcc/config/mcore/mcore.h (revision 147033)
+++ gcc/config/mcore/mcore.h (working copy)
@@ -303,11 +303,6 @@
#define MODES_TIEABLE_P(MODE1, MODE2) \
((MODE1) == (MODE2) || GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2))
-/* Value should be nonzero if functions must have frame pointers.
- Zero means the frame pointer need not be set up (and parms may be accessed
- via the stack pointer) in functions that seem suitable. */
-#define FRAME_POINTER_REQUIRED 0
-
/* Definitions for register eliminations.
We have two registers that can be eliminated on the MCore. First, the
Index: gcc/config/v850/v850.h
===================================================================
--- gcc/config/v850/v850.h (revision 147033)
+++ gcc/config/v850/v850.h (working copy)
@@ -506,12 +506,6 @@
/* Register in which static-chain is passed to a function. */
#define STATIC_CHAIN_REGNUM 20
-/* Value should be nonzero if functions must have frame pointers.
- Zero means the frame pointer need not be set up (and parms
- may be accessed via the stack pointer) in functions that seem suitable.
- This is computed in `reload', in reload1.c. */
-#define FRAME_POINTER_REQUIRED 0
-
/* If defined, this macro specifies a table of register pairs used to
eliminate unneeded registers that point into the stack frame. If
it is not defined, the only elimination attempted by the compiler
Index: gcc/config/h8300/h8300.h
===================================================================
--- gcc/config/h8300/h8300.h (revision 147033)
+++ gcc/config/h8300/h8300.h (working copy)
@@ -300,12 +300,6 @@
/* Base register for access to local variables of the function. */
#define FRAME_POINTER_REGNUM FP_REG
-/* Value should be nonzero if functions must have frame pointers.
- Zero means the frame pointer need not be set up (and parms
- may be accessed via the stack pointer) in functions that seem suitable.
- This is computed in `reload', in reload1.c. */
-#define FRAME_POINTER_REQUIRED 0
-
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM AP_REG