aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-06-04 06:52:49 +0000
committerRichard Stallman <rms@gnu.org>1993-06-04 06:52:49 +0000
commit08a2b1188a24261747454d0c91aef90c75e2eeda (patch)
treed9fe0655f32697c46743ed97098736d1f20df6ef /gcc/config
parent71cdef7e2ef1f0934855d6102be21992c7194095 (diff)
downloadgcc-08a2b1188a24261747454d0c91aef90c75e2eeda.zip
gcc-08a2b1188a24261747454d0c91aef90c75e2eeda.tar.gz
gcc-08a2b1188a24261747454d0c91aef90c75e2eeda.tar.bz2
(output_function_epilogue): If the last insn in the current function is a (volatile) call...
(output_function_epilogue): If the last insn in the current function is a (volatile) call, then emit an extra nop after the call so that RP will point to a valid instruction. From-SVN: r4630
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/pa/pa.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index d5e9ede..58fe1e0 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -2155,14 +2155,36 @@ output_function_epilogue (file, size)
FILE *file;
int size;
{
+
+ rtx insn = get_last_insn ();
+
/* hppa_expand_epilogue does the dirty work now. We just need
to output the assembler directives which denote the end
- of a function. */
+ of a function.
+
+ To make debuggers happy, emit a nop if the epilogue was completely
+ eliminated due to a volatile call as the last insn in the
+ current function. That way the return address (in %r2) will
+ always point to a valid instruction in the current function. */
+
+ /* Get the last real insn. */
+ if (GET_CODE (insn) == NOTE)
+ insn = prev_real_insn (insn);
+
+ /* If it is a sequence, then look inside. */
+ if (insn && GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == SEQUENCE)
+ insn = XVECEXP (PATTERN (insn), 0, 0);
+
+ /* If insn is a CALL_INSN, then it must be a call to a volatile
+ function (otherwise there would be epilogue insns). */
+ if (insn && GET_CODE (insn) == CALL_INSN)
+ fprintf (file, "\tnop\n");
+
fprintf (file, "\t.EXIT\n\t.PROCEND\n");
}
void
-hppa_expand_epilogue()
+hppa_expand_epilogue ()
{
rtx tmpreg;
int offset,i;