aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-11-10 19:11:24 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-11-10 19:11:24 -0500
commit90140103513f22c46dadc4a8e656a41ca80ccfb9 (patch)
tree8f68e38b7a5720ac4060fa2aafb4d291f88f9d8d
parent931493c6b26bf46d23d9a746d2bb58237e0e436b (diff)
downloadgcc-90140103513f22c46dadc4a8e656a41ca80ccfb9.zip
gcc-90140103513f22c46dadc4a8e656a41ca80ccfb9.tar.gz
gcc-90140103513f22c46dadc4a8e656a41ca80ccfb9.tar.bz2
(FUNCTION_{PRO,EPI}LOGUE): Add code to adjust stack when no frame
pointer. From-SVN: r8415
-rw-r--r--gcc/config/m68k/crds.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/config/m68k/crds.h b/gcc/config/m68k/crds.h
index 2799a4e..edcacdf 100644
--- a/gcc/config/m68k/crds.h
+++ b/gcc/config/m68k/crds.h
@@ -493,6 +493,18 @@ do { int i; \
fprintf (FILE, "\tlink a6,$%d\n", -fsize); \
else \
fprintf (FILE, "\tlink a6,$0\n\tsubl $%d,sp\n", fsize); } \
+ else if (fsize) \
+ { \
+ /* Adding negative number is faster on the 68040. */ \
+ if (fsize + 4 < 0x8000) \
+ { \
+ fprintf (FILE, "\tadd.w #%d,sp\n", - (fsize + 4)); \
+ } \
+ else \
+ { \
+ fprintf (FILE, "\tadd.l #%d,sp\n", - (fsize + 4)); \
+ } \
+ } \
for (regno = 24; regno < 56; regno++) \
if (regs_ever_live[regno] && ! call_used_regs[regno]) \
fprintf(FILE, "\tfpmoved %s, sp@-\n", \
@@ -602,6 +614,17 @@ do { int i; \
} \
if (frame_pointer_needed) \
fprintf (FILE, "\tunlk a6\n"); \
+ else if (fsize) \
+ { \
+ if (fsize + 4 < 0x8000) \
+ { \
+ fprintf (FILE, "\tadd.w #%d,sp\n", fsize + 4); \
+ } \
+ else \
+ { \
+ fprintf (FILE, "\tadd.l #%d,sp\n", fsize + 4); \
+ } \
+ } \
if (current_function_pops_args) \
fprintf (FILE, "\trtd $%d\n", current_function_pops_args); \
else fprintf (FILE, "\trts\n"); }