summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavem <davem@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-16 08:36:27 +0000
committerdavem <davem@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-16 08:36:27 +0000
commit115b7a57828fc13e1e41e6ae4fd3faaabc556564 (patch)
tree772f98ae3b65200ab669ce9a1de315eb0077ed69
parent35e03d524f1ffcf3a56640c198484c5af4644c6f (diff)
downloadppe42-gcc-115b7a57828fc13e1e41e6ae4fd3faaabc556564.tar.gz
ppe42-gcc-115b7a57828fc13e1e41e6ae4fd3faaabc556564.zip
2003-07-15 David S. Miller <davem@redhat.com>
* config/sparc/sparc.c (sparc_nonflat_function_epilogue): Only emit nop if the last real insn is CALL_INSN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69440 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sparc/sparc.c14
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 11ade5dd9f5..40f58fd8f82 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2003-07-15 David S. Miller <davem@redhat.com>
+
+ * config/sparc/sparc.c (sparc_nonflat_function_epilogue): Only
+ emit nop if the last real insn is CALL_INSN.
+
2003-07-16 Danny Smith <dannysmith@users.sourceforge.net>
* config/i386/xm-mingw32.h (HOST_BIT_BUCKET): Define
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 617a964b619..14c7c1fcf73 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -4046,11 +4046,19 @@ sparc_nonflat_function_epilogue (file, size, leaf_function)
of a function were call foo; dslot; this can make the return
PC of foo (ie. address of call instruction plus 8) point to
the first instruction in the next function. */
- rtx insn;
-
- fputs("\tnop\n", file);
+ rtx insn, last_real_insn;
insn = get_last_insn ();
+
+ last_real_insn = prev_real_insn (insn);
+ if (last_real_insn
+ && GET_CODE (last_real_insn) == INSN
+ && GET_CODE (PATTERN (last_real_insn)) == SEQUENCE)
+ last_real_insn = XVECEXP (PATTERN (last_real_insn), 0, 0);
+
+ if (last_real_insn && GET_CODE (last_real_insn) == CALL_INSN)
+ fputs("\tnop\n", file);
+
if (GET_CODE (insn) == NOTE)
insn = prev_nonnote_insn (insn);
if (insn && GET_CODE (insn) == BARRIER)
OpenPOWER on IntegriCloud