aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1996-04-24 00:00:53 +0000
committerDoug Evans <dje@gnu.org>1996-04-24 00:00:53 +0000
commit5f4241d584de5cc88ad85c5d3497929435bbb69f (patch)
tree1339c11ebfaa31c550f541844bf699538d12f52e
parent6d29fc410279b31a70380d9bebd0b8cca0e3d8da (diff)
downloadgcc-5f4241d584de5cc88ad85c5d3497929435bbb69f.zip
gcc-5f4241d584de5cc88ad85c5d3497929435bbb69f.tar.gz
gcc-5f4241d584de5cc88ad85c5d3497929435bbb69f.tar.bz2
sparc.c (output_function_prologue): In -mbroken-saverestore case, %sp = %fp - size.
* sparc/sparc.c (output_function_prologue): In -mbroken-saverestore case, %sp = %fp - size. From-SVN: r11872
-rw-r--r--gcc/config/sparc/sparc.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 3ccbbe6..1708b37 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -3095,17 +3095,29 @@ output_function_prologue (file, size, leaf_function)
fprintf (file, "\tsave %%sp,%%g1,%%sp\n");
}
}
- else
+ else if (! leaf_function && TARGET_BROKEN_SAVERESTORE)
{
- /* If the target has a broken save insn (only handles save %g0,%g0,%g0),
- do the save and then handle like a leaf function.
- We assume the environment will properly handle or otherwise avoid
+ /* We assume the environment will properly handle or otherwise avoid
trouble associated with an interrupt occuring after the `save' or
trap occuring during it. */
- if (TARGET_BROKEN_SAVERESTORE)
- fprintf (file, "\tsave\n");
+ fprintf (file, "\tsave\n");
if (actual_fsize <= 4096)
+ fprintf (file, "\tadd %%fp,-%d,%%sp\n", actual_fsize);
+ else if (actual_fsize <= 8192)
+ {
+ fprintf (file, "\tadd %%fp,-4096,%%sp\n");
+ fprintf (file, "\tadd %%fp,-%d,%%sp\n", actual_fsize - 4096);
+ }
+ else
+ {
+ build_big_number (file, -actual_fsize, "%g1");
+ fprintf (file, "\tadd %%fp,%%g1,%%sp\n");
+ }
+ }
+ else /* leaf function */
+ {
+ if (actual_fsize <= 4096)
fprintf (file, "\tadd %%sp,-%d,%%sp\n", actual_fsize);
else if (actual_fsize <= 8192)
{