diff options
Diffstat (limited to 'gcc/config/m88k')
-rw-r--r-- | gcc/config/m88k/m88k.c | 46 | ||||
-rw-r--r-- | gcc/config/m88k/m88k.h | 9 | ||||
-rw-r--r-- | gcc/config/m88k/sysv3.h | 35 |
3 files changed, 42 insertions, 48 deletions
diff --git a/gcc/config/m88k/m88k.c b/gcc/config/m88k/m88k.c index 4ece2d6052e..f77aa474a7c 100644 --- a/gcc/config/m88k/m88k.c +++ b/gcc/config/m88k/m88k.c @@ -67,6 +67,10 @@ static void m88k_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); static void m88k_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); static void m88k_output_function_end_prologue PARAMS ((FILE *)); static void m88k_output_function_begin_epilogue PARAMS ((FILE *)); +#ifdef INIT_SECTION_ASM_OP +static void m88k_svr3_asm_out_constructor PARAMS ((rtx, int)); +static void m88k_svr3_asm_out_destructor PARAMS ((rtx, int)); +#endif /* Initialize the GCC target structure. */ #undef TARGET_ASM_FUNCTION_PROLOGUE @@ -1891,15 +1895,10 @@ m88k_layout_frame () int need = ((m88k_stack_size ? STACK_UNIT_BOUNDARY - STARTING_FRAME_OFFSET : 0) - (frame_size % STACK_UNIT_BOUNDARY)); - if (need) - { - if (need < 0) - need += STACK_UNIT_BOUNDARY; - (void) assign_stack_local (BLKmode, need, BITS_PER_UNIT); - frame_size = get_frame_size (); - } + if (need < 0) + need += STACK_UNIT_BOUNDARY; m88k_stack_size - = ROUND_CALL_BLOCK_SIZE (m88k_stack_size + frame_size + = ROUND_CALL_BLOCK_SIZE (m88k_stack_size + frame_size + need + current_function_pretend_args_size); } } @@ -3285,3 +3284,34 @@ symbolic_operand (op, mode) return 0; } } + +#ifdef INIT_SECTION_ASM_OP +static void +m88k_svr3_asm_out_constructor (symbol, priority) + rtx symbol; + int priority ATTRIBUTE_UNUSED; +{ + const char *name = XSTR (symbol, 0); + + init_section (); + fprintf (asm_out_file, "\tor.u\t r13,r0,hi16("); + assemble_name (asm_out_file, name); + fprintf (asm_out_file, ")\n\tor\t r13,r13,lo16("); + assemble_name (asm_out_file, name); + fprintf (asm_out_file, ")\n\tsubu\t r31,r31,%d\n\tst\t r13,r31,%d\n", + STACK_BOUNDARY / BITS_PER_UNIT, REG_PARM_STACK_SPACE (0)); +} + +static void +m88k_svr3_asm_out_destructor (symbol, priority) + rtx symbol; + int priority ATTRIBUTE_UNUSED; +{ + int i; + + fini_section (); + assemble_integer (symbol, UNITS_PER_WORD, 1); + for (i = 1; i < 4; i++) + assemble_integer (constm1_rtx, UNITS_PER_WORD, 1); +} +#endif diff --git a/gcc/config/m88k/m88k.h b/gcc/config/m88k/m88k.h index 81358f717bf..1f7304c51c7 100644 --- a/gcc/config/m88k/m88k.h +++ b/gcc/config/m88k/m88k.h @@ -2438,15 +2438,14 @@ do { \ #if defined(USING_SVR4_H) -#define EXTRA_SECTIONS in_const, in_tdesc, in_sdata, in_ctors, in_dtors +#define EXTRA_SECTIONS in_const, in_tdesc, in_sdata #define INIT_SECTION_FUNCTION #define FINI_SECTION_FUNCTION #else #if defined(USING_SVR3_H) -#define EXTRA_SECTIONS in_const, in_tdesc, in_sdata, in_ctors, in_dtors, \ - in_init, in_fini +#define EXTRA_SECTIONS in_const, in_tdesc, in_sdata, in_init, in_fini #else /* luna or other not based on svr[34].h. */ @@ -2458,8 +2457,6 @@ const_section () \ { \ text_section(); \ } -#define CTORS_SECTION_FUNCTION -#define DTORS_SECTION_FUNCTION #define INIT_SECTION_FUNCTION #define FINI_SECTION_FUNCTION @@ -2490,8 +2487,6 @@ sdata_section () \ } \ } \ \ - CTORS_SECTION_FUNCTION \ - DTORS_SECTION_FUNCTION \ INIT_SECTION_FUNCTION \ FINI_SECTION_FUNCTION diff --git a/gcc/config/m88k/sysv3.h b/gcc/config/m88k/sysv3.h index 9986f62bc26..bd9f4a1823d 100644 --- a/gcc/config/m88k/sysv3.h +++ b/gcc/config/m88k/sysv3.h @@ -76,20 +76,8 @@ Boston, MA 02111-1307, USA. */ asm ("\tst\t r0,r31,32"); /* REG_PARM_STACK_SPACE (0) == 32 */ #define CTOR_LIST_END -/* ASM_OUTPUT_CONSTRUCTOR outputs code into the .init section to push the - address of the constructor. This becomes the body of __do_global_ctors - in crtstuff.c. r13 is a temporary register. */ -#undef ASM_OUTPUT_CONSTRUCTOR -#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ - do { \ - init_section (); \ - fprintf (FILE, "\tor.u\t r13,r0,hi16("); \ - assemble_name (FILE, NAME); \ - fprintf (FILE, ")\n\tor\t r13,r13,lo16("); \ - assemble_name (FILE, NAME); \ - fprintf (FILE, ")\n\tsubu\t r31,r31,%d\n\tst\t r13,r31,%d\n", \ - STACK_BOUNDARY / BITS_PER_UNIT, REG_PARM_STACK_SPACE (0)); \ - } while (0) +#define TARGET_ASM_CONSTRUCTOR m88k_svr3_asm_out_constructor +#define TARGET_ASM_DESTRUCTOR m88k_svr3_asm_out_destructor #undef DO_GLOBAL_CTORS_BODY #define DO_GLOBAL_CTORS_BODY \ @@ -108,25 +96,6 @@ do { \ func_ptr __DTOR_END__[4] = { (func_ptr) 0, (func_ptr) 0, \ (func_ptr) 0, (func_ptr) 0 } -/* A C statement (sans semicolon) to output an element in the table of - global destructors. The table is constructed in the .fini section - so that an explicit linker script is not required. The complication - is that this section is padded with NOP instructions and to either - 8 or 16 byte alignment depending on the specific system. A clever - way to avoid trouble is to output a block of 16 bytes where the - extra words are known values (-1). */ -#undef ASM_OUTPUT_DESTRUCTOR -#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ - do { \ - register int i; \ - fini_section (); \ - fprintf (FILE, "\t%s\t ", ASM_LONG); \ - assemble_name (FILE,NAME); \ - fprintf (FILE, "\n"); \ - for (i = 1; i < 4; i++) \ - fprintf (FILE, "\t%s\t -1\n", ASM_LONG); \ - } while (0) - /* Walk the list looking for the terminating zero and ignoring all values of -1. */ #undef DO_GLOBAL_DTORS_BODY |