--- gcc/config/m68kv4.h 2018/04/24 17:51:34 1.1 +++ gcc/config/m68kv4.h 2018/04/24 18:04:57 1.1.1.3 @@ -21,7 +21,6 @@ the Free Software Foundation, 675 Mass A /* Use SGS_* macros to control compilation in m68k.md */ -#define SGS_SWAP_W /* Use swap.w rather than just plain swap */ #define SGS_SWITCH_TABLES /* Different switch table handling */ #include "m68ksgs.h" /* The m68k/SVR4 assembler is SGS based */ @@ -85,7 +84,7 @@ the Free Software Foundation, 675 Mass A than ".bss", so override the definition in svr4.h */ #undef BSS_ASM_OP -#define BSS_ASM_OP "\t.lcomm" +#define BSS_ASM_OP ".lcomm" /* Register in which address to store a structure value is passed to a function. The default in m68k.h is a1. For m68k/SVR4 it is a0. */ @@ -113,7 +112,7 @@ the Free Software Foundation, 675 Mass A #undef ASM_OUTPUT_SKIP #define ASM_OUTPUT_SKIP(FILE,SIZE) \ - fprintf (FILE, "%s %u\n", SPACE_ASM_OP, (SIZE)) + fprintf (FILE, "\t%s %u\n", SPACE_ASM_OP, (SIZE)) /* 1 if N is a possible register number for a function value. For m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, @@ -182,3 +181,56 @@ do { \ #undef BIGGEST_ALIGNMENT #define BIGGEST_ALIGNMENT 64 + +/* SVR4 m68k assembler is bitching on the `comm i,1,1' which askes for + 1 byte alignment. Don't generate alignment for COMMON seems to be + safer until we the assembler is fixed. */ +#undef ASM_OUTPUT_ALIGNED_COMMON +/* Same problem with this one. */ +#undef ASM_OUTPUT_ALIGNED_LOCAL + +/* The `string' directive on m68k svr4 does not handle string with + escape char (ie., `\') right. Use normal way to output ASCII bytes + seems to be safer. */ +#undef ASM_OUTPUT_ASCII +#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \ +{ \ + register int sp = 0, lp = 0, ch; \ + fprintf ((FILE), "\t%s ", BYTE_ASM_OP); \ + do { \ + ch = (PTR)[sp]; \ + if (ch > ' ' && ! (ch & 0x80) && ch != '\\') \ + { \ + fprintf ((FILE), "'%c", ch); \ + } \ + else \ + { \ + fprintf ((FILE), "0x%x", ch); \ + } \ + if (++sp < (LEN)) \ + { \ + if ((sp % 10) == 0) \ + { \ + fprintf ((FILE), "\n\t%s ", BYTE_ASM_OP); \ + } \ + else \ + { \ + putc (',', (FILE)); \ + } \ + } \ + } while (sp < (LEN)); \ + putc ('\n', (FILE)); \ +} + +/* SVR4 m68k assembler is bitching on the syntax `2.b'. + So use the "LLDnnn-LLnnn" format. Define LLDnnn after the table. */ + +#undef ASM_OUTPUT_CASE_END +#define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \ +do { \ + if (switch_table_difference_label_flag) \ + asm_fprintf ((FILE), "\t%s %LLD%d,%LL%d\n", SET_ASM_OP, (NUM), (NUM));\ + switch_table_difference_label_flag = 0; \ +} while (0) + +int switch_table_difference_label_flag;