summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2016-09-09 23:08:54 +0000
committerBernd Edlinger <edlinger@gcc.gnu.org>2016-09-09 23:08:54 +0000
commit5368023839d4bfc78f980692670be093cf2fdf2f (patch)
tree4d461b9c92a59711ad23eb413d2d749005c37320 /gcc
parent7e4955774fe4e365ec762a51d90ef6365b8be315 (diff)
tm.texi.in (INITIAL_FRAME_POINTER_OFFSET): Remove.
2016-09-10 Bernd Edlinger <bernd.edlinger@hotmail.de> * doc/tm.texi.in (INITIAL_FRAME_POINTER_OFFSET): Remove. (ELIMINABLE_REGS, TARGET_CAN_ELIMINATE, INITIAL_ELIMINATION_OFFSET) : Update documentation. * target.def (frame_pointer_required, can_eliminate): Likewise. * doc/tm.texi: Regenerated. * builtins.c (expand_builtin_setjmp_receiver): Remove #ifdef ELIMINABLE_REGS. * df-scan.c (df_hard_reg_init): Likewise. * ira.c (ira_setup_eliminable_regset): Likewise. * lra-eliminations.c (reg_eliminate_1, (update_reg_eliminate, init_elim_table): Likewise. * reload1.c (reg_eliminate_1, verify_initial_elim_offsets, set_initial_elim_offsets, update_eliminables, init_elim_table): Likewise. * rtlanal.c (get_initial_register_offset): Likewise. * config/ft32/ft32.h (INITIAL_FRAME_POINTER_OFFSET): Remove. * config/m32r/m32r.h (INITIAL_FRAME_POINTER_OFFSET): Likewise. * config/moxie/moxie.h (INITIAL_FRAME_POINTER_OFFSET): Likewise. * config/vax/vax.h (INITIAL_FRAME_POINTER_OFFSET): Likewise. * config/fr30/fr30.h: Fix comment. * config/frv/frv.c: Likewise. * config/frv/frv.h: Likewise. * config/ft32/ft32.h: Likewise. * config/visium/visium.h: Likewise. * config/pa/pa64-linux.h: Likewise. * config/v850/v850.h: Likewise. * config/cris/cris.c: Likewise. * config/ia64/ia64.h: Likewise. * config/moxie/moxie.h: Likewise. * config/m32r/m32r.h: Likewise. From-SVN: r240058
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog33
-rw-r--r--gcc/builtins.c2
-rw-r--r--gcc/config/cris/cris.c3
-rw-r--r--gcc/config/fr30/fr30.h5
-rw-r--r--gcc/config/frv/frv.c5
-rw-r--r--gcc/config/frv/frv.h5
-rw-r--r--gcc/config/ft32/ft32.h8
-rw-r--r--gcc/config/ia64/ia64.h6
-rw-r--r--gcc/config/m32r/m32r.h15
-rw-r--r--gcc/config/moxie/moxie.h8
-rw-r--r--gcc/config/pa/pa64-linux.h6
-rw-r--r--gcc/config/v850/v850.h6
-rw-r--r--gcc/config/vax/vax.h10
-rw-r--r--gcc/config/visium/visium.h6
-rw-r--r--gcc/df-scan.c7
-rw-r--r--gcc/doc/tm.texi37
-rw-r--r--gcc/doc/tm.texi.in28
-rw-r--r--gcc/ira.c17
-rw-r--r--gcc/lra-eliminations.c22
-rw-r--r--gcc/reload1.c47
-rw-r--r--gcc/rtlanal.c28
-rw-r--r--gcc/target.def11
22 files changed, 85 insertions, 230 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 29d329ef080..eb8ad6e5a4b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,36 @@
+2016-09-10 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * doc/tm.texi.in (INITIAL_FRAME_POINTER_OFFSET): Remove.
+ (ELIMINABLE_REGS, TARGET_CAN_ELIMINATE,
+ INITIAL_ELIMINATION_OFFSET) : Update documentation.
+ * target.def (frame_pointer_required, can_eliminate): Likewise.
+ * doc/tm.texi: Regenerated.
+ * builtins.c (expand_builtin_setjmp_receiver): Remove #ifdef
+ ELIMINABLE_REGS.
+ * df-scan.c (df_hard_reg_init): Likewise.
+ * ira.c (ira_setup_eliminable_regset): Likewise.
+ * lra-eliminations.c (reg_eliminate_1, (update_reg_eliminate,
+ init_elim_table): Likewise.
+ * reload1.c (reg_eliminate_1, verify_initial_elim_offsets,
+ set_initial_elim_offsets, update_eliminables,
+ init_elim_table): Likewise.
+ * rtlanal.c (get_initial_register_offset): Likewise.
+ * config/ft32/ft32.h (INITIAL_FRAME_POINTER_OFFSET): Remove.
+ * config/m32r/m32r.h (INITIAL_FRAME_POINTER_OFFSET): Likewise.
+ * config/moxie/moxie.h (INITIAL_FRAME_POINTER_OFFSET): Likewise.
+ * config/vax/vax.h (INITIAL_FRAME_POINTER_OFFSET): Likewise.
+ * config/fr30/fr30.h: Fix comment.
+ * config/frv/frv.c: Likewise.
+ * config/frv/frv.h: Likewise.
+ * config/ft32/ft32.h: Likewise.
+ * config/visium/visium.h: Likewise.
+ * config/pa/pa64-linux.h: Likewise.
+ * config/v850/v850.h: Likewise.
+ * config/cris/cris.c: Likewise.
+ * config/ia64/ia64.h: Likewise.
+ * config/moxie/moxie.h: Likewise.
+ * config/m32r/m32r.h: Likewise.
+
2016-09-10 Alexander Ivchenko <alexander.ivchenko@intel.com>
PR target/77267
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 1073e35b17b..4a2a398744b 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -862,7 +862,6 @@ expand_builtin_setjmp_receiver (rtx receiver_label)
if (!HARD_FRAME_POINTER_IS_ARG_POINTER && fixed_regs[ARG_POINTER_REGNUM])
{
-#ifdef ELIMINABLE_REGS
/* If the argument pointer can be eliminated in favor of the
frame pointer, we don't need to restore it. We assume here
that if such an elimination is present, it can always be used.
@@ -877,7 +876,6 @@ expand_builtin_setjmp_receiver (rtx receiver_label)
break;
if (i == ARRAY_SIZE (elim_regs))
-#endif
{
/* Now restore our arg pointer from the address at which it
was saved in our stack frame. */
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 971d07fb12a..7a2ac81f8ff 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -1282,8 +1282,7 @@ cris_return_address_on_stack_for_return (void)
: cris_return_address_on_stack ();
}
-/* This used to be the INITIAL_FRAME_POINTER_OFFSET worker; now only
- handles FP -> SP elimination offset. */
+/* This handles FP -> SP elimination offset. */
static int
cris_initial_frame_pointer_offset (void)
diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h
index 51a05db9c2d..82366e35415 100644
--- a/gcc/config/fr30/fr30.h
+++ b/gcc/config/fr30/fr30.h
@@ -460,9 +460,8 @@ enum reg_class
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \
}
-/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It specifies the
- initial difference between the specified pair of registers. This macro must
- be defined if `ELIMINABLE_REGS' is defined. */
+/* This macro returns the initial difference between the specified pair
+ of registers. */
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
(OFFSET) = fr30_compute_frame_size (FROM, TO)
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 957ff0390a0..4bfa8273aa3 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -2076,9 +2076,8 @@ frv_can_eliminate (const int from, const int to)
: true);
}
-/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It specifies the
- initial difference between the specified pair of registers. This macro must
- be defined if `ELIMINABLE_REGS' is defined. */
+/* This function returns the initial difference between the specified
+ pair of registers. */
/* See frv_stack_info for more details on the frv stack frame. */
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index 8d41b6aa84a..e7f87b1ff88 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -1197,9 +1197,8 @@ typedef struct frv_stack {
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \
}
-/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It specifies the
- initial difference between the specified pair of registers. This macro must
- be defined if `ELIMINABLE_REGS' is defined. */
+/* This macro returns the initial difference between the specified pair
+ of registers. */
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
(OFFSET) = frv_initial_elimination_offset (FROM, TO)
diff --git a/gcc/config/ft32/ft32.h b/gcc/config/ft32/ft32.h
index dd40b1de0b6..6bfd4851fe6 100644
--- a/gcc/config/ft32/ft32.h
+++ b/gcc/config/ft32/ft32.h
@@ -250,8 +250,6 @@ enum reg_class
pointer to a smaller address. */
#define STACK_GROWS_DOWNWARD 1
-#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0
-
/* Offset from the frame pointer to the first local variable slot to
be allocated. */
#define STARTING_FRAME_OFFSET 0
@@ -426,10 +424,8 @@ do { \
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
-/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
- specifies the initial difference between the specified pair of
- registers. This macro must be defined if `ELIMINABLE_REGS' is
- defined. */
+/* This macro returns the initial difference between the specified pair
+ of registers. */
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
do { \
(OFFSET) = ft32_initial_elimination_offset ((FROM), (TO)); \
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 4e1b7af6ab7..daf717b949d 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -961,10 +961,8 @@ enum reg_class
{FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
}
-/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
- specifies the initial difference between the specified pair of
- registers. This macro must be defined if `ELIMINABLE_REGS' is
- defined. */
+/* This macro returns the initial difference between the specified pair
+ of registers. */
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
((OFFSET) = ia64_initial_elimination_offset ((FROM), (TO)))
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index 2ff4a459dc4..cd74cfcf3b5 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -581,15 +581,6 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
/* Eliminating the frame and arg pointers. */
-#if 0
-/* C statement to store the difference between the frame pointer
- and the stack pointer values immediately after the function prologue.
- If `ELIMINABLE_REGS' is defined, this macro will be not be used and
- need not be defined. */
-#define INITIAL_FRAME_POINTER_OFFSET(VAR) \
-((VAR) = m32r_compute_frame_size (get_frame_size ()))
-#endif
-
/* 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
@@ -604,10 +595,8 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
{ ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }}
-/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
- specifies the initial difference between the specified pair of
- registers. This macro must be defined if `ELIMINABLE_REGS' is
- defined. */
+/* This macro returns the initial difference between the specified pair
+ of registers. */
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
do \
diff --git a/gcc/config/moxie/moxie.h b/gcc/config/moxie/moxie.h
index b9cb38bf139..204e23c405b 100644
--- a/gcc/config/moxie/moxie.h
+++ b/gcc/config/moxie/moxie.h
@@ -243,8 +243,6 @@ enum reg_class
pointer to a smaller address. */
#define STACK_GROWS_DOWNWARD 1
-#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0
-
/* Offset from the frame pointer to the first local variable slot to
be allocated. */
#define STARTING_FRAME_OFFSET 0
@@ -386,10 +384,8 @@ enum reg_class
{{ FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
{ ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }}
-/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
- specifies the initial difference between the specified pair of
- registers. This macro must be defined if `ELIMINABLE_REGS' is
- defined. */
+/* This macro returns the initial difference between the specified pair
+ of registers. */
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
do { \
(OFFSET) = moxie_initial_elimination_offset ((FROM), (TO)); \
diff --git a/gcc/config/pa/pa64-linux.h b/gcc/config/pa/pa64-linux.h
index 540bfa64c6c..4bf1f795c5e 100644
--- a/gcc/config/pa/pa64-linux.h
+++ b/gcc/config/pa/pa64-linux.h
@@ -28,10 +28,8 @@ along with GCC; see the file COPYING3. If not see
{ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
}
-/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
- specifies the initial difference between the specified pair of
- registers. This macro must be defined if `ELIMINABLE_REGS' is
- defined. */
+/* This macro returns the initial difference between the specified pair
+ of registers. */
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
do \
{ \
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index c326df92e69..ae5e9ce96e9 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -505,10 +505,8 @@ enum reg_class
{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
{ ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }} \
-/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
- specifies the initial difference between the specified pair of
- registers. This macro must be defined if `ELIMINABLE_REGS' is
- defined. */
+/* This macro returns the initial difference between the specified pair
+ of registers. */
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
{ \
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index a381039d008..77d9e7f0729 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -340,16 +340,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
#define EXIT_IGNORE_STACK 1
-/* Store in the variable DEPTH the initial difference between the
- frame pointer reg contents and the stack pointer reg contents,
- as of the start of the function body. This depends on the layout
- of the fixed parts of the stack frame and on how registers are saved.
-
- On the VAX, FRAME_POINTER_REQUIRED is always 1, so the definition of this
- macro doesn't matter. But it must be defined. */
-
-#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0;
-
/* Length in units of the trampoline for entering a nested function. */
#define TRAMPOLINE_SIZE 15
diff --git a/gcc/config/visium/visium.h b/gcc/config/visium/visium.h
index 0f195c07c66..f7e3da4c069 100644
--- a/gcc/config/visium/visium.h
+++ b/gcc/config/visium/visium.h
@@ -963,10 +963,8 @@ enum reg_class
/* `INITIAL_ELIMINATION_OFFSET (FROM-REG, TO-REG, OFFSET-VAR)'
- This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It
- specifies the initial difference between the specified pair of
- registers. This macro must be defined if `ELIMINABLE_REGS' is
- defined. */
+ This macro returns the initial difference between the specified pair
+ of registers. */
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
(OFFSET = visium_initial_elimination_offset (FROM, TO))
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 9cd647a3213..c8dbf8ddb00 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -3829,10 +3829,9 @@ static bool initialized = false;
void
df_hard_reg_init (void)
{
-#ifdef ELIMINABLE_REGS
int i;
static const struct {const int from, to; } eliminables[] = ELIMINABLE_REGS;
-#endif
+
if (initialized)
return;
@@ -3840,12 +3839,8 @@ df_hard_reg_init (void)
mark_used_regs. */
CLEAR_HARD_REG_SET (elim_reg_set);
-#ifdef ELIMINABLE_REGS
for (i = 0; i < (int) ARRAY_SIZE (eliminables); i++)
SET_HARD_REG_BIT (elim_reg_set, eliminables[i].from);
-#else
- SET_HARD_REG_BIT (elim_reg_set, FRAME_POINTER_REGNUM);
-#endif
initialized = true;
}
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 58662606243..98a6a97d158 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -3624,7 +3624,7 @@ pointer.
In certain cases, the compiler does not know how to produce valid code
without a frame pointer. The compiler recognizes those cases and
automatically gives the function a frame pointer regardless of what
-@code{TARGET_FRAME_POINTER_REQUIRED} returns. You don't need to worry about
+@code{targetm.frame_pointer_required} returns. You don't need to worry about
them.
In a function that does not require a frame pointer, the frame pointer
@@ -3634,25 +3634,9 @@ fixed register. See @code{FIXED_REGISTERS} for more information.
Default return value is @code{false}.
@end deftypefn
-@findex get_frame_size
-@defmac INITIAL_FRAME_POINTER_OFFSET (@var{depth-var})
-A C statement to store in the variable @var{depth-var} the difference
-between the frame pointer and the stack pointer values immediately after
-the function prologue. The value would be computed from information
-such as the result of @code{get_frame_size ()} and the tables of
-registers @code{regs_ever_live} and @code{call_used_regs}.
-
-If @code{ELIMINABLE_REGS} is defined, this macro will be not be used and
-need not be defined. Otherwise, it must be defined even if
-@code{TARGET_FRAME_POINTER_REQUIRED} always returns true; in that
-case, you may set @var{depth-var} to anything.
-@end defmac
-
@defmac ELIMINABLE_REGS
-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 is to replace
-references to the frame pointer with references to the stack pointer.
+This macro specifies a table of register pairs used to eliminate
+unneeded registers that point into the stack frame.
The definition of this macro is a list of structure initializations, each
of which specifies an original and replacement register.
@@ -3676,21 +3660,20 @@ specified first since that is the preferred elimination.
@end defmac
@deftypefn {Target Hook} bool TARGET_CAN_ELIMINATE (const int @var{from_reg}, const int @var{to_reg})
-This target hook should returns @code{true} if the compiler is allowed to
+This target hook should return @code{true} if the compiler is allowed to
try to replace register number @var{from_reg} with register number
-@var{to_reg}. This target hook need only be defined if @code{ELIMINABLE_REGS}
-is defined, and will usually be @code{true}, since most of the cases
-preventing register elimination are things that the compiler already
+@var{to_reg}. This target hook will usually be @code{true}, since most of the
+cases preventing register elimination are things that the compiler already
knows about.
Default return value is @code{true}.
@end deftypefn
@defmac INITIAL_ELIMINATION_OFFSET (@var{from-reg}, @var{to-reg}, @var{offset-var})
-This macro is similar to @code{INITIAL_FRAME_POINTER_OFFSET}. It
-specifies the initial difference between the specified pair of
-registers. This macro must be defined if @code{ELIMINABLE_REGS} is
-defined.
+This macro returns the initial difference between the specified pair
+of registers. The value would be computed from information
+such as the result of @code{get_frame_size ()} and the tables of
+registers @code{df_regs_ever_live_p} and @code{call_used_regs}.
@end defmac
@node Stack Arguments
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index da133a4b701..a5714d10583 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -3177,25 +3177,9 @@ This is about eliminating the frame pointer and arg pointer.
@hook TARGET_FRAME_POINTER_REQUIRED
-@findex get_frame_size
-@defmac INITIAL_FRAME_POINTER_OFFSET (@var{depth-var})
-A C statement to store in the variable @var{depth-var} the difference
-between the frame pointer and the stack pointer values immediately after
-the function prologue. The value would be computed from information
-such as the result of @code{get_frame_size ()} and the tables of
-registers @code{regs_ever_live} and @code{call_used_regs}.
-
-If @code{ELIMINABLE_REGS} is defined, this macro will be not be used and
-need not be defined. Otherwise, it must be defined even if
-@code{TARGET_FRAME_POINTER_REQUIRED} always returns true; in that
-case, you may set @var{depth-var} to anything.
-@end defmac
-
@defmac ELIMINABLE_REGS
-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 is to replace
-references to the frame pointer with references to the stack pointer.
+This macro specifies a table of register pairs used to eliminate
+unneeded registers that point into the stack frame.
The definition of this macro is a list of structure initializations, each
of which specifies an original and replacement register.
@@ -3221,10 +3205,10 @@ specified first since that is the preferred elimination.
@hook TARGET_CAN_ELIMINATE
@defmac INITIAL_ELIMINATION_OFFSET (@var{from-reg}, @var{to-reg}, @var{offset-var})
-This macro is similar to @code{INITIAL_FRAME_POINTER_OFFSET}. It
-specifies the initial difference between the specified pair of
-registers. This macro must be defined if @code{ELIMINABLE_REGS} is
-defined.
+This macro returns the initial difference between the specified pair
+of registers. The value would be computed from information
+such as the result of @code{get_frame_size ()} and the tables of
+registers @code{df_regs_ever_live_p} and @code{call_used_regs}.
@end defmac
@node Stack Arguments
diff --git a/gcc/ira.c b/gcc/ira.c
index f8a59e3cd64..62612521edb 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -2253,10 +2253,9 @@ compute_regs_asm_clobbered (void)
void
ira_setup_eliminable_regset (void)
{
-#ifdef ELIMINABLE_REGS
int i;
static const struct {const int from, to; } eliminables[] = ELIMINABLE_REGS;
-#endif
+
/* FIXME: If EXIT_IGNORE_STACK is set, we will not save and restore
sp for alloca. So we can't eliminate the frame pointer in that
case. At some point, we should improve this by emitting the
@@ -2292,7 +2291,6 @@ ira_setup_eliminable_regset (void)
/* Build the regset of all eliminable registers and show we can't
use those that we already know won't be eliminated. */
-#ifdef ELIMINABLE_REGS
for (i = 0; i < (int) ARRAY_SIZE (eliminables); i++)
{
bool cannot_elim
@@ -2326,19 +2324,6 @@ ira_setup_eliminable_regset (void)
else
df_set_regs_ever_live (HARD_FRAME_POINTER_REGNUM, true);
}
-
-#else
- if (!TEST_HARD_REG_BIT (crtl->asm_clobbers, HARD_FRAME_POINTER_REGNUM))
- {
- SET_HARD_REG_BIT (eliminable_regset, FRAME_POINTER_REGNUM);
- if (frame_pointer_needed)
- SET_HARD_REG_BIT (ira_no_alloc_regs, FRAME_POINTER_REGNUM);
- }
- else if (frame_pointer_needed)
- error ("%s cannot be used in asm here", reg_names[FRAME_POINTER_REGNUM]);
- else
- df_set_regs_ever_live (FRAME_POINTER_REGNUM, true);
-#endif
}
diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c
index 08cc39011d1..1764bd699ce 100644
--- a/gcc/lra-eliminations.c
+++ b/gcc/lra-eliminations.c
@@ -108,15 +108,7 @@ static const struct elim_table_1
const int to;
} reg_eliminate_1[] =
-/* If a set of eliminable hard registers was specified, define the
- table from it. Otherwise, default to the normal case of the frame
- pointer being replaced by the stack pointer. */
-
-#ifdef ELIMINABLE_REGS
ELIMINABLE_REGS;
-#else
- {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}};
-#endif
#define NUM_ELIMINABLE_REGS ARRAY_SIZE (reg_eliminate_1)
@@ -1265,11 +1257,7 @@ update_reg_eliminate (bitmap insns_with_changed_offsets)
}
}
-#ifdef ELIMINABLE_REGS
INITIAL_ELIMINATION_OFFSET (ep->from, ep->to, ep->offset);
-#else
- INITIAL_FRAME_POINTER_OFFSET (ep->offset);
-#endif
}
setup_elimination_map ();
result = false;
@@ -1308,10 +1296,8 @@ static void
init_elim_table (void)
{
struct lra_elim_table *ep;
-#ifdef ELIMINABLE_REGS
bool value_p;
const struct elim_table_1 *ep1;
-#endif
if (!reg_eliminate)
reg_eliminate = XCNEWVEC (struct lra_elim_table, NUM_ELIMINABLE_REGS);
@@ -1320,7 +1306,7 @@ init_elim_table (void)
/* Initiate member values which will be never changed. */
self_elim_table.can_eliminate = self_elim_table.prev_can_eliminate = true;
self_elim_table.previous_offset = 0;
-#ifdef ELIMINABLE_REGS
+
for (ep = reg_eliminate, ep1 = reg_eliminate_1;
ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++, ep1++)
{
@@ -1334,12 +1320,6 @@ init_elim_table (void)
|| ! stack_realign_fp)));
setup_can_eliminate (ep, value_p);
}
-#else
- reg_eliminate[0].offset = reg_eliminate[0].previous_offset = 0;
- reg_eliminate[0].from = reg_eliminate_1[0].from;
- reg_eliminate[0].to = reg_eliminate_1[0].to;
- setup_can_eliminate (&reg_eliminate[0], ! frame_pointer_needed);
-#endif
/* Build the FROM and TO REG rtx's. Note that code in gen_rtx_REG
will cause, e.g., gen_rtx_REG (Pmode, STACK_POINTER_REGNUM) to
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 2a9a562cbbd..da53cfa5f95 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -286,15 +286,7 @@ static const struct elim_table_1
const int to;
} reg_eliminate_1[] =
-/* If a set of eliminable registers was specified, define the table from it.
- Otherwise, default to the normal case of the frame pointer being
- replaced by the stack pointer. */
-
-#ifdef ELIMINABLE_REGS
ELIMINABLE_REGS;
-#else
- {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}};
-#endif
#define NUM_ELIMINABLE_REGS ARRAY_SIZE (reg_eliminate_1)
@@ -3823,26 +3815,17 @@ static bool
verify_initial_elim_offsets (void)
{
HOST_WIDE_INT t;
+ struct elim_table *ep;
if (!num_eliminable)
return true;
-#ifdef ELIMINABLE_REGS
- {
- struct elim_table *ep;
-
- for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
- {
- INITIAL_ELIMINATION_OFFSET (ep->from, ep->to, t);
- if (t != ep->initial_offset)
- return false;
- }
- }
-#else
- INITIAL_FRAME_POINTER_OFFSET (t);
- if (t != reg_eliminate[0].initial_offset)
- return false;
-#endif
+ for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
+ {
+ INITIAL_ELIMINATION_OFFSET (ep->from, ep->to, t);
+ if (t != ep->initial_offset)
+ return false;
+ }
return true;
}
@@ -3854,16 +3837,11 @@ set_initial_elim_offsets (void)
{
struct elim_table *ep = reg_eliminate;
-#ifdef ELIMINABLE_REGS
for (; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
{
INITIAL_ELIMINATION_OFFSET (ep->from, ep->to, ep->initial_offset);
ep->previous_offset = ep->offset = ep->initial_offset;
}
-#else
- INITIAL_FRAME_POINTER_OFFSET (ep->initial_offset);
- ep->previous_offset = ep->offset = ep->initial_offset;
-#endif
num_not_at_initial_offset = 0;
}
@@ -3935,9 +3913,7 @@ update_eliminables (HARD_REG_SET *pset)
for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
if ((ep->from == HARD_FRAME_POINTER_REGNUM
&& targetm.frame_pointer_required ())
-#ifdef ELIMINABLE_REGS
|| ! targetm.can_eliminate (ep->from, ep->to)
-#endif
)
ep->can_eliminate = 0;
@@ -4058,16 +4034,13 @@ static void
init_elim_table (void)
{
struct elim_table *ep;
-#ifdef ELIMINABLE_REGS
const struct elim_table_1 *ep1;
-#endif
if (!reg_eliminate)
reg_eliminate = XCNEWVEC (struct elim_table, NUM_ELIMINABLE_REGS);
num_eliminable = 0;
-#ifdef ELIMINABLE_REGS
for (ep = reg_eliminate, ep1 = reg_eliminate_1;
ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++, ep1++)
{
@@ -4080,12 +4053,6 @@ init_elim_table (void)
&& (! SUPPORTS_STACK_ALIGNMENT
|| ! stack_realign_fp)));
}
-#else
- reg_eliminate[0].from = reg_eliminate_1[0].from;
- reg_eliminate[0].to = reg_eliminate_1[0].to;
- reg_eliminate[0].can_eliminate = reg_eliminate[0].can_eliminate_previous
- = ! frame_pointer_needed;
-#endif
/* Count the number of eliminable registers and build the FROM and TO
REG rtx's. Note that code in gen_rtx_REG will cause, e.g.,
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 6470c4377ea..69bc4fdd5e1 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -345,7 +345,6 @@ rtx_varies_p (const_rtx x, bool for_alias)
static HOST_WIDE_INT
get_initial_register_offset (int from, int to)
{
-#ifdef ELIMINABLE_REGS
static const struct elim_table_t
{
const int from;
@@ -448,33 +447,6 @@ get_initial_register_offset (int from, int to)
return get_initial_register_offset (from, FRAME_POINTER_REGNUM);
else
return 0;
-
-#else
- HOST_WIDE_INT offset;
-
- if (to == from)
- return 0;
-
- if (reload_completed)
- {
- INITIAL_FRAME_POINTER_OFFSET (offset);
- }
- else
- {
- offset = crtl->outgoing_args_size + get_frame_size ();
-#if !STACK_GROWS_DOWNWARD
- offset = - offset;
-#endif
- }
-
- if (to == STACK_POINTER_REGNUM)
- return offset;
- else if (from == STACK_POINTER_REGNUM)
- return - offset;
- else
- return 0;
-
-#endif
}
/* Return nonzero if the use of X+OFFSET as an address in a MEM with SIZE
diff --git a/gcc/target.def b/gcc/target.def
index 8d506912063..8d80448560d 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -5289,7 +5289,7 @@ five otherwise. This is best for most machines.",
unsigned int, (void),
default_case_values_threshold)
-/* Retutn true if a function must have and use a frame pointer. */
+/* Return true if a function must have and use a frame pointer. */
DEFHOOK
(frame_pointer_required,
"This target hook should return @code{true} if a function must have and use\n\
@@ -5306,7 +5306,7 @@ pointer.\n\
In certain cases, the compiler does not know how to produce valid code\n\
without a frame pointer. The compiler recognizes those cases and\n\
automatically gives the function a frame pointer regardless of what\n\
-@code{TARGET_FRAME_POINTER_REQUIRED} returns. You don't need to worry about\n\
+@code{targetm.frame_pointer_required} returns. You don't need to worry about\n\
them.\n\
\n\
In a function that does not require a frame pointer, the frame pointer\n\
@@ -5321,11 +5321,10 @@ Default return value is @code{false}.",
from-reg with register number to-reg. */
DEFHOOK
(can_eliminate,
- "This target hook should returns @code{true} if the compiler is allowed to\n\
+ "This target hook should return @code{true} if the compiler is allowed to\n\
try to replace register number @var{from_reg} with register number\n\
-@var{to_reg}. This target hook need only be defined if @code{ELIMINABLE_REGS}\n\
-is defined, and will usually be @code{true}, since most of the cases\n\
-preventing register elimination are things that the compiler already\n\
+@var{to_reg}. This target hook will usually be @code{true}, since most of the\n\
+cases preventing register elimination are things that the compiler already\n\
knows about.\n\
\n\
Default return value is @code{true}.",