summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-08 10:53:32 +0000
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-08 10:53:32 +0000
commit69e870b07669445e1db9ed07b2967430e185c102 (patch)
tree644ecee0a44f77c4a7e260005a57beac129581c7 /gcc/config
parent493dc920cd0b1d9fd337339b0dc8f224513116c5 (diff)
downloadgcc-69e870b07669445e1db9ed07b2967430e185c102.tar.gz
config/m32r/m32r.c (m32r_output_function_epilogue): Care for a large stack #
frame at epilogue. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101759 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/m32r/m32r.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index d772db08993..d6197d3da4a 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -1532,11 +1532,19 @@ m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
else if (reg_offset < 32768)
fprintf (file, "\tadd3 %s,%s,%s%d\n",
sp_str, sp_str, IMMEDIATE_PREFIX, reg_offset);
- else
+ else if (reg_offset < (1 << 24))
fprintf (file, "\tld24 %s,%s%d\n\tadd %s,%s\n",
reg_names[PROLOGUE_TMP_REGNUM],
IMMEDIATE_PREFIX, reg_offset,
sp_str, reg_names[PROLOGUE_TMP_REGNUM]);
+ else
+ fprintf (file, "\tseth %s,%s%d\n\tor3 %s,%s,%s%d\n\tadd %s,%s\n",
+ reg_names[PROLOGUE_TMP_REGNUM],
+ IMMEDIATE_PREFIX, reg_offset >> 16,
+ reg_names[PROLOGUE_TMP_REGNUM],
+ reg_names[PROLOGUE_TMP_REGNUM],
+ IMMEDIATE_PREFIX, reg_offset & 0xffff,
+ sp_str, reg_names[PROLOGUE_TMP_REGNUM]);
}
else if (frame_pointer_needed)
{
@@ -1547,11 +1555,19 @@ m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
else if (reg_offset < 32768)
fprintf (file, "\tadd3 %s,%s,%s%d\n",
sp_str, fp_str, IMMEDIATE_PREFIX, reg_offset);
- else
+ else if (reg_offset < (1 << 24))
fprintf (file, "\tld24 %s,%s%d\n\tadd %s,%s\n",
reg_names[PROLOGUE_TMP_REGNUM],
IMMEDIATE_PREFIX, reg_offset,
sp_str, reg_names[PROLOGUE_TMP_REGNUM]);
+ else
+ fprintf (file, "\tseth %s,%s%d\n\tor3 %s,%s,%s%d\n\tadd %s,%s\n",
+ reg_names[PROLOGUE_TMP_REGNUM],
+ IMMEDIATE_PREFIX, reg_offset >> 16,
+ reg_names[PROLOGUE_TMP_REGNUM],
+ reg_names[PROLOGUE_TMP_REGNUM],
+ IMMEDIATE_PREFIX, reg_offset & 0xffff,
+ sp_str, reg_names[PROLOGUE_TMP_REGNUM]);
}
else
gcc_unreachable ();