summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorMichael Meissner <meissner@cygnus.com>1997-11-26 21:29:00 +0000
committerJeff Law <law@gcc.gnu.org>1997-11-26 14:29:00 -0700
commit8ef1b93db410153f985d914977f808a224976acd (patch)
tree07f9e0da0879bcc3e5820c7f850b6660a66bf082 /gcc/config
parentef32ca543bb7676a75de1b2cd8a07c10f240611d (diff)
downloadgcc-8ef1b93db410153f985d914977f808a224976acd.tar.gz
rs6000.c (output_function_profiler): Put label address in r0, and store LR in 4(sp) for System V/eabi.
* rs6000.c (output_function_profiler): Put label address in r0, and store LR in 4(sp) for System V/eabi. * rs6000.h (ASM_OUTPUT_REG_{PUSH,POP}): Keep stack aligned to 16 byte boundary, and maintain stack backchain. From-SVN: r16759
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/rs6000/rs6000.c23
-rw-r--r--gcc/config/rs6000/rs6000.h11
2 files changed, 22 insertions, 12 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 1d44f59ebeb..cbd682a9d7c 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4436,28 +4436,33 @@ output_function_profiler (file, labelno)
if (flag_pic == 1)
{
fprintf (file, "\tbl _GLOBAL_OFFSET_TABLE_@local-4\n");
+ fprintf (file, "\t%s %s,4(%s)\n",
+ (TARGET_NEW_MNEMONICS) ? "stw" : "st",
+ reg_names[0], reg_names[1]);
fprintf (file, "\tmflr %s\n", reg_names[11]);
fprintf (file, "\t%s %s,", (TARGET_NEW_MNEMONICS) ? "lwz" : "l",
- reg_names[11]);
+ reg_names[0]);
assemble_name (file, buf);
fprintf (file, "@got(%s)\n", reg_names[11]);
}
#if TARGET_ELF
else if (flag_pic > 1 || TARGET_RELOCATABLE)
{
- fprintf (file, "\tstw %s,4(%s)\n", reg_names[0], reg_names[1]);
- fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
- assemble_name (file, buf);
- fprintf (file, "X = .-.LCTOC1\n");
- fprintf (file, "\t.long ");
- assemble_name (file, buf);
- fputs ("\n\t.previous\n", file);
+ fprintf (file, "\t%s %s,4(%s)\n",
+ (TARGET_NEW_MNEMONICS) ? "stw" : "st",
+ reg_names[0], reg_names[1]);
rs6000_pic_func_labelno = rs6000_pic_labelno;
rs6000_output_load_toc_table (file, 11);
fprintf (file, "\t%s %s,", (TARGET_NEW_MNEMONICS) ? "lwz" : "l",
reg_names[11]);
assemble_name (file, buf);
fprintf (file, "X(%s)\n", reg_names[11]);
+ fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
+ assemble_name (file, buf);
+ fprintf (file, "X = .-.LCTOC1\n");
+ fprintf (file, "\t.long ");
+ assemble_name (file, buf);
+ fputs ("\n\t.previous\n", file);
}
#endif
else if (TARGET_NEW_MNEMONICS)
@@ -4466,7 +4471,7 @@ output_function_profiler (file, labelno)
assemble_name (file, buf);
fprintf (file, "@ha\n");
fprintf (file, "\tstw %s,4(%s)\n", reg_names[0], reg_names[1]);
- fprintf (file, "\taddi %s,%s,", reg_names[11], reg_names[11]);
+ fprintf (file, "\taddi %s,%s,", reg_names[0], reg_names[11]);
assemble_name (file, buf);
fputs ("@l\n", file);
}
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 91242a8c35a..3e7b932ffb2 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -2904,12 +2904,17 @@ do { \
#define ASM_OUTPUT_ASCII(FILE, P, N) output_ascii ((FILE), (P), (N))
/* This is how to output code to push a register on the stack.
- It need not be very fast code. */
+ It need not be very fast code.
+
+ On the rs6000, we must keep the backchain up to date. In order
+ to simplify things, always allocate 16 bytes for a push (System V
+ wants to keep stack aligned to a 16 byte boundary). */
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
do { \
extern char *reg_names[]; \
- asm_fprintf (FILE, "\{tstu|stwu} %s,-4(%s)\n", reg_names[REGNO], \
+ asm_fprintf (FILE, "\t{stu|stwu} %s,-16(%s)\n\t{st|stw} %s,8(%s)\n", \
+ reg_names[1], reg_names[1], reg_names[REGNO], \
reg_names[1]); \
} while (0)
@@ -2919,7 +2924,7 @@ do { \
#define ASM_OUTPUT_REG_POP(FILE,REGNO) \
do { \
extern char *reg_names[]; \
- asm_fprintf (FILE, "\t{l|lwz} %s,0(%s)\n\t{ai|addic} %s,%s,4\n", \
+ asm_fprintf (FILE, "\t{l|lwz} %s,8(%s)\n\t{ai|addic} %s,%s,16\n", \
reg_names[REGNO], reg_names[1], reg_names[1], \
reg_names[1]); \
} while (0)