From 68a7a0e545fa33b460ab66817d3016e151175ba9 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 18 Mar 2019 20:55:27 +0100 Subject: [PATCH] gcc6809: update patch to latest upstream version. --- dev-embedded/gcc6809/gcc6809-4.6.4.recipe | 6 +- ....4.patchset => gcc6809lw-4.6.4-9.patchset} | 829 ++++++++---------- 2 files changed, 381 insertions(+), 454 deletions(-) rename dev-embedded/gcc6809/patches/{gcc6809-4.6.4.patchset => gcc6809lw-4.6.4-9.patchset} (95%) diff --git a/dev-embedded/gcc6809/gcc6809-4.6.4.recipe b/dev-embedded/gcc6809/gcc6809-4.6.4.recipe index e81136c5d..3f15e7e45 100644 --- a/dev-embedded/gcc6809/gcc6809-4.6.4.recipe +++ b/dev-embedded/gcc6809/gcc6809-4.6.4.recipe @@ -3,14 +3,14 @@ DESCRIPTION="This is a version of the GCC compiler for the Motorla 6809. It \ uses the lwtools as a backend. Note that there is no C library provided." HOMEPAGE="http://lwtools.projects.l-w.ca" SOURCE_URI="ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/releases/gcc-$portVersion/gcc-$portVersion.tar.bz2" -#CHECKSUM_SHA256="e8f5853d4eec2f5ebaf8a72ae4d53c436aacf98153b2499f8635b48c4718a093" -REVISION="1" +CHECKSUM_SHA256="35af16afa0b67af9b8eb15cafb76d2bc5f568540552522f5dc2c88dd45d977e8" +REVISION="3" COPYRIGHT="1988-2013 Free Software Foundation, Inc." LICENSE=" GNU GPL v2 GNU LGPL v2 " -PATCHES="gcc6809-$portVersion.patchset" +PATCHES="gcc6809lw-$portVersion-9.patchset" ARCHITECTURES="!x86_gcc2" SECONDARY_ARCHITECTURES="x86" diff --git a/dev-embedded/gcc6809/patches/gcc6809-4.6.4.patchset b/dev-embedded/gcc6809/patches/gcc6809lw-4.6.4-9.patchset similarity index 95% rename from dev-embedded/gcc6809/patches/gcc6809-4.6.4.patchset rename to dev-embedded/gcc6809/patches/gcc6809lw-4.6.4-9.patchset index dea74b7b7..6d2a9e53e 100644 --- a/dev-embedded/gcc6809/patches/gcc6809-4.6.4.patchset +++ b/dev-embedded/gcc6809/patches/gcc6809lw-4.6.4-9.patchset @@ -1,34 +1,7 @@ -From 0c5f25aaf0fedee6f09bc07507aec23eb6776bdd Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Sun, 15 Jan 2017 21:13:16 +0100 -Subject: applying patch gcc6809-4.6.4.patch - - -diff --git a/README.LW b/README.LW -new file mode 100644 -index 0000000..bf40e54 ---- /dev/null -+++ b/README.LW -@@ -0,0 +1,14 @@ -+This is a port of gcc6809 which is designed to work with the lwtools -+cross-assembler and linker package. You will need several scripts from that -+package, available at http://lost.l-w.ca/coco/lwtools/, in order to use -+this. Instructions for building are present in the lwtools package. -+ -+This work is based extensively on the gcc6809 4.3.4-3 release by Brian -+Dominy (brian@oddchange.com) with some significant renovations to make it -+work with gcc 4.6.1. -+ -+There is no guarantee that it will work for any particular purpose you -+choose to put it to. -+ -+If you run into any problems, contact William Astle (lost@l-w.ca). DO NOT -+contact the main GCC developers! -diff --git a/config.sub b/config.sub -index 204218c..75da021 100755 ---- a/config.sub -+++ b/config.sub -@@ -313,7 +313,7 @@ case $basic_machine in +diff -urN gcc-4.6.4-clean/config.sub gcc-4.6.4/config.sub +--- gcc-4.6.4-clean/config.sub 2010-05-25 07:22:07.000000000 -0600 ++++ gcc-4.6.4/config.sub 2017-11-28 21:12:11.136911706 -0700 +@@ -313,7 +313,7 @@ c6x) basic_machine=tic6x-unknown ;; @@ -37,7 +10,7 @@ index 204218c..75da021 100755 # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none -@@ -354,7 +354,7 @@ case $basic_machine in +@@ -354,7 +354,7 @@ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ @@ -46,7 +19,7 @@ index 204218c..75da021 100755 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ -@@ -509,6 +509,10 @@ case $basic_machine in +@@ -509,6 +509,10 @@ basic_machine=arm-unknown os=-cegcc ;; @@ -57,11 +30,10 @@ index 204218c..75da021 100755 convex-c1) basic_machine=c1-convex os=-bsd -diff --git a/configure b/configure -index 6be5e9d..33ed6f6 100755 ---- a/configure -+++ b/configure -@@ -3439,6 +3439,9 @@ case "${target}" in +diff -urN gcc-4.6.4-clean/configure gcc-4.6.4/configure +--- gcc-4.6.4-clean/configure 2011-12-18 03:03:44.000000000 -0700 ++++ gcc-4.6.4/configure 2017-11-28 21:12:11.136911706 -0700 +@@ -3439,6 +3439,9 @@ m32r-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; @@ -71,11 +43,10 @@ index 6be5e9d..33ed6f6 100755 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) noconfigdirs="$noconfigdirs target-libstdc++-v3 ${libgcj}" libgloss_dir=m68hc11 -diff --git a/configure.ac b/configure.ac -index ba6d84d..ae8e733 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -885,6 +885,9 @@ case "${target}" in +diff -urN gcc-4.6.4-clean/configure.ac gcc-4.6.4/configure.ac +--- gcc-4.6.4-clean/configure.ac 2011-11-18 04:45:44.000000000 -0700 ++++ gcc-4.6.4/configure.ac 2017-11-28 21:12:11.140911685 -0700 +@@ -885,6 +885,9 @@ m32r-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; @@ -85,34 +56,10 @@ index ba6d84d..ae8e733 100644 m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) noconfigdirs="$noconfigdirs target-libstdc++-v3 ${libgcj}" libgloss_dir=m68hc11 -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index e0b952f..c2f5318 100644 ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -2003,14 +2003,14 @@ $(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ - - # Compile the start modules crt0.o and mcrt0.o that are linked with - # every program --$(T)crt0.o: s-crt0 ; @true --$(T)mcrt0.o: s-crt0; @true -+crt0.o: s-crt0 ; @true -+mcrt0.o: s-crt0; @true - - s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H) - $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \ -- -o $(T)crt0.o -c $(CRT0_S) -+ -o crt0.o -c $(CRT0_S) - $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \ -- -o $(T)mcrt0.o -c $(MCRT0_S) -+ -o mcrt0.o -c $(MCRT0_S) - $(STAMP) s-crt0 - # - # Compiling object files from source files. -diff --git a/gcc/calls.c b/gcc/calls.c -index 4ad6c3f..f3af562 100644 ---- a/gcc/calls.c -+++ b/gcc/calls.c -@@ -2561,7 +2561,7 @@ expand_call (tree exp, rtx target, int ignore) +diff -urN gcc-4.6.4-clean/gcc/calls.c gcc-4.6.4/gcc/calls.c +--- gcc-4.6.4-clean/gcc/calls.c 2012-02-09 10:27:25.000000000 -0700 ++++ gcc-4.6.4/gcc/calls.c 2017-11-28 21:12:11.140911685 -0700 +@@ -2561,7 +2561,7 @@ call sequence. Also do the adjustments before a throwing call, otherwise exception handling can fail; PR 19225. */ @@ -121,39 +68,10 @@ index 4ad6c3f..f3af562 100644 || (pending_stack_adjust > 0 && (flags & ECF_MAY_BE_ALLOCA)) || (pending_stack_adjust > 0 -diff --git a/gcc/config.gcc b/gcc/config.gcc -index 6dc2427..da0f667 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -375,6 +375,9 @@ m32r*-*-*) - cpu_type=m32r - extra_options="${extra_options} g.opt" - ;; -+m6809-*-*) -+ cpu_type=m6809 -+ ;; - m68k-*-*) - extra_headers=math-68881.h - ;; -@@ -1706,6 +1709,12 @@ m32rle-*-linux*) - thread_file='posix' - fi - ;; -+m6809-coco-*) -+ tmake_file="${tmake_file} m6809/t-m6809 m6809/t-coco" -+ ;; -+m6809-*-*) -+ tmake_file="${tmake_file} m6809/t-m6809 m6809/t-sim" -+ ;; - # m68hc11 and m68hc12 share the same machine description. - m68hc11-*-*|m6811-*-*) - tm_file="dbxelf.h elfos.h usegas.h newlib-stdint.h m68hc11/m68hc11.h" -diff --git a/gcc/config/m6809/crt0.S b/gcc/config/m6809/crt0.S -new file mode 100644 -index 0000000..5f78c82 ---- /dev/null -+++ b/gcc/config/m6809/crt0.S -@@ -0,0 +1,173 @@ +diff -urN gcc-4.6.4-clean/gcc/config/m6809/crt0.S gcc-4.6.4/gcc/config/m6809/crt0.S +--- gcc-4.6.4-clean/gcc/config/m6809/crt0.S 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/gcc/config/m6809/crt0.S 2017-11-29 17:11:09.221248469 -0700 +@@ -0,0 +1,182 @@ +;;; +;;; Copyright 2006, 2007, 2008, 2009 by Brian Dominy +;;; @@ -174,8 +92,7 @@ index 0000000..5f78c82 +;;; . + + /* Declare external for main() */ -+ .globl _main -+ ++ .globl _main + +/* The startup is heavily dependent on the type of machine and +OS environment that is available at the start point. @@ -184,7 +101,7 @@ index 0000000..5f78c82 +conditional compiles throughout the startup code for each of the +supported machines. */ + -+#ifdef TARGET_COCO /* CoCo memory map */ ++#if defined(TARGET_COCO) /* CoCo memory map */ + +#define COCO_RAMROM_MODE 0xFFDE +#define COCO_ALLRAM_MODE 0xFFDF @@ -197,6 +114,10 @@ index 0000000..5f78c82 + +#define __STACK_TOP 0x6800 + ++#elif defined(TARGET_PROTO) /* Prototype hardware. Customisation of this section is expected! */ ++ ++#define __STACK_TOP 0x8000 ++ +#else /* Simulator (default) memory map */ + +#define SIM_EXIT_REG 0xFF01 @@ -205,61 +126,67 @@ index 0000000..5f78c82 + +#endif + ++ .area .data ++ .area .ctors ++ .area .dtors ++ .area .bss + -+ .area .data -+ .area .ctors -+ .area .dtors -+ .area .bss -+ -+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ++ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;; + ;;; __exit : Exit point from the program + ;;; For simulation, this writes to a special I/O register that + ;;; the simulator interprets as end-of-program. + ;;; -+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ++ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + .area .text -+ .globl __exit ++ .globl __exit +__exit: -+#ifdef TARGET_COCO ++#if defined(TARGET_COCO) + ;; Go back to ROM/RAM mode + sta COCO_RAMROM_MODE + clr BASIC_WARMSTART_FLAG -+ jmp BASIC_START -+#else ++ jmp BASIC_START ++#elif defined(TARGET_PROTO) /* Prototype hardware. Customisation of this section is expected! */ ++ tfr x,d ++__ex@0 bra __ex@0 ++#else /* Simulator */ + tfr x,d + stb SIM_EXIT_REG + bra __exit +#endif + -+ -+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ++ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;; + ;;; __start : Entry point to the program + ;;; -+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ++ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + .area .text -+ .globl __start ++ .globl __start +__start: + -+#ifdef HAVE_DIRECT ++#if defined(HAVE_DIRECT) + ;; Initialize the direct page pointer + lda #. */ -+ -+#ifndef __M6809_PROTOS_H__ -+#define __M6809_PROTOS_H__ -+ -+void print_options (FILE *file); -+void m6809_cpu_cpp_builtins (void); -+void m6809_override_options (void); -+void m6809_init_builtins (void); -+unsigned int m6809_get_live_regs (void); -+const char * m6809_get_regs_printable (unsigned int regs); -+unsigned int m6809_get_regs_size (unsigned int regs); -+int m6809_function_has_type_attr_p (tree decl, const char *); -+int m6809_current_function_has_type_attr_p (const char *); -+int prologue_epilogue_required (void); -+int noreturn_functionp (rtx x); -+void output_function_prologue (FILE *file, int size); -+void output_function_epilogue (FILE *file, int size); -+int check_float_value (enum machine_mode mode, double *d, int overflow); -+void m6809_asm_named_section (const char *name, unsigned int flags, tree decl); -+void m6809_asm_file_start (void); -+void m6809_output_ascii (FILE *fp, const char *str, unsigned long size); -+void m6809_declare_function_name (FILE *asm_out_file, const char *name, tree decl); -+void m6809_reorg (void); -+int m6809_current_function_is_void (void); -+int m6809_can_merge_pushpop_p (int op, int regs1, int regs2); -+int m6809_function_value_regno_p (unsigned int regno); -+void emit_prologue_insns (void); -+void emit_epilogue_insns (bool); -+void m6809_conditional_register_usage (void); -+void m6809_output_quoted_string (FILE *asm_file, const char *string); -+int m6809_match_peephole2 (unsigned int peephole_id, unsigned int stage); -+int m6809_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode); -+int power_of_two_p (unsigned int n); -+void m6809_do_casesi (rtx index, rtx lower_bound, rtx range, rtx table_label, rtx default_label); -+void m6809_output_addsi3 (int rtx_code, rtx *operands); -+rtx m6809_function_arg_on_stack (CUMULATIVE_ARGS *cump); -+void expand_constant_shift (int code, rtx dst, rtx src, rtx count); -+int m6809_single_operand_operator (rtx exp); -+ -+#ifdef TREE_CODE -+int m6809_init_cumulative_args (CUMULATIVE_ARGS cum, tree fntype, rtx libname); -+#endif /* TREE_CODE */ -+ -+#ifdef RTX_CODE -+void print_direct_prefix (FILE *file, rtx addr); -+void print_operand (FILE *file, rtx x, int code); -+void print_operand_address (FILE *file, rtx addr); -+void notice_update_cc (rtx exp, rtx insn); -+enum reg_class m6809_preferred_reload_class (rtx x, enum reg_class regclass); -+rtx gen_rtx_const_high (rtx r); -+rtx gen_rtx_const_low (rtx r); -+rtx gen_rtx_register_pushpop (int pop_flag, int regs); -+void emit_libcall_insns (enum machine_mode mode, const char *name, rtx *operands, int count); -+const char * output_branch_insn (enum rtx_code code, rtx *operands, int length); -+void output_far_call_insn (rtx *operands, int has_return); -+void m6809_initialize_trampoline (rtx tramp, tree fndecl, rtx cxt); -+rtx m6809_expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, int ignore); -+const char * far_functionp (rtx x); -+rtx m6809_function_value (const tree valtype, const tree func); -+void m6809_output_shift_insn (int rtx_code, rtx *operands); -+ -+const char * m6809_get_decl_bank (tree decl); -+void output_branch_insn1 (const char *opcode, rtx *operands, int long_p); -+rtx m6809_builtin_operand (tree arglist, enum machine_mode mode, int opnum); -+const char * far_function_type_p (tree type); -+void m6809_asm_trampoline_template(FILE *f); -+bool m6809_frame_pointer_required (void); -+int m6809_can_eliminate (int from, int to); -+int m6809_initial_elimination_offset (int from, int to); -+void m6809_emit_move_insn (rtx dst, rtx src); -+void m6809_split_shift (enum rtx_code code, rtx *operands); -+bool m6809_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED); -+ -+ -+#endif /* RTX_CODE */ -+ -+#endif /* __M6809_PROTOS_H__ */ -diff --git a/gcc/config/m6809/m6809.c b/gcc/config/m6809/m6809.c -new file mode 100644 -index 0000000..721583e ---- /dev/null -+++ b/gcc/config/m6809/m6809.c -@@ -0,0 +1,3023 @@ +diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.c gcc-4.6.4/gcc/config/m6809/m6809.c +--- gcc-4.6.4-clean/gcc/config/m6809/m6809.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/gcc/config/m6809/m6809.c 2017-11-29 17:11:09.221248469 -0700 +@@ -0,0 +1,3027 @@ +/*------------------------------------------------------------------- + FILE: m6809.c +-------------------------------------------------------------------*/ @@ -1100,9 +923,9 @@ index 0000000..721583e + +/* Section names. The defaults here are used until an + * __attribute__((section)) is seen that changes it. */ -+char code_section_op[128] = "\t.area .text"; -+char data_section_op[128] = "\t.area .data"; -+char bss_section_op[128] = "\t.area .bss"; ++char code_section_op[128] = "\n\t.area\t.text"; ++char data_section_op[128] = "\n\t.area\t.data"; ++char bss_section_op[128] = "\n\t.area\t.bss"; +const char *code_bank_option = 0; + +/* TRUE if the direct mode prefix might be valid in this context. @@ -1146,11 +969,11 @@ index 0000000..721583e + + /* Handle -mcode-section, -mdata-section, and -mbss-section */ + if (code_section_ptr != 0) -+ sprintf (code_section_op, "\t.area %s", code_section_ptr); ++ sprintf (code_section_op, "\t.area\t%s", code_section_ptr); + if (data_section_ptr != 0) -+ sprintf (data_section_op, "\t.area %s", data_section_ptr); ++ sprintf (data_section_op, "\t.area\t%s", data_section_ptr); + if (bss_section_ptr != 0) -+ sprintf (bss_section_op, "\t.area %s", bss_section_ptr); ++ sprintf (bss_section_op, "\t.area\t%s", bss_section_ptr); + + /* Handle -mcode-bank */ + if (code_bank_option != 0) @@ -1443,6 +1266,7 @@ index 0000000..721583e + if (REG_P (SET_DEST (exp)) && src_code == MEM) { + cc_status.value1 = SET_SRC (exp); + cc_status.value2 = SET_DEST (exp); ++ cc_status.flags |= CC_NO_OVERFLOW; + return; + } + @@ -1450,6 +1274,7 @@ index 0000000..721583e + if (dst_code == MEM && REG_P (SET_SRC (exp))) { + cc_status.value1 = SET_SRC (exp); + cc_status.value2 = SET_DEST (exp); ++ cc_status.flags |= CC_NO_OVERFLOW; + return; + } + @@ -1741,23 +1566,25 @@ index 0000000..721583e + const char *bank_name = m6809_get_decl_bank (decl); + if (bank_name != NULL) + { ++ fprintf (asm_out_file, "\n"); ++ + /* Declare __self_bank as a local assembler value that denotes + * which bank the current function is in. This is required only + * when the bank actually changes. */ + if (strcmp (bank_name, current_bank_name)) + { -+ fprintf (asm_out_file, "__self_bank\t.equ %s\n", bank_name); ++ fprintf (asm_out_file, "__self_bank\t.equ\t%s\n", bank_name); + strcpy (current_bank_name, bank_name); + } + + /* Declare a global assembler value that denotes which bank the + * named function is in. */ -+ fprintf (asm_out_file, "__%s_bank\t.gblequ %s\n", name, bank_name); ++ fprintf (asm_out_file, "__%s_bank\t.gblequ\t%s\n", name, bank_name); + + /* Force the current function into a new area */ -+ fprintf (asm_out_file, "\t.bank bank_%s (FSFX=_%s)\n", ++ fprintf (asm_out_file, "\t.bank\tbank_%s (FSFX=_%s)\n", + bank_name, bank_name); -+ fprintf (asm_out_file, "\t.area bank_%s (BANK=bank_%s)\n", ++ fprintf (asm_out_file, "\t.area\tbank_%s (BANK=bank_%s)\n", + bank_name, bank_name); + } + @@ -1865,7 +1692,7 @@ index 0000000..721583e + unsigned int flags ATTRIBUTE_UNUSED, + tree decl) +{ -+ fprintf (asm_out_file, "\t.area\t%s\n", name); ++ fprintf (asm_out_file, "\n\t.area\t%s\n", name); +} + + @@ -3973,12 +3800,10 @@ index 0000000..721583e + +/* Defines the target-specific hooks structure. */ +struct gcc_target targetm = TARGET_INITIALIZER; -diff --git a/gcc/config/m6809/m6809.h b/gcc/config/m6809/m6809.h -new file mode 100644 -index 0000000..386bcc9 ---- /dev/null -+++ b/gcc/config/m6809/m6809.h -@@ -0,0 +1,1352 @@ +diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.h gcc-4.6.4/gcc/config/m6809/m6809.h +--- gcc-4.6.4-clean/gcc/config/m6809/m6809.h 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/gcc/config/m6809/m6809.h 2017-11-29 17:11:09.221248469 -0700 +@@ -0,0 +1,1336 @@ +/* Definitions of target machine for GNU compiler. MC6809 version. + + MC6809 Version by Tom Jones (jones@sal.wisc.edu) @@ -5058,9 +4883,9 @@ index 0000000..386bcc9 +/* Support the ctors and dtors sections for g++. */ + +#undef CTORS_SECTION_ASM_OP -+#define CTORS_SECTION_ASM_OP "\t.area .ctors" ++#define CTORS_SECTION_ASM_OP "\t.area\t.ctors" +#undef DTORS_SECTION_ASM_OP -+#define DTORS_SECTION_ASM_OP "\t.area .dtors" ++#define DTORS_SECTION_ASM_OP "\t.area\t.dtors" + + +#undef DO_GLOBAL_CTORS_BODY @@ -5074,20 +4899,17 @@ index 0000000..386bcc9 + +#define ASM_OUTPUT_ALIGN(FILE,LOG) \ + if ((LOG) > 1) \ -+ fprintf (FILE, "\t.bndry %u\n", 1 << (LOG)) ++ fprintf (FILE, "\t.bndry\t%u\n", 1 << (LOG)) + +/* The .set foo,bar construct doesn't work by default */ +#undef SET_ASM_OP -+#define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2) \ -+ do \ -+ { \ -+ fputc ('\t', FILE); \ -+ assemble_name (FILE, LABEL1); \ -+ fputs (" = ", FILE); \ -+ assemble_name (FILE, LABEL2); \ -+ fputc ('\n', FILE); \ -+ } \ -+ while (0) ++#define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2) \ ++ do { \ ++ assemble_name (FILE, LABEL1); \ ++ fputs ("\tequ\t", FILE); \ ++ assemble_name (FILE, LABEL2); \ ++ fputc ('\n', FILE); \ ++ } while (0) + +/* How to refer to registers in assembler output. + This sequence is indexed by compiler's hard-register-number (see above). */ @@ -5189,7 +5011,7 @@ index 0000000..386bcc9 +/* This is how to output a command to make the user-level label + named NAME defined for reference from other files. */ + -+#define GLOBAL_ASM_OP "\t.globl " ++#define GLOBAL_ASM_OP "\n\t.globl\t" + +/* This is how to output a reference to a user label named NAME. */ +#define ASM_OUTPUT_LABELREF(FILE,NAME) \ @@ -5215,13 +5037,13 @@ index 0000000..386bcc9 + +/* This is how to output an assembler line defining an `int' constant. */ +#define ASM_OUTPUT_INT(FILE,VALUE) \ -+( fprintf (FILE, "\t.word "), \ ++( fprintf (FILE, "\t.word\t"), \ + output_addr_const (FILE, (VALUE)), \ + fprintf (FILE, "\n")) + +/* Likewise for `char' and `short' constants. */ +#define ASM_OUTPUT_SHORT(FILE,VALUE) \ -+( fprintf (FILE, "\t.word "), \ ++( fprintf (FILE, "\t.word\t"), \ + output_addr_const (FILE, (VALUE)), \ + fprintf (FILE, "\n")) + @@ -5243,12 +5065,12 @@ index 0000000..386bcc9 +/* This is how to output an element of a case-vector that is absolute. */ + +#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ -+ fprintf (FILE, "\t.word L%u\n", VALUE) ++ fprintf (FILE, "\t.word\tL%u\n", VALUE) + +/* This is how to output an element of a case-vector that is relative. */ + +#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ -+ fprintf (FILE, "\t.word L%u-L%u\n", VALUE, REL) ++ fprintf (FILE, "\t.word\tL%u-L%u\n", VALUE, REL) + + +/***************************************************************************** @@ -5257,23 +5079,10 @@ index 0000000..386bcc9 +** +*****************************************************************************/ + -+/* ASM_OUTPUT_SKIP is supposed to zero initialize the data. -+ * So use the .byte and .word directives instead of .blkb */ ++/* ASM_OUTPUT_SKIP is supposed to zero initialize the data. */ +#define ASM_OUTPUT_SKIP(FILE,SIZE) \ + do { \ -+ int __size = SIZE; \ -+ while (__size > 0) { \ -+ if (__size >= 2) \ -+ { \ -+ fprintf (FILE, "\t.word\t0\t;skip space %d\n", __size); \ -+ __size -= 2; \ -+ } \ -+ else \ -+ { \ -+ fprintf (FILE, "\t.byte\t0\t;skip space\n"); \ -+ __size--; \ -+ } \ -+ } \ ++ fprintf (FILE, "\tzmb\t%d\t;skip space\n", SIZE); \ + } while (0) + +/* This says how to output an assembler line @@ -5282,7 +5091,7 @@ index 0000000..386bcc9 +#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ + do { \ + switch_to_section (bss_section); \ -+ fputs ("\t.globl\t", FILE); \ ++ fputs ("\n\t.globl\t", FILE); \ + assemble_name ((FILE), (NAME)); \ + fputs ("\n", FILE); \ + assemble_name ((FILE), (NAME)); \ @@ -5331,11 +5140,9 @@ index 0000000..386bcc9 + M6809_BLOCKAGE +}; + -diff --git a/gcc/config/m6809/m6809.md b/gcc/config/m6809/m6809.md -new file mode 100644 -index 0000000..263aa0f ---- /dev/null -+++ b/gcc/config/m6809/m6809.md +diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.md gcc-4.6.4/gcc/config/m6809/m6809.md +--- gcc-4.6.4-clean/gcc/config/m6809/m6809.md 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/gcc/config/m6809/m6809.md 2017-11-29 17:11:09.221248469 -0700 @@ -0,0 +1,2358 @@ +;; GCC machine description for Motorola 6809 +;; Copyright (C) 1989, 2005, 2006, 2007, 2008, @@ -6460,10 +6267,10 @@ index 0000000..263aa0f + if (GET_CODE (operands[2]) == CONST_INT) + { + operands[3] = GEN_INT(INTVAL(operands[2]) & 0xff); -+ return "and%0 %3"; ++ return "and%0\t%3"; + } + -+ return "and%0 %2"; ++ return "and%0\t%2"; +} + [(set_attr "length" "2")]) + @@ -7695,11 +7502,9 @@ index 0000000..263aa0f +;-; vim: set expandtab: +;-; vim: set filetype=lisp: +;;- End: -diff --git a/gcc/config/m6809/m6809.opt b/gcc/config/m6809/m6809.opt -new file mode 100644 -index 0000000..6270917 ---- /dev/null -+++ b/gcc/config/m6809/m6809.opt +diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809.opt gcc-4.6.4/gcc/config/m6809/m6809.opt +--- gcc-4.6.4-clean/gcc/config/m6809/m6809.opt 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/gcc/config/m6809/m6809.opt 2017-11-28 21:12:11.156911596 -0700 @@ -0,0 +1,98 @@ +; Options for the M6809 port of the compiler +; @@ -7799,11 +7604,107 @@ index 0000000..6270917 +Enable stack parameters to a farcall + + -diff --git a/gcc/config/m6809/predicates.md b/gcc/config/m6809/predicates.md -new file mode 100644 -index 0000000..0e257ec ---- /dev/null -+++ b/gcc/config/m6809/predicates.md +diff -urN gcc-4.6.4-clean/gcc/config/m6809/m6809-protos.h gcc-4.6.4/gcc/config/m6809/m6809-protos.h +--- gcc-4.6.4-clean/gcc/config/m6809/m6809-protos.h 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/gcc/config/m6809/m6809-protos.h 2017-11-28 21:12:11.156911596 -0700 +@@ -0,0 +1,94 @@ ++/* GCC for 6809 : machine-specific function prototypes ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#ifndef __M6809_PROTOS_H__ ++#define __M6809_PROTOS_H__ ++ ++void print_options (FILE *file); ++void m6809_cpu_cpp_builtins (void); ++void m6809_override_options (void); ++void m6809_init_builtins (void); ++unsigned int m6809_get_live_regs (void); ++const char * m6809_get_regs_printable (unsigned int regs); ++unsigned int m6809_get_regs_size (unsigned int regs); ++int m6809_function_has_type_attr_p (tree decl, const char *); ++int m6809_current_function_has_type_attr_p (const char *); ++int prologue_epilogue_required (void); ++int noreturn_functionp (rtx x); ++void output_function_prologue (FILE *file, int size); ++void output_function_epilogue (FILE *file, int size); ++int check_float_value (enum machine_mode mode, double *d, int overflow); ++void m6809_asm_named_section (const char *name, unsigned int flags, tree decl); ++void m6809_asm_file_start (void); ++void m6809_output_ascii (FILE *fp, const char *str, unsigned long size); ++void m6809_declare_function_name (FILE *asm_out_file, const char *name, tree decl); ++void m6809_reorg (void); ++int m6809_current_function_is_void (void); ++int m6809_can_merge_pushpop_p (int op, int regs1, int regs2); ++int m6809_function_value_regno_p (unsigned int regno); ++void emit_prologue_insns (void); ++void emit_epilogue_insns (bool); ++void m6809_conditional_register_usage (void); ++void m6809_output_quoted_string (FILE *asm_file, const char *string); ++int m6809_match_peephole2 (unsigned int peephole_id, unsigned int stage); ++int m6809_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode); ++int power_of_two_p (unsigned int n); ++void m6809_do_casesi (rtx index, rtx lower_bound, rtx range, rtx table_label, rtx default_label); ++void m6809_output_addsi3 (int rtx_code, rtx *operands); ++rtx m6809_function_arg_on_stack (CUMULATIVE_ARGS *cump); ++void expand_constant_shift (int code, rtx dst, rtx src, rtx count); ++int m6809_single_operand_operator (rtx exp); ++ ++#ifdef TREE_CODE ++int m6809_init_cumulative_args (CUMULATIVE_ARGS cum, tree fntype, rtx libname); ++#endif /* TREE_CODE */ ++ ++#ifdef RTX_CODE ++void print_direct_prefix (FILE *file, rtx addr); ++void print_operand (FILE *file, rtx x, int code); ++void print_operand_address (FILE *file, rtx addr); ++void notice_update_cc (rtx exp, rtx insn); ++enum reg_class m6809_preferred_reload_class (rtx x, enum reg_class regclass); ++rtx gen_rtx_const_high (rtx r); ++rtx gen_rtx_const_low (rtx r); ++rtx gen_rtx_register_pushpop (int pop_flag, int regs); ++void emit_libcall_insns (enum machine_mode mode, const char *name, rtx *operands, int count); ++const char * output_branch_insn (enum rtx_code code, rtx *operands, int length); ++void output_far_call_insn (rtx *operands, int has_return); ++void m6809_initialize_trampoline (rtx tramp, tree fndecl, rtx cxt); ++rtx m6809_expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, int ignore); ++const char * far_functionp (rtx x); ++rtx m6809_function_value (const tree valtype, const tree func); ++void m6809_output_shift_insn (int rtx_code, rtx *operands); ++ ++const char * m6809_get_decl_bank (tree decl); ++void output_branch_insn1 (const char *opcode, rtx *operands, int long_p); ++rtx m6809_builtin_operand (tree arglist, enum machine_mode mode, int opnum); ++const char * far_function_type_p (tree type); ++void m6809_asm_trampoline_template(FILE *f); ++bool m6809_frame_pointer_required (void); ++int m6809_can_eliminate (int from, int to); ++int m6809_initial_elimination_offset (int from, int to); ++void m6809_emit_move_insn (rtx dst, rtx src); ++void m6809_split_shift (enum rtx_code code, rtx *operands); ++bool m6809_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED); ++ ++ ++#endif /* RTX_CODE */ ++ ++#endif /* __M6809_PROTOS_H__ */ +diff -urN gcc-4.6.4-clean/gcc/config/m6809/predicates.md gcc-4.6.4/gcc/config/m6809/predicates.md +--- gcc-4.6.4-clean/gcc/config/m6809/predicates.md 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/gcc/config/m6809/predicates.md 2017-11-28 21:12:11.156911596 -0700 @@ -0,0 +1,78 @@ +;; Predicate definitions for Motorola 6809 +;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @@ -7883,23 +7784,19 @@ index 0000000..0e257ec + +(define_predicate "symbolic_operand" (match_code "symbol_ref")) + -diff --git a/gcc/config/m6809/t-coco b/gcc/config/m6809/t-coco -new file mode 100644 -index 0000000..b1fa507 ---- /dev/null -+++ b/gcc/config/m6809/t-coco +diff -urN gcc-4.6.4-clean/gcc/config/m6809/t-coco gcc-4.6.4/gcc/config/m6809/t-coco +--- gcc-4.6.4-clean/gcc/config/m6809/t-coco 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/gcc/config/m6809/t-coco 2017-11-29 17:11:09.221248469 -0700 @@ -0,0 +1,6 @@ +# For a few minor differences in code generation on the CoCo... +T_CFLAGS = -DTARGET_COCO + +# For doing the startup differently on the CoCo... -+CRT0STUFF_T_CFLAGS += -Wa,--globalize-symbols -DTARGET_COCO ++CRT0STUFF_T_CFLAGS += -DTARGET_COCO +# vim: set filetype=make: -diff --git a/gcc/config/m6809/t-m6809 b/gcc/config/m6809/t-m6809 -new file mode 100644 -index 0000000..2b38a8f ---- /dev/null -+++ b/gcc/config/m6809/t-m6809 +diff -urN gcc-4.6.4-clean/gcc/config/m6809/t-m6809 gcc-4.6.4/gcc/config/m6809/t-m6809 +--- gcc-4.6.4-clean/gcc/config/m6809/t-m6809 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/gcc/config/m6809/t-m6809 2017-11-28 21:12:11.156911596 -0700 @@ -0,0 +1,64 @@ + +# ranlib doesn't exist, so define it to 'true' to make it a no-op @@ -7965,18 +7862,54 @@ index 0000000..2b38a8f + +$(T)mcrt0.o: $(MCRT0_S) $(GCC_PASSES) + $(GCC_FOR_TARGET) $(CRT0STUFF_T_CFLAGS) $(MULTILIB_CFLAGS) -c -o $(T)mcrt0.o -x assembler-with-cpp $(MCRT0_S) -diff --git a/gcc/config/m6809/t-sim b/gcc/config/m6809/t-sim -new file mode 100644 -index 0000000..cd3b094 ---- /dev/null -+++ b/gcc/config/m6809/t-sim +diff -urN gcc-4.6.4-clean/gcc/config/m6809/t-proto gcc-4.6.4/gcc/config/m6809/t-proto +--- gcc-4.6.4-clean/gcc/config/m6809/t-proto 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/gcc/config/m6809/t-proto 2017-11-29 17:11:09.221248469 -0700 +@@ -0,0 +1,6 @@ ++# For a few minor differences in code generation on a custom prototype. ++T_CFLAGS = -DTARGET_PROTO ++ ++# For doing the startup differently on a custom prototype. ++CRT0STUFF_T_CFLAGS += -DTARGET_PROTO ++# vim: set filetype=make: +diff -urN gcc-4.6.4-clean/gcc/config/m6809/t-sim gcc-4.6.4/gcc/config/m6809/t-sim +--- gcc-4.6.4-clean/gcc/config/m6809/t-sim 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/gcc/config/m6809/t-sim 2017-11-28 21:12:11.156911596 -0700 @@ -0,0 +1 @@ +CRT0STUFF_T_CFLAGS += -DTARGET_SIM -diff --git a/gcc/gcse.c b/gcc/gcse.c -index 27f7e8f..1079c6f 100644 ---- a/gcc/gcse.c -+++ b/gcc/gcse.c -@@ -833,7 +833,6 @@ want_to_gcse_p (rtx x, int *max_distance_ptr) +diff -urN gcc-4.6.4-clean/gcc/config.gcc gcc-4.6.4/gcc/config.gcc +--- gcc-4.6.4-clean/gcc/config.gcc 2013-03-06 10:40:07.000000000 -0700 ++++ gcc-4.6.4/gcc/config.gcc 2017-11-29 17:11:09.229248437 -0700 +@@ -375,6 +375,9 @@ + cpu_type=m32r + extra_options="${extra_options} g.opt" + ;; ++m6809-*-*) ++ cpu_type=m6809 ++ ;; + m68k-*-*) + extra_headers=math-68881.h + ;; +@@ -1706,6 +1709,15 @@ + thread_file='posix' + fi + ;; ++m6809-coco-*) ++ tmake_file="${tmake_file} m6809/t-m6809 m6809/t-coco" ++ ;; ++m6809-proto-*) ++ tmake_file="${tmake_file} m6809/t-m6809 m6809/t-proto" ++ ;; ++m6809-*-*) ++ tmake_file="${tmake_file} m6809/t-m6809 m6809/t-sim" ++ ;; + # m68hc11 and m68hc12 share the same machine description. + m68hc11-*-*|m6811-*-*) + tm_file="dbxelf.h elfos.h usegas.h newlib-stdint.h m68hc11/m68hc11.h" +diff -urN gcc-4.6.4-clean/gcc/gcse.c gcc-4.6.4/gcc/gcse.c +--- gcc-4.6.4-clean/gcc/gcse.c 2011-02-02 23:04:04.000000000 -0700 ++++ gcc-4.6.4/gcc/gcse.c 2017-11-28 21:12:11.156911596 -0700 +@@ -833,7 +833,6 @@ max_distance = (GCSE_COST_DISTANCE_RATIO * cost) / 10; if (max_distance == 0) return 0; @@ -7984,11 +7917,10 @@ index 27f7e8f..1079c6f 100644 gcc_assert (max_distance > 0); } else -diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c -index 78d53f0..b5b8c84 100644 ---- a/gcc/libgcc2.c -+++ b/gcc/libgcc2.c -@@ -485,6 +485,7 @@ __ashrdi3 (DWtype u, shift_count_type b) +diff -urN gcc-4.6.4-clean/gcc/libgcc2.c gcc-4.6.4/gcc/libgcc2.c +--- gcc-4.6.4-clean/gcc/libgcc2.c 2011-01-03 13:52:22.000000000 -0700 ++++ gcc-4.6.4/gcc/libgcc2.c 2017-11-28 21:12:11.156911596 -0700 +@@ -485,6 +485,7 @@ #endif #ifdef L_bswapsi2 @@ -7996,7 +7928,7 @@ index 78d53f0..b5b8c84 100644 SItype __bswapsi2 (SItype u) { -@@ -494,7 +495,9 @@ __bswapsi2 (SItype u) +@@ -494,7 +495,9 @@ | (((u) & 0x000000ff) << 24)); } #endif @@ -8006,7 +7938,7 @@ index 78d53f0..b5b8c84 100644 DItype __bswapdi2 (DItype u) { -@@ -508,6 +511,7 @@ __bswapdi2 (DItype u) +@@ -508,6 +511,7 @@ | (((u) & 0x00000000000000ffull) << 56)); } #endif @@ -8014,7 +7946,7 @@ index 78d53f0..b5b8c84 100644 #ifdef L_ffssi2 #undef int int -@@ -1280,7 +1284,7 @@ __fixdfdi (DFtype a) +@@ -1280,7 +1284,7 @@ UDWtype __fixunssfDI (SFtype a) { @@ -8023,7 +7955,7 @@ index 78d53f0..b5b8c84 100644 /* Convert the SFtype to a DFtype, because that is surely not going to lose any bits. Some day someone else can write a faster version that avoids converting to DFtype, and verify it really works right. */ -@@ -1298,7 +1302,7 @@ __fixunssfDI (SFtype a) +@@ -1298,7 +1302,7 @@ /* Assemble result from the two parts. */ return ((UDWtype) hi << W_TYPE_SIZE) | lo; @@ -8032,7 +7964,7 @@ index 78d53f0..b5b8c84 100644 if (a < 1) return 0; if (a < Wtype_MAXp1_F) -@@ -1334,8 +1338,6 @@ __fixunssfDI (SFtype a) +@@ -1334,8 +1338,6 @@ return (DWtype)counter << shift; } return -1; @@ -8041,11 +7973,10 @@ index 78d53f0..b5b8c84 100644 #endif } #endif -diff --git a/gcc/longlong.h b/gcc/longlong.h -index acb3185..20dd0ef 100644 ---- a/gcc/longlong.h -+++ b/gcc/longlong.h -@@ -528,6 +528,11 @@ UDItype __umulsidi3 (USItype, USItype); +diff -urN gcc-4.6.4-clean/gcc/longlong.h gcc-4.6.4/gcc/longlong.h +--- gcc-4.6.4-clean/gcc/longlong.h 2011-10-04 01:28:50.000000000 -0600 ++++ gcc-4.6.4/gcc/longlong.h 2017-11-28 21:12:11.160911575 -0700 +@@ -528,6 +528,11 @@ : "cbit") #endif /* __M32R__ */ @@ -8057,11 +7988,32 @@ index acb3185..20dd0ef 100644 #if defined (__mc68000__) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ __asm__ ("add%.l %5,%1\n\taddx%.l %3,%0" \ -diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk -index c3f6c04..63936c0 100644 ---- a/gcc/opth-gen.awk -+++ b/gcc/opth-gen.awk -@@ -121,7 +121,7 @@ BEGIN { +diff -urN gcc-4.6.4-clean/gcc/Makefile.in gcc-4.6.4/gcc/Makefile.in +--- gcc-4.6.4-clean/gcc/Makefile.in 2013-04-01 02:32:34.000000000 -0600 ++++ gcc-4.6.4/gcc/Makefile.in 2017-11-28 21:12:11.160911575 -0700 +@@ -2003,14 +2003,14 @@ + + # Compile the start modules crt0.o and mcrt0.o that are linked with + # every program +-$(T)crt0.o: s-crt0 ; @true +-$(T)mcrt0.o: s-crt0; @true ++crt0.o: s-crt0 ; @true ++mcrt0.o: s-crt0; @true + + s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \ +- -o $(T)crt0.o -c $(CRT0_S) ++ -o crt0.o -c $(CRT0_S) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \ +- -o $(T)mcrt0.o -c $(MCRT0_S) ++ -o mcrt0.o -c $(MCRT0_S) + $(STAMP) s-crt0 + # + # Compiling object files from source files. +diff -urN gcc-4.6.4-clean/gcc/opth-gen.awk gcc-4.6.4/gcc/opth-gen.awk +--- gcc-4.6.4-clean/gcc/opth-gen.awk 2011-02-08 10:41:00.000000000 -0700 ++++ gcc-4.6.4/gcc/opth-gen.awk 2017-11-28 21:12:11.160911575 -0700 +@@ -121,7 +121,7 @@ END { print "/* This file is auto-generated by opth-gen.awk. */" print "" @@ -8070,7 +8022,7 @@ index c3f6c04..63936c0 100644 print "#define OPTIONS_H" print "" print "#include \"flag-types.h\"" -@@ -432,18 +432,9 @@ print "" +@@ -432,18 +432,9 @@ for (i = 0; i < n_opts; i++) { opt = opt_args("InverseMask", flags[i]) @@ -8092,11 +8044,10 @@ index c3f6c04..63936c0 100644 } print "" -diff --git a/gcc/tree.h b/gcc/tree.h -index ece68b4..d0ec9d6 100644 ---- a/gcc/tree.h -+++ b/gcc/tree.h -@@ -3563,6 +3563,8 @@ enum tree_index +diff -urN gcc-4.6.4-clean/gcc/tree.h gcc-4.6.4/gcc/tree.h +--- gcc-4.6.4-clean/gcc/tree.h 2011-10-06 13:57:52.000000000 -0600 ++++ gcc-4.6.4/gcc/tree.h 2017-11-28 21:12:11.160911575 -0700 +@@ -3563,6 +3563,8 @@ TI_UINTDI_TYPE, TI_UINTTI_TYPE, @@ -8105,11 +8056,10 @@ index ece68b4..d0ec9d6 100644 TI_UINT32_TYPE, TI_UINT64_TYPE, -diff --git a/gcc/version.c b/gcc/version.c -index 9744449..1a1e7e0 100644 ---- a/gcc/version.c -+++ b/gcc/version.c -@@ -21,16 +21,16 @@ along with GCC; see the file COPYING3. If not see +diff -urN gcc-4.6.4-clean/gcc/version.c gcc-4.6.4/gcc/version.c +--- gcc-4.6.4-clean/gcc/version.c 2009-04-21 13:03:23.000000000 -0600 ++++ gcc-4.6.4/gcc/version.c 2017-11-29 17:11:34.133149157 -0700 +@@ -21,16 +21,16 @@ /* This is the location of the online document giving instructions for reporting bugs. If you distribute a modified version of GCC, @@ -8130,13 +8080,36 @@ index 9744449..1a1e7e0 100644 Makefile. */ -const char version_string[] = BASEVER DATESTAMP DEVPHASE REVISION; -+const char version_string[] = BASEVER DATESTAMP DEVPHASE REVISION " (gcc6809lw pl6)"; ++const char version_string[] = BASEVER DATESTAMP DEVPHASE REVISION " (gcc6809lw pl9)"; const char pkgversion_string[] = PKGVERSION; -diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index b57aeb6..940c286 100644 ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -374,8 +374,8 @@ endif +diff -urN gcc-4.6.4-clean/libgcc/config.host gcc-4.6.4/libgcc/config.host +--- gcc-4.6.4-clean/libgcc/config.host 2011-11-23 15:15:54.000000000 -0700 ++++ gcc-4.6.4/libgcc/config.host 2017-11-28 21:12:11.160911575 -0700 +@@ -371,6 +371,8 @@ + ;; + m32rle-*-linux*) + ;; ++m6809*) ++ ;; + m68hc11-*-*|m6811-*-*) + ;; + m68hc12-*-*|m6812-*-*) +diff -urN gcc-4.6.4-clean/libgcc/fixed-obj.mk gcc-4.6.4/libgcc/fixed-obj.mk +--- gcc-4.6.4-clean/libgcc/fixed-obj.mk 2007-09-17 16:18:13.000000000 -0600 ++++ gcc-4.6.4/libgcc/fixed-obj.mk 2017-11-28 21:12:11.160911575 -0700 +@@ -23,7 +23,7 @@ + #$(info $o$(objext): -DL$($o-label) $($o-opt)) + + $o$(objext): %$(objext): $(gcc_srcdir)/config/fixed-bit.c +- $(gcc_compile) -DL$($*-label) $($*-opt) -c $(gcc_srcdir)/config/fixed-bit.c $(vis_hide) ++ $(gcc_compile) -DL$($*-label) $($*-opt) -c $(gcc_srcdir)/config/fixed-bit.c $(vis_hide) -save-temps + + ifeq ($(enable_shared),yes) + $(o)_s$(objext): %_s$(objext): $(gcc_srcdir)/config/fixed-bit.c +diff -urN gcc-4.6.4-clean/libgcc/Makefile.in gcc-4.6.4/libgcc/Makefile.in +--- gcc-4.6.4-clean/libgcc/Makefile.in 2012-12-04 12:11:33.000000000 -0700 ++++ gcc-4.6.4/libgcc/Makefile.in 2017-11-28 21:12:11.160911575 -0700 +@@ -374,8 +374,8 @@ # Build lib2funcs. For the static library also include LIB2FUNCS_ST. lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST)) $(lib2funcs-o): %$(objext): $(gcc_srcdir)/libgcc2.c @@ -8147,7 +8120,7 @@ index b57aeb6..940c286 100644 libgcc-objects += $(lib2funcs-o) ifeq ($(enable_shared),yes) -@@ -410,8 +410,9 @@ endif +@@ -410,8 +410,9 @@ # Build LIB2_DIVMOD_FUNCS. lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS)) $(lib2-divmod-o): %$(objext): $(gcc_srcdir)/libgcc2.c @@ -8159,7 +8132,7 @@ index b57aeb6..940c286 100644 libgcc-objects += $(lib2-divmod-o) ifeq ($(enable_shared),yes) -@@ -443,7 +444,8 @@ endif +@@ -443,7 +444,8 @@ ifneq ($(FPBIT),) fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS)) $(fpbit-o): %$(objext): $(FPBIT) @@ -8169,7 +8142,7 @@ index b57aeb6..940c286 100644 libgcc-objects += $(fpbit-o) ifeq ($(enable_shared),yes) -@@ -458,7 +460,8 @@ endif +@@ -458,7 +460,8 @@ ifneq ($(DPBIT),) dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS)) $(dpbit-o): %$(objext): $(DPBIT) @@ -8179,67 +8152,21 @@ index b57aeb6..940c286 100644 libgcc-objects += $(dpbit-o) ifeq ($(enable_shared),yes) -diff --git a/libgcc/config.host b/libgcc/config.host -index 25e949e..7154892 100644 ---- a/libgcc/config.host -+++ b/libgcc/config.host -@@ -371,6 +371,8 @@ m32r-*-linux*) - ;; - m32rle-*-linux*) - ;; -+m6809*) -+ ;; - m68hc11-*-*|m6811-*-*) - ;; - m68hc12-*-*|m6812-*-*) -diff --git a/libgcc/fixed-obj.mk b/libgcc/fixed-obj.mk -index 3c7c2f3..eb3aa3a 100644 ---- a/libgcc/fixed-obj.mk -+++ b/libgcc/fixed-obj.mk -@@ -23,7 +23,7 @@ endif - #$(info $o$(objext): -DL$($o-label) $($o-opt)) - - $o$(objext): %$(objext): $(gcc_srcdir)/config/fixed-bit.c -- $(gcc_compile) -DL$($*-label) $($*-opt) -c $(gcc_srcdir)/config/fixed-bit.c $(vis_hide) -+ $(gcc_compile) -DL$($*-label) $($*-opt) -c $(gcc_srcdir)/config/fixed-bit.c $(vis_hide) -save-temps - - ifeq ($(enable_shared),yes) - $(o)_s$(objext): %_s$(objext): $(gcc_srcdir)/config/fixed-bit.c --- -2.7.0 - - -From 696169dbc7af549e249c5122554a1ced664bb980 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Sun, 15 Jan 2017 21:34:56 +0100 -Subject: Fix build with gcc5. - -From -https://github.com/DragonFlyBSD/DPorts/commit/a680cc6ef758e2f15be8bf8209da51658e02d710 - -diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h -index 62cdfab..6bbc8c9 100644 ---- a/gcc/cp/cfns.h -+++ b/gcc/cp/cfns.h -@@ -53,6 +53,9 @@ __inline - static unsigned int hash (const char *, unsigned int); - #ifdef __GNUC__ - __inline -+#ifdef __GNUC_STDC_INLINE__ -+__attribute__ ((__gnu_inline__)) -+#endif - #endif - const char * libc_name_p (const char *, unsigned int); - /* maximum key range = 391, duplicates = 0 */ -@@ -96,7 +99,7 @@ hash (register const char *str, register unsigned int len) - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400 - }; -- register int hval = len; -+ register int hval = (int) len; - - switch (hval) - { --- -2.7.0 - +diff -urN gcc-4.6.4-clean/README.LW gcc-4.6.4/README.LW +--- gcc-4.6.4-clean/README.LW 1969-12-31 17:00:00.000000000 -0700 ++++ gcc-4.6.4/README.LW 2017-11-29 17:11:09.189248596 -0700 +@@ -0,0 +1,14 @@ ++This is a port of gcc6809 which is designed to work with the lwtools ++cross-assembler and linker package. You will need several scripts from that ++package, available at http://lost.l-w.ca/coco/lwtools/, in order to use ++this. Instructions for building are present in the lwtools package. ++ ++This work is based extensively on the gcc6809 4.3.4-3 release by Brian ++Dominy (brian@oddchange.com) with some significant renovations to make it ++work with gcc 4.6.4. ++ ++There is no guarantee that it will work for any particular purpose you ++choose to put it to. ++ ++If you run into any problems, contact William Astle (lost@l-w.ca). DO NOT ++contact the main GCC developers!