aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2007-10-18 19:45:55 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2007-10-18 19:45:55 +0000
commit16dc5c284f2705790fed7c32924118ef4a4ed0cd (patch)
tree019710f196f53297f953c3ea048e192a3f86307e
parent29c4d304fd99684f08863ecd1705ddead325a312 (diff)
downloadgcc-16dc5c284f2705790fed7c32924118ef4a4ed0cd.zip
gcc-16dc5c284f2705790fed7c32924118ef4a4ed0cd.tar.gz
gcc-16dc5c284f2705790fed7c32924118ef4a4ed0cd.tar.bz2
mips-protos.h (compute_frame_size): Delete.
gcc/ * config/mips/mips-protos.h (compute_frame_size): Delete. * config/mips/mips.h: Update comments. * config/mips/mips.c (mips_frame_info): Remove initialized. (compute_frame_size): Rename to... (mips_compute_frame_info): ...this and make static. Remove the SIZE argument and return no value. Remove the setting of initialized. Update rest of file accordingly. (mips_set_return_address): Don't call compute_frame_size. (mips_can_use_return_insn): Don't check df_regs_ever_live_p (31). Don't call compute_frame_size. From-SVN: r129460
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/config/mips/mips-protos.h1
-rw-r--r--gcc/config/mips/mips.c38
-rw-r--r--gcc/config/mips/mips.h2
4 files changed, 27 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d54f375..4b18b7b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,18 @@
2007-10-18 Richard Sandiford <rsandifo@nildram.co.uk>
+ * config/mips/mips-protos.h (compute_frame_size): Delete.
+ * config/mips/mips.h: Update comments.
+ * config/mips/mips.c (mips_frame_info): Remove initialized.
+ (compute_frame_size): Rename to...
+ (mips_compute_frame_info): ...this and make static. Remove the
+ SIZE argument and return no value. Remove the setting of initialized.
+ Update rest of file accordingly.
+ (mips_set_return_address): Don't call compute_frame_size.
+ (mips_can_use_return_insn): Don't check df_regs_ever_live_p (31).
+ Don't call compute_frame_size.
+
+2007-10-18 Richard Sandiford <rsandifo@nildram.co.uk>
+
* config/mips/mips-protos.h (mips_frame_pointer_required): Declare.
* config/mips/mips.h (FRAME_POINTER_REQUIRED): Use
mips_hard_frame_pointer_required.
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index 4822f38..dfb0cfa 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -256,7 +256,6 @@ extern void mips_finish_declare_object (FILE *, tree, int, int);
extern bool mips_small_data_pattern_p (rtx);
extern rtx mips_rewrite_small_data (rtx);
extern bool mips_frame_pointer_required (void);
-extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT);
extern HOST_WIDE_INT mips_initial_elimination_offset (int, int);
extern rtx mips_return_addr (int, rtx);
extern enum mips_loadgp_style mips_current_loadgp_style (void);
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index c5b30f7..22b0c79 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -234,9 +234,7 @@ static const char *const mips_fp_conditions[] = {
MIPS_FP_CONDITIONS (STRINGIFY)
};
-/* Structure to be filled in by compute_frame_size with register
- save masks, and offsets for the current function. */
-
+/* Information about a function's frame layout. */
struct mips_frame_info GTY(())
{
/* The size of the frame in bytes. */
@@ -280,9 +278,6 @@ struct mips_frame_info GTY(())
/* The offset of hard_frame_pointer_rtx from frame_pointer_rtx. */
HOST_WIDE_INT hard_frame_pointer_offset;
-
- /* True if this structure has been initialized after reload. */
- bool initialized;
};
struct machine_function GTY(()) {
@@ -294,7 +289,7 @@ struct machine_function GTY(()) {
This area is allocated by the callee at the very top of the frame. */
int varargs_size;
- /* Current frame information, calculated by compute_frame_size. */
+ /* Current frame information, calculated by mips_compute_frame_info. */
struct mips_frame_info frame;
/* The register to use as the global pointer within this function. */
@@ -7833,8 +7828,7 @@ mips_save_reg_p (unsigned int regno)
return false;
}
-/* Return the bytes needed to compute the frame pointer from the current
- stack pointer. SIZE is the size (in bytes) of the local variables.
+/* Populate the current function's mips_frame_info structure.
MIPS stack frames look like:
@@ -7895,15 +7889,16 @@ mips_save_reg_p (unsigned int regno)
They decrease stack_pointer_rtx but leave frame_pointer_rtx and
hard_frame_pointer_rtx unchanged. */
-HOST_WIDE_INT
-compute_frame_size (HOST_WIDE_INT size)
+static void
+mips_compute_frame_info (void)
{
struct mips_frame_info *frame;
- HOST_WIDE_INT offset;
+ HOST_WIDE_INT offset, size;
unsigned int regno, i;
frame = &cfun->machine->frame;
memset (frame, 0, sizeof (*frame));
+ size = get_frame_size ();
cfun->machine->global_pointer = mips_global_pointer ();
@@ -8007,9 +8002,6 @@ compute_frame_size (HOST_WIDE_INT size)
instructions for local variables and incoming arguments. */
if (TARGET_MIPS16)
frame->hard_frame_pointer_offset = frame->args_size;
-
- frame->initialized = reload_completed;
- return frame->total_size;
}
/* Return the style of GP load sequence that is being used for the
@@ -8046,7 +8038,7 @@ mips_frame_pointer_required (void)
without using a second temporary register. */
if (TARGET_MIPS16)
{
- compute_frame_size (get_frame_size ());
+ mips_compute_frame_info ();
if (!SMALL_OPERAND (cfun->machine->frame.total_size))
return true;
}
@@ -8063,7 +8055,7 @@ mips_initial_elimination_offset (int from, int to)
{
HOST_WIDE_INT offset;
- compute_frame_size (get_frame_size ());
+ mips_compute_frame_info ();
/* Set OFFSET to the offset from the soft frame pointer, which is also
the offset from the end-of-prologue stack pointer. */
@@ -8118,7 +8110,6 @@ mips_set_return_address (rtx address, rtx scratch)
{
rtx slot_address;
- compute_frame_size (get_frame_size ());
gcc_assert ((cfun->machine->frame.mask >> 31) & 1);
slot_address = mips_add_offset (scratch, stack_pointer_rtx,
cfun->machine->frame.gp_sp_offset);
@@ -8192,7 +8183,7 @@ mips_for_each_saved_reg (HOST_WIDE_INT sp_offset, mips_save_restore_fn fn)
}
/* This loop must iterate over the same space as its companion in
- compute_frame_size. */
+ mips_compute_frame_info. */
offset = cfun->machine->frame.fp_sp_offset - sp_offset;
fpr_mode = (TARGET_SINGLE_FLOAT ? SFmode : DFmode);
for (regno = (FP_REG_LAST - MAX_FPRS_PER_FMT + 1);
@@ -8447,7 +8438,7 @@ mips_expand_prologue (void)
if (cfun->machine->global_pointer > 0)
SET_REGNO (pic_offset_table_rtx, cfun->machine->global_pointer);
- size = compute_frame_size (get_frame_size ());
+ size = cfun->machine->frame.total_size;
/* Save the registers. Allocate up to MIPS_MAX_FIRST_STACK_STEP
bytes beforehand; this is enough to cover the register save area
@@ -8768,7 +8759,7 @@ mips_can_use_return_insn (void)
if (! reload_completed)
return 0;
- if (df_regs_ever_live_p (31) || current_function_profile)
+ if (current_function_profile)
return 0;
/* In mips16 mode, a function that returns a floating point value
@@ -8777,10 +8768,7 @@ mips_can_use_return_insn (void)
if (mips16_cfun_returns_in_fpr_p ())
return 0;
- if (cfun->machine->frame.initialized)
- return cfun->machine->frame.total_size == 0;
-
- return compute_frame_size (get_frame_size ()) == 0;
+ return cfun->machine->frame.total_size == 0;
}
/* Implement HARD_REGNO_NREGS. The size of FP registers is controlled
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 46356fe..f362aaa 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1881,7 +1881,7 @@ enum reg_class
#define STACK_GROWS_DOWNWARD
/* The offset of the first local variable from the beginning of the frame.
- See compute_frame_size for details about the frame layout. */
+ See mips_compute_frame_info for details about the frame layout. */
#define STARTING_FRAME_OFFSET \
(current_function_outgoing_args_size \