From: David Edelsohn Date: Sun, 7 Jun 1998 09:34:09 +0000 (+0000) Subject: rs6000.md (restore_stack_block): Generate MEM and specify mode. X-Git-Tag: prereleases/egcs-1.1-prerelease~894 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dfdfa60f540afcfb54a599ce9a59770225d11ce6;p=thirdparty%2Fgcc.git rs6000.md (restore_stack_block): Generate MEM and specify mode. * rs6000.md (restore_stack_block): Generate MEM and specify mode. * rs6000.h (STACK_SAVEAREA_MODE): SAVE_FUNCTION is VOIDmode. * rs6000.c (rs6000_output_load_toc_table): Use fputs. (output_function_profiler): Use asm_fprintf and fputs. From-SVN: r20268 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d473e5a4926a..d9932227fc84 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Sun Jun 7 12:27:30 1998 David Edelsohn + + * rs6000.md (restore_stack_block): Generate MEM and specify mode. + * rs6000.h (STACK_SAVEAREA_MODE): SAVE_FUNCTION is VOIDmode. + * rs6000.c (rs6000_output_load_toc_table): Use fputs. + (output_function_profiler): Use asm_fprintf and fputs. + Sat Jun 6 12:17:12 1998 Kaveh R. Ghazi * gencheck.c: Remove redundant stdio.h include. Add a definition diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 6a04d552855e..72396847ac2c 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3676,7 +3676,7 @@ rs6000_output_load_toc_table (file, reg) ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); asm_fprintf (file, "\t{liu|lis} %s,", reg_names[reg]); assemble_name (file, buf); - asm_fprintf (file, "@ha\n"); + fputs ("@ha\n", file); asm_fprintf (file, "\t{cal|la} %s,", reg_names[reg]); assemble_name (file, buf); asm_fprintf (file, "@l(%s)\n", reg_names[reg]); @@ -4609,32 +4609,28 @@ output_function_profiler (file, labelno) fprintf (file, "\tmflr %s\n", reg_names[0]); 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[0]); + fputs ("\tbl _GLOBAL_OFFSET_TABLE_@local-4\n", file); + asm_fprintf (file, "\t{st|stw} %s,4(%s)\n", + reg_names[0], reg_names[1]); + asm_fprintf (file, "\tmflr %s\n", reg_names[11]); + asm_fprintf (file, "\t{l|lwz} %s,", reg_names[0]); assemble_name (file, buf); - fprintf (file, "@got(%s)\n", reg_names[11]); + asm_fprintf (file, "@got(%s)\n", reg_names[11]); } #if TARGET_ELF else if (flag_pic > 1 || TARGET_RELOCATABLE) { - fprintf (file, "\t%s %s,4(%s)\n", - (TARGET_NEW_MNEMONICS) ? "stw" : "st", - reg_names[0], reg_names[1]); + asm_fprintf (file, "\t{st|stw} %s,4(%s)\n", + 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]); + asm_fprintf (file, "\t{l|lwz} %s,", reg_names[11]); assemble_name (file, buf); - fprintf (file, "X(%s)\n", reg_names[11]); - fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); + asm_fprintf (file, "X(%s)\n", reg_names[11]); + asm_fprintf (file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); assemble_name (file, buf); - fprintf (file, "X = .-.LCTOC1\n"); - fprintf (file, "\t.long "); + fputs ("X = .-.LCTOC1\n", file); + fputs ("\t.long ", file); assemble_name (file, buf); fputs ("\n\t.previous\n", file); } @@ -4643,7 +4639,7 @@ output_function_profiler (file, labelno) { asm_fprintf (file, "\t{liu|lis} %s,", reg_names[11]); assemble_name (file, buf); - asm_fprintf (file, "@ha\n"); + fputs ("@ha\n", file); asm_fprintf (file, "\t{st|stw} %s,4(%s)\n", reg_names[0], reg_names[1]); asm_fprintf (file, "\t{cal|la} %s,", reg_names[0]); assemble_name (file, buf); diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 7190de757de4..910d99e0e68e 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1324,9 +1324,12 @@ extern int rs6000_sysv_varargs_p; && (DEFAULT_ABI != ABI_SOLARIS || int_size_in_bytes (TYPE) > 8)) /* Mode of stack savearea. + FUNCTION is VOIDmode because calling convention maintains SP. + BLOCK needs Pmode for SP. NONLOCAL needs twice Pmode to maintain both backchain and SP. */ #define STACK_SAVEAREA_MODE(LEVEL) \ - (LEVEL == SAVE_NONLOCAL ? (TARGET_32BIT ? DImode : TImode) : Pmode) + (LEVEL == SAVE_FUNCTION ? VOIDmode \ + : LEVEL == SAVE_NONLOCAL ? (TARGET_32BIT ? DImode : TImode) : Pmode) /* Minimum and maximum general purpose registers used to hold arguments. */ #define GP_ARG_MIN_REG 3 diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 61398db34b2c..91300e37ca5b 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -7318,12 +7318,16 @@ "") (define_expand "restore_stack_block" - [(set (match_dup 2) (mem (match_operand 0 "register_operand" ""))) + [(use (match_operand 0 "register_operand" "")) + (set (match_dup 2) (match_dup 3)) (set (match_dup 0) (match_operand 1 "register_operand" "")) - (set (mem (match_dup 0)) (match_dup 2))] + (set (match_dup 3) (match_dup 2))] "" " -{ operands[2] = gen_reg_rtx (Pmode); }") +{ + operands[2] = gen_reg_rtx (Pmode); + operands[3] = gen_rtx (MEM, Pmode, operands[0]); +}") (define_expand "save_stack_nonlocal" [(match_operand 0 "memory_operand" "")