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
This commit is contained in:
parent
7e4955774f
commit
5368023839
22 changed files with 85 additions and 230 deletions
|
@ -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
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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. */
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)); \
|
||||
|
|
|
@ -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)))
|
||||
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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)); \
|
||||
|
|
|
@ -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 \
|
||||
{ \
|
||||
|
|
|
@ -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) \
|
||||
{ \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
17
gcc/ira.c
17
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
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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 < ®_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 (®_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
|
||||
|
|
|
@ -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 < ®_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 < ®_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 < ®_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 < ®_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 < ®_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.,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}.",
|
||||
|
|
Loading…
Add table
Reference in a new issue