diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2003-11-06 11:22:03 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2003-11-06 11:22:03 +0000 |
commit | e88fb323aad7bc8974da3cb28aae2ef1b500583d (patch) | |
tree | fb900b9f64bc13d7679a0583f8c195f80702393b | |
parent | 88d6a75f25860f8a6d1f646d7d616ac87bf84fce (diff) | |
download | gcc-e88fb323aad7bc8974da3cb28aae2ef1b500583d.zip gcc-e88fb323aad7bc8974da3cb28aae2ef1b500583d.tar.gz gcc-e88fb323aad7bc8974da3cb28aae2ef1b500583d.tar.bz2 |
mips-protos.h (mips_initial_elimination_offset): Change return type to HOST_WIDE_INT.
* config/mips/mips-protos.h (mips_initial_elimination_offset): Change
return type to HOST_WIDE_INT.
* config/mips/mips.c (mips_frame_info): Give sizes type HOST_WIDE_INT.
Make initialized a bool. Make register masks unsigned ints.
(compute_frame_size): Make same mask change here. Use HOST_WIDE_INT
where appropriate.
(mips_initial_elimination_offset): Return a HOST_WIDE_INT.
(mips_output_function_prologue): Print sizes as HOST_WIDE_INTs.
From-SVN: r73303
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/config/mips/mips-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 66 |
3 files changed, 48 insertions, 31 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1472202..fbb999c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,16 @@ 2003-11-06 Richard Sandiford <rsandifo@redhat.com> + * config/mips/mips-protos.h (mips_initial_elimination_offset): Change + return type to HOST_WIDE_INT. + * config/mips/mips.c (mips_frame_info): Give sizes type HOST_WIDE_INT. + Make initialized a bool. Make register masks unsigned ints. + (compute_frame_size): Make same mask change here. Use HOST_WIDE_INT + where appropriate. + (mips_initial_elimination_offset): Return a HOST_WIDE_INT. + (mips_output_function_prologue): Print sizes as HOST_WIDE_INTs. + +2003-11-06 Richard Sandiford <rsandifo@redhat.com> + * config/frv/frv.c (frv_initial_elimination_offset): Remove bogus negation. diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h index a4c1cff..a5daae0 100644 --- a/gcc/config/mips/mips-protos.h +++ b/gcc/config/mips/mips-protos.h @@ -113,7 +113,7 @@ extern void mips_finish_declare_object (FILE *, tree, int, int); extern rtx mips_rewrite_small_data (rtx); extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT); -extern int mips_initial_elimination_offset (int, int); +extern HOST_WIDE_INT mips_initial_elimination_offset (int, int); extern rtx mips_return_addr (int, rtx); extern void mips_expand_prologue (void); extern void mips_expand_epilogue (int); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 2a81b23..8d2c780 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -294,21 +294,21 @@ static unsigned int irix_section_type_flags (tree, const char *, int); struct mips_frame_info GTY(()) { - long total_size; /* # bytes that the entire frame takes up */ - long var_size; /* # bytes that variables take up */ - long args_size; /* # bytes that outgoing arguments take up */ - long cprestore_size; /* # bytes that the .cprestore slot takes up */ - int gp_reg_size; /* # bytes needed to store gp regs */ - int fp_reg_size; /* # bytes needed to store fp regs */ - long mask; /* mask of saved gp registers */ - long fmask; /* mask of saved fp registers */ - long gp_save_offset; /* offset from vfp to store gp registers */ - long fp_save_offset; /* offset from vfp to store fp registers */ - long gp_sp_offset; /* offset from new sp to store gp registers */ - long fp_sp_offset; /* offset from new sp to store fp registers */ - int initialized; /* != 0 if frame size already calculated */ - int num_gp; /* number of gp registers saved */ - int num_fp; /* number of fp registers saved */ + HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up */ + HOST_WIDE_INT var_size; /* # bytes that variables take up */ + HOST_WIDE_INT args_size; /* # bytes that outgoing arguments take up */ + HOST_WIDE_INT cprestore_size; /* # bytes that the .cprestore slot takes up */ + HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs */ + HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs */ + unsigned int mask; /* mask of saved gp registers */ + unsigned int fmask; /* mask of saved fp registers */ + HOST_WIDE_INT gp_save_offset; /* offset from vfp to store gp registers */ + HOST_WIDE_INT fp_save_offset; /* offset from vfp to store fp registers */ + HOST_WIDE_INT gp_sp_offset; /* offset from new sp to store gp registers */ + HOST_WIDE_INT fp_sp_offset; /* offset from new sp to store fp registers */ + bool initialized; /* true if frame size already calculated */ + int num_gp; /* number of gp registers saved */ + int num_fp; /* number of fp registers saved */ }; struct machine_function GTY(()) { @@ -6190,8 +6190,8 @@ compute_frame_size (HOST_WIDE_INT size) HOST_WIDE_INT gp_reg_rounded; /* # bytes needed to store gp after rounding */ HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs */ HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs */ - long mask; /* mask of saved gp registers */ - long fmask; /* mask of saved fp registers */ + unsigned int mask; /* mask of saved gp registers */ + unsigned int fmask; /* mask of saved fp registers */ cfun->machine->global_pointer = mips_global_pointer (); @@ -6224,7 +6224,7 @@ compute_frame_size (HOST_WIDE_INT size) if (mips_save_reg_p (regno)) { gp_reg_size += GET_MODE_SIZE (gpr_mode); - mask |= 1L << (regno - GP_REG_FIRST); + mask |= 1 << (regno - GP_REG_FIRST); } /* We need to restore these for the handler. */ @@ -6237,7 +6237,7 @@ compute_frame_size (HOST_WIDE_INT size) if (regno == INVALID_REGNUM) break; gp_reg_size += GET_MODE_SIZE (gpr_mode); - mask |= 1L << (regno - GP_REG_FIRST); + mask |= 1 << (regno - GP_REG_FIRST); } } @@ -6277,7 +6277,7 @@ compute_frame_size (HOST_WIDE_INT size) if (mask) { - unsigned long offset; + HOST_WIDE_INT offset; offset = (args_size + cprestore_size + var_size + gp_reg_size - GET_MODE_SIZE (gpr_mode)); @@ -6292,9 +6292,11 @@ compute_frame_size (HOST_WIDE_INT size) if (fmask) { - unsigned long offset = (args_size + cprestore_size + var_size - + gp_reg_rounded + fp_reg_size - - FP_INC * UNITS_PER_FPREG); + HOST_WIDE_INT offset; + + offset = (args_size + cprestore_size + var_size + + gp_reg_rounded + fp_reg_size + - FP_INC * UNITS_PER_FPREG); cfun->machine->frame.fp_sp_offset = offset; cfun->machine->frame.fp_save_offset = offset - total_size; } @@ -6312,10 +6314,10 @@ compute_frame_size (HOST_WIDE_INT size) pointer or argument pointer. TO is either the stack pointer or hard frame pointer. */ -int +HOST_WIDE_INT mips_initial_elimination_offset (int from, int to) { - int offset; + HOST_WIDE_INT offset; compute_frame_size (get_frame_size ()); @@ -6460,12 +6462,15 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { /* .frame FRAMEREG, FRAMESIZE, RETREG */ fprintf (file, - "\t.frame\t%s,%ld,%s\t\t# vars= %ld, regs= %d/%d, args= %ld, gp= %ld\n", + "\t.frame\t%s," HOST_WIDE_INT_PRINT_DEC ",%s\t\t" + "# vars= " HOST_WIDE_INT_PRINT_DEC ", regs= %d/%d" + ", args= " HOST_WIDE_INT_PRINT_DEC + ", gp= " HOST_WIDE_INT_PRINT_DEC "\n", (reg_names[(frame_pointer_needed) ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM]), ((frame_pointer_needed && TARGET_MIPS16) - ? ((long) tsize - cfun->machine->frame.args_size) - : (long) tsize), + ? tsize - cfun->machine->frame.args_size + : tsize), reg_names[GP_REG_FIRST + 31], cfun->machine->frame.var_size, cfun->machine->frame.num_gp, @@ -6474,9 +6479,10 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) cfun->machine->frame.cprestore_size); /* .mask MASK, GPOFFSET; .fmask FPOFFSET */ - fprintf (file, "\t.mask\t0x%08lx,%ld\n\t.fmask\t0x%08lx,%ld\n", + fprintf (file, "\t.mask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n", cfun->machine->frame.mask, - cfun->machine->frame.gp_save_offset, + cfun->machine->frame.gp_save_offset); + fprintf (file, "\t.fmask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n", cfun->machine->frame.fmask, cfun->machine->frame.fp_save_offset); |