aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2007-07-06 09:27:10 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2007-07-06 09:27:10 +0000
commit713df810031e8183d0ec88a490a8677ab0932e2c (patch)
treef74efefd4216ca4b93906516c2a9dc367cea71d3 /gcc
parentb5119fa1391d75ecd9c7e041151acb04bd6c7234 (diff)
downloadgcc-713df810031e8183d0ec88a490a8677ab0932e2c.zip
gcc-713df810031e8183d0ec88a490a8677ab0932e2c.tar.gz
gcc-713df810031e8183d0ec88a490a8677ab0932e2c.tar.bz2
mips.c (compute_frame_size): Restore the original gp_sp_offset for !GENERATE_MIPS16E_SAVE_RESTORE and remove...
gcc/ * config/mips/mips.c (compute_frame_size): Restore the original gp_sp_offset for !GENERATE_MIPS16E_SAVE_RESTORE and remove the fp_size term from the GENERATE_MIPS16E_SAVE_RESTORE calculation. Document why the difference is needed. From-SVN: r126406
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/mips/mips.c16
2 files changed, 17 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6d5d1c1..3d7ac29 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2007-07-06 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips.c (compute_frame_size): Restore the original
+ gp_sp_offset for !GENERATE_MIPS16E_SAVE_RESTORE and remove the
+ fp_size term from the GENERATE_MIPS16E_SAVE_RESTORE calculation.
+ Document why the difference is needed.
+
2007-07-06 Richard Guenther <rguenther@suse.de>
* c-common.c (boolean_increment): Use correctly typed
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 8c7b70c..980c928 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -6781,12 +6781,16 @@ compute_frame_size (HOST_WIDE_INT size)
{
HOST_WIDE_INT offset;
- /* MIPS16e SAVE and RESTORE instructions require the GP save area
- to be aligned at the high end with any padding at the low end,
- so do it that way all the time. */
- offset = (total_size
- - MIPS_STACK_ALIGN (fp_reg_size)
- - GET_MODE_SIZE (gpr_mode));
+ if (GENERATE_MIPS16E_SAVE_RESTORE)
+ /* MIPS16e SAVE and RESTORE instructions require the GP save area
+ to be aligned at the high end with any padding at the low end.
+ It is only safe to use this calculation for o32, where we never
+ have pretend arguments, and where any varargs will be saved in
+ the caller-allocated area rather than at the top of the frame. */
+ offset = (total_size - GET_MODE_SIZE (gpr_mode));
+ else
+ offset = (args_size + cprestore_size + var_size
+ + gp_reg_size - GET_MODE_SIZE (gpr_mode));
cfun->machine->frame.gp_sp_offset = offset;
cfun->machine->frame.gp_save_offset = offset - total_size;
}