From: Jason Thorpe Date: Fri, 4 Oct 2002 05:23:12 +0000 (+0000) Subject: vax.c (vax_output_function_prologue): Use asm_fprintf. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=191fe2bba261213a888b5e32919e2752664aa017;p=gcc.git vax.c (vax_output_function_prologue): Use asm_fprintf. * config/vax/vax.c (vax_output_function_prologue): Use asm_fprintf. * config/vax/vax.h (VAX_FUNCTION_PROFILER_NAME): New. (FUNCTION_PROFILER): Rewrite to use ASM_GENERATE_INTERNAL_LABEL, assemble_name, asm_fprintf, and VAX_FUNCTION_PROFILER_NAME. (ASM_OUTPUT_MI_THUNK): Use asm_fprintf instead of REGISTER_PREFIX. (PRINT_OPERAND_PUNCT_VALID_P): Fix comment. * config/vax/elf.h (FUNCTION_PROFILER): Remove. (VAX_FUNCTION_PROFILER_NAME): Redefine as "__mcount". From-SVN: r57801 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a664139beb4..44a509c4765 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2002-10-03 Jason Thorpe + + * config/vax/vax.c (vax_output_function_prologue): Use asm_fprintf. + * config/vax/vax.h (VAX_FUNCTION_PROFILER_NAME): New. + (FUNCTION_PROFILER): Rewrite to use ASM_GENERATE_INTERNAL_LABEL, + assemble_name, asm_fprintf, and VAX_FUNCTION_PROFILER_NAME. + (ASM_OUTPUT_MI_THUNK): Use asm_fprintf instead of REGISTER_PREFIX. + (PRINT_OPERAND_PUNCT_VALID_P): Fix comment. + * config/vax/elf.h (FUNCTION_PROFILER): Remove. + (VAX_FUNCTION_PROFILER_NAME): Redefine as "__mcount". + 2002-10-03 Mark Mitchell * doc/invoke.texi (-Wabi): Document mangling bug. diff --git a/gcc/config/vax/elf.h b/gcc/config/vax/elf.h index ccdb74c7d2c..fe00d22336c 100644 --- a/gcc/config/vax/elf.h +++ b/gcc/config/vax/elf.h @@ -33,11 +33,9 @@ Boston, MA 02111-1307, USA. */ #define PTRDIFF_TYPE "long int" /* Profiling routine. */ -#undef FUNCTION_PROFILER -#define FUNCTION_PROFILER(FILE, LABELNO) \ - fprintf (FILE, "\tmovab .LP%d,%sr0\n\tjsb __mcount\n", (LABELNO), \ - REGISTER_PREFIX) - +#undef VAX_FUNCTION_PROFILER_NAME +#define VAX_FUNCTION_PROFILER_NAME "__mcount" + /* Let's be re-entrant. */ #undef PCC_STATIC_STRUCT_RETURN diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index f8b0a0d3343..ba091dc811d 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -127,16 +127,14 @@ vax_output_function_prologue (file, size) will end up adding them right back again, but don't bother. */ if (MAIN_NAME_P (DECL_NAME (current_function_decl))) - fprintf (file, "\tclrl -(%ssp)\n\tjsb _C$MAIN_ARGS\n", - REGISTER_PREFIX); + asm_fprintf (file, "\tclrl -(%Rsp)\n\tjsb _C$MAIN_ARGS\n"); } size -= STARTING_FRAME_OFFSET; if (size >= 64) - fprintf (file, "\tmovab %d(%ssp),%ssp\n", -size, REGISTER_PREFIX, - REGISTER_PREFIX); + asm_fprintf (file, "\tmovab %d(%Rsp),%Rsp\n", -size); else if (size) - fprintf (file, "\tsubl2 $%d,%ssp\n", size, REGISTER_PREFIX); + asm_fprintf (file, "\tsubl2 $%d,%Rsp\n", size); } /* This is like nonimmediate_operand with a restriction on the type of MEM. */ diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h index c0db2175e81..fe07f42e850 100644 --- a/gcc/config/vax/vax.h +++ b/gcc/config/vax/vax.h @@ -470,9 +470,18 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; /* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */ -#define FUNCTION_PROFILER(FILE, LABELNO) \ - fprintf (FILE, "\tmovab LP%d,%s\n\tjsb mcount\n", (LABELNO), \ - reg_names[0]); +#define VAX_FUNCTION_PROFILER_NAME "mcount" +#define FUNCTION_PROFILER(FILE, LABELNO) \ + do \ + { \ + char label[256]; \ + ASM_GENERATE_INTERNAL_LABEL (label, "LP", (LABELNO)); \ + fprintf (FILE, "\tmovab "); \ + assemble_name (FILE, label); \ + asm_fprintf (FILE, ",%Rr0\n\tjsb %s\n", \ + VAX_FUNCTION_PROFILER_NAME); \ + } \ + while (0) /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, the stack pointer does not matter. The value is tested only in @@ -1155,7 +1164,7 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ do { \ fprintf (FILE, "\t.word 0x0ffc\n"); \ - fprintf (FILE, "\taddl2 $%d,4(%sap)\n", DELTA, REGISTER_PREFIX); \ + asm_fprintf (FILE, "\taddl2 $%d,4(%Rap)\n", DELTA); \ fprintf (FILE, "\tjmp "); \ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \ fprintf (FILE, "+2\n"); \ @@ -1178,7 +1187,8 @@ VAX operand formatting codes: R 32 - constant operand b the low 8 bits of a negated constant operand h the low 16 bits of a negated constant operand - # 'd' or 'g' depending on whether dfloat or gfloat is used */ + # 'd' or 'g' depending on whether dfloat or gfloat is used + | register prefix */ /* The purpose of D is to get around a quirk or bug in VAX assembler whereby -1 in a 64-bit immediate operand means 0x00000000ffffffff,