aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKazu Hirata <kazu@hxi.com>2001-01-09 20:17:02 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2001-01-09 20:17:02 +0000
commit46d00fef1d424e814f0a91bab731b74949cde748 (patch)
tree51a4935a8a348ee2e9e941ad4690258681904aac /gcc
parent9789584bd16c6e26cb9ba3aeb6eab4ad3fcd30fc (diff)
downloadgcc-46d00fef1d424e814f0a91bab731b74949cde748.zip
gcc-46d00fef1d424e814f0a91bab731b74949cde748.tar.gz
gcc-46d00fef1d424e814f0a91bab731b74949cde748.tar.bz2
h8300.c (function_prologue): Fix code for a monitor function.
2001-01-09 Kazu Hirata <kazu@hxi.com> * config/h8300/h8300.c (function_prologue): Fix code for a monitor function. Support H8/S. (function_epilogue): Do not output pop for a monitor function. From-SVN: r38840
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/config/h8300/h8300.c22
2 files changed, 18 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 94d8ca4..4ded428 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -5,6 +5,9 @@
shift_mode. Remove an extra error check.
(emit_a_shift): Adopt to the new calling prototype of
get_shift_alg.
+ (function_prologue): Fix code for a monitor
+ function. Support H8/S.
+ (function_epilogue): Do not output pop for a monitor function.
2001-01-09 Nick Clifton <nickc@redhat.com>
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 0f88433..d93c9d0 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -297,16 +297,29 @@ function_prologue (file, size)
fprintf (file, "\tsubs\t#2,sp\n");
push (file, 0);
fprintf (file, "\tstc\tccr,r0l\n");
+ fprintf (file, "\tmov.b\tr0l,@(2,sp)\n");
+ pop (file, 0);
fprintf (file, "\torc\t#128,ccr\n");
+ }
+ else if (TARGET_H8300H)
+ {
+ push (file, 0);
+ fprintf (file, "\tstc\tccr,r0l\n");
fprintf (file, "\tmov.b\tr0l,@(4,sp)\n");
+ pop (file, 0);
+ fprintf (file, "\torc\t#128,ccr\n");
}
- else
+ else if (TARGET_H8300S)
{
+ fprintf (file, "\tstc\texr,@-sp\n");
push (file, 0);
fprintf (file, "\tstc\tccr,r0l\n");
+ fprintf (file, "\tmov.b\tr0l,@(6,sp)\n");
+ pop (file, 0);
fprintf (file, "\torc\t#128,ccr\n");
- fprintf (file, "\tmov.b\tr0l,@(4,sp)\n");
}
+ else
+ abort ();
}
if (frame_pointer_needed)
@@ -430,11 +443,6 @@ function_epilogue (file, size)
if (frame_pointer_needed)
pop (file, FRAME_POINTER_REGNUM);
- /* If this is a monitor function, there is one register still left on
- the stack. */
- if (monitor)
- pop (file, 0);
-
if (interrupt_handler)
fprintf (file, "\trte\n");
else