[packages/crossavr-gcc] - up to 15.2.0
baggins
baggins at pld-linux.org
Mon Apr 6 16:16:42 CEST 2026
commit c05f3826462966c76cebee573dec92d9ebb99697
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Mon Apr 6 17:16:27 2026 +0200
- up to 15.2.0
000-gcc-PR50293.patch | 89 --
300-gcc-xmega-support.patch | 171 ---
301-gcc-tiny-support.patch | 1970 -----------------------------
302-gcc-mlist-devices.patch | 59 -
303-ata6289-architecture-correction.patch | 38 -
400-gcc-public-devices-support.patch | 222 ----
401-gcc-non-public-devices-support.patch | 110 --
402-gcc-atmega64_128_2564RFR2.patch | 27 -
403-gcc-atmxts200.patch | 11 -
501-gcc-avrtc579.patch | 304 -----
502-gcc-pr54796.patch | 139 --
503-gcc-avrtc-513.patch | 63 -
504-gcc-avrtc-610.patch | 13 -
505-gcc-avrtc586.patch | 67 -
crossavr-gcc.spec | 76 +-
gnu_inline-mismatch.patch | 69 -
16 files changed, 32 insertions(+), 3396 deletions(-)
---
diff --git a/crossavr-gcc.spec b/crossavr-gcc.spec
index 1994955..6da7383 100644
--- a/crossavr-gcc.spec
+++ b/crossavr-gcc.spec
@@ -9,29 +9,13 @@ Summary(pl.UTF-8): Skrośne narzędzia programistyczne GNU dla AVR - gcc
Summary(pt_BR.UTF-8): Utilitários para desenvolvimento de binários da GNU - AVR gcc
Summary(tr.UTF-8): GNU geliştirme araçları - AVR gcc
Name: crossavr-gcc
-Version: 4.7.3
-Release: 4
+Version: 15.2.0
+Release: 0.1
Epoch: 1
License: GPL v3+
Group: Development/Languages
-Source0: http://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2
-# Source0-md5: 86f428a30379bdee0224e353ee2f999e
-Patch0: gnu_inline-mismatch.patch
-# Patches 1xx are taken form Atmel official AVR8-GNU toolchain version 3.4.2
-# http://distribute.atmel.no/tools/opensource/Atmel-AVR-Toolchain-3.4.2/avr/avr-patches.tar.gz
-Patch100: 300-gcc-xmega-support.patch
-Patch101: 301-gcc-tiny-support.patch
-Patch102: 302-gcc-mlist-devices.patch
-Patch103: 303-ata6289-architecture-correction.patch
-Patch104: 400-gcc-public-devices-support.patch
-Patch105: 401-gcc-non-public-devices-support.patch
-Patch106: 402-gcc-atmega64_128_2564RFR2.patch
-Patch107: 403-gcc-atmxts200.patch
-Patch108: 501-gcc-avrtc579.patch
-Patch109: 502-gcc-pr54796.patch
-Patch110: 503-gcc-avrtc-513.patch
-Patch111: 504-gcc-avrtc-610.patch
-Patch112: 505-gcc-avrtc586.patch
+Source0: https://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.xz
+# Source0-md5: b861b092bf1af683c46a8aa2e689a6fd
URL: http://gcc.gnu.org/
BuildRequires: /bin/bash
BuildRequires: autoconf
@@ -47,11 +31,11 @@ BuildRequires: perl-tools-pod
BuildRequires: ppl-devel >= 0.11
BuildRequires: rpmbuild(macros) >= 1.565
BuildRequires: sed >= 4.0
+Requires: cloog-ppl-libs >= 0.16.1
Requires: crossavr-binutils >= 2.23.1
%{!?with_bootstrap:Requires: crossavr-libc}
-Requires: cloog-ppl-libs >= 0.16.1
-Requires: gmp >= 4.3.2
Requires: gcc-dirs
+Requires: gmp >= 4.3.2
Requires: libmpc >= 0.8.0
Requires: mpfr >= 2.4.2
Requires: ppl >= 0.11
@@ -68,6 +52,8 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
# receiving non constant format strings
%define Werror_cflags %{nil}
+%define skip_post_check_so lib.*plugin.so.*
+
%description
This package contains a cross-gcc which allows the creation of
binaries to be run on Atmel AVR on other machines.
@@ -94,21 +80,6 @@ Ten pakiet dodaje obsługę C++ do kompilatora gcc dla AVR.
%prep
%setup -q -n gcc-%{version}
-cd gcc/config/%{target} && %undos -f c,h && cd -
-%patch -P0 -p1
-%patch -P100 -p0
-#patch101 -p0
-%patch -P102 -p0
-%patch -P103 -p0
-#patch104 -p0
-#patch105 -p0
-#patch106 -p0
-#patch107 -p0
-#patch108 -p0
-%patch -P109 -p0
-#patch110 -p0
-%patch -P111 -p0
-#patch112 -p0
%build
rm -rf obj-%{target}
@@ -153,11 +124,7 @@ rm -rf $RPM_BUILD_ROOT
%{__make} -C obj-%{target} install \
DESTDIR=$RPM_BUILD_ROOT
-# move fixed includes to proper place
-cp -p $RPM_BUILD_ROOT%{gcclibdir}/include-fixed/{limits,syslimits}.h $RPM_BUILD_ROOT%{gcclibdir}/include
-
# don't want it here
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
%{__rm} $RPM_BUILD_ROOT%{_mandir}/man7/{fsf-funding,gfdl,gpl}.7
%{__rm} -r $RPM_BUILD_ROOT%{_infodir}
%{__rm} -r $RPM_BUILD_ROOT%{_localedir}
@@ -173,22 +140,29 @@ cp -p $RPM_BUILD_ROOT%{gcclibdir}/include-fixed/{limits,syslimits}.h $RPM_BUILD_
%clean
rm -rf $RPM_BUILD_ROOT
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
%files
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/%{target}-cpp
%attr(755,root,root) %{_bindir}/%{target}-gcc
-%attr(755,root,root) %{_bindir}/%{target}-gcc-%{version}
%attr(755,root,root) %{_bindir}/%{target}-gcc-ar
%attr(755,root,root) %{_bindir}/%{target}-gcc-nm
%attr(755,root,root) %{_bindir}/%{target}-gcc-ranlib
+%attr(755,root,root) %{_bindir}/%{target}-gcc-%{version}
%attr(755,root,root) %{_bindir}/%{target}-gcov
+%attr(755,root,root) %{_bindir}/%{target}-gcov-dump
+%attr(755,root,root) %{_bindir}/%{target}-gcov-tool
+%attr(755,root,root) %{_bindir}/%{target}-lto-dump
%dir %{gccarchdir}
%dir %{gcclibdir}
%attr(755,root,root) %{gcclibdir}/cc1
%attr(755,root,root) %{gcclibdir}/collect2
%attr(755,root,root) %{gcclibdir}/lto-wrapper
%attr(755,root,root) %{gcclibdir}/lto1
-%attr(755,root,root) %{gcclibdir}/liblto_plugin.so*
+%{gcclibdir}/liblto_plugin.so*
+%attr(755,root,root) %{gcclibdir}/g++-mapper-server
%{gcclibdir}/libgcc.a
%{gcclibdir}/libgcov.a
# subtargets
@@ -200,33 +174,47 @@ rm -rf $RPM_BUILD_ROOT
%{gcclibdir}/avr5
%{gcclibdir}/avr51
%{gcclibdir}/avr6
+%{gcclibdir}/avrtiny
%{gcclibdir}/avrxmega2
+%{gcclibdir}/avrxmega3
%{gcclibdir}/avrxmega4
%{gcclibdir}/avrxmega5
%{gcclibdir}/avrxmega6
%{gcclibdir}/avrxmega7
+%{gcclibdir}/double64
+%{gcclibdir}/long-double32
%{gcclibdir}/tiny-stack
+%{gcclibdir}/device-specs
%dir %{gcclibdir}/include
%{gcclibdir}/include/float.h
+%{gcclibdir}/include/gcov.h
%{gcclibdir}/include/iso646.h
%{gcclibdir}/include/limits.h
%{gcclibdir}/include/stdalign.h
%{gcclibdir}/include/stdarg.h
+%{gcclibdir}/include/stdatomic.h
%{gcclibdir}/include/stdbool.h
+%{gcclibdir}/include/stdckdint.h
%{gcclibdir}/include/stddef.h
+%{gcclibdir}/include/stdfix-gcc.h
%{gcclibdir}/include/stdfix.h
%{gcclibdir}/include/stdint-gcc.h
%{gcclibdir}/include/stdint.h
%{gcclibdir}/include/stdnoreturn.h
%{gcclibdir}/include/syslimits.h
-%{gcclibdir}/include/tgmath.h
%{gcclibdir}/include/unwind.h
%{gcclibdir}/include/varargs.h
# plugin-devel
%{gcclibdir}/plugin
+%{_libdir}/libcc1.so
+%ghost %{_libdir}/libcc1.so.0
+%{_libdir}/libcc1.so.*.*.*
%{_mandir}/man1/%{target}-cpp.1*
%{_mandir}/man1/%{target}-gcc.1*
%{_mandir}/man1/%{target}-gcov.1*
+%{_mandir}/man1/%{target}-gcov-dump.1*
+%{_mandir}/man1/%{target}-gcov-tool.1*
+%{_mandir}/man1/%{target}-lto-dump.1*
%files c++
%defattr(644,root,root,755)
diff --git a/000-gcc-PR50293.patch b/000-gcc-PR50293.patch
deleted file mode 100644
index 071f5c7..0000000
--- a/000-gcc-PR50293.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-diff -Naurp gcc/gcc.c gcc/gcc.c
---- gcc/gcc.c 2012-08-06 20:04:27.000000000 +0530
-+++ gcc/gcc.c 2013-03-21 12:13:51.000000000 +0530
-@@ -267,6 +267,7 @@ static const char *compare_debug_dump_op
- static const char *compare_debug_self_opt_spec_function (int, const char **);
- static const char *compare_debug_auxbase_opt_spec_function (int, const char **);
- static const char *pass_through_libs_spec_func (int, const char **);
-+static char *convert_white_space (char *);
-
- /* The Specs Language
-
-@@ -6475,6 +6476,7 @@ main (int argc, char **argv)
- X_OK, false);
- if (lto_wrapper_file)
- {
-+ lto_wrapper_file = convert_white_space (lto_wrapper_file);
- lto_wrapper_spec = lto_wrapper_file;
- obstack_init (&collect_obstack);
- obstack_grow (&collect_obstack, "COLLECT_LTO_WRAPPER=",
-@@ -6876,12 +6878,13 @@ warranty; not even for MERCHANTABILITY o
- + strlen (fuse_linker_plugin), 0))
- #endif
- {
-- linker_plugin_file_spec = find_a_file (&exec_prefixes,
-- LTOPLUGINSONAME, R_OK,
-- false);
-- if (!linker_plugin_file_spec)
-+ char *temp_spec = find_a_file (&exec_prefixes,
-+ LTOPLUGINSONAME, R_OK,
-+ false);
-+ if (!temp_spec)
- fatal_error ("-fuse-linker-plugin, but %s not found",
- LTOPLUGINSONAME);
-+ linker_plugin_file_spec = convert_white_space (temp_spec);
- }
- #endif
- lto_gcc_spec = argv[0];
-@@ -8318,3 +8321,51 @@ pass_through_libs_spec_func (int argc, c
- }
- return prepended;
- }
-+
-+/* Insert backslash before spaces in ORIG (usually a file path), to
-+ avoid being broken by spec parser.
-+
-+ This function is needed as do_spec_1 treats white space (' ' and '\t')
-+ as the end of an argument. But in case of -plugin /usr/gcc install/xxx.so,
-+ the file name should be treated as a single argument rather than being
-+ broken into multiple. Solution is to insert '\\' before the space in a
-+ file name.
-+
-+ This function converts and only converts all occurrence of ' '
-+ to '\\' + ' ' and '\t' to '\\' + '\t'. For example:
-+ "a b" -> "a\\ b"
-+ "a b" -> "a\\ \\ b"
-+ "a\tb" -> "a\\\tb"
-+ "a\\ b" -> "a\\\\ b"
-+
-+ orig: input null-terminating string that was allocated by xalloc. The
-+ memory it points to might be freed in this function. Behavior undefined
-+ if ORIG wasn't xalloced or was freed already at entry.
-+
-+ Return: ORIG if no conversion needed. Otherwise a newly allocated string
-+ that was converted from ORIG. */
-+
-+static char *
-+convert_white_space (char *orig)
-+{
-+ int len, number_of_space = 0;
-+
-+ for (len = 0; orig[len]; len++)
-+ if (orig[len] == ' ' || orig[len] == '\t') number_of_space++;
-+
-+ if (number_of_space)
-+ {
-+ char *new_spec = (char *) xmalloc (len + number_of_space + 1);
-+ int j, k;
-+ for (j = 0, k = 0; j <= len; j++, k++)
-+ {
-+ if (orig[j] == ' ' || orig[j] == '\t')
-+ new_spec[k++] = '\\';
-+ new_spec[k] = orig[j];
-+ }
-+ free (orig);
-+ return new_spec;
-+ }
-+ else
-+ return orig;
-+}
diff --git a/300-gcc-xmega-support.patch b/300-gcc-xmega-support.patch
deleted file mode 100644
index fadfbae..0000000
--- a/300-gcc-xmega-support.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
---- gcc/config/avr/avr.c 2012-09-04 15:08:42.000000000 +0530
-+++ gcc/config/avr/avr.c 2012-11-09 19:01:17.000000000 +0530
-@@ -490,6 +490,15 @@ avr_interrupt_function_p (tree func)
- return avr_lookup_function_attribute1 (func, "interrupt");
- }
-
-+/* Return nonzero if FUNC is an nmi function as specified
-+ by the "nmi" attribute. */
-+
-+static int
-+avr_nmi_function_p (tree func)
-+{
-+ return avr_lookup_function_attribute1 (func, "nmi");
-+}
-+
- /* Return nonzero if FUNC is a signal function as specified
- by the "signal" attribute. */
-
-@@ -536,15 +545,22 @@ avr_set_current_function (tree decl)
- cfun->machine->is_naked = avr_naked_function_p (decl);
- cfun->machine->is_signal = avr_signal_function_p (decl);
- cfun->machine->is_interrupt = avr_interrupt_function_p (decl);
-+ cfun->machine->is_nmi = avr_nmi_function_p (decl);
- cfun->machine->is_OS_task = avr_OS_task_function_p (decl);
- cfun->machine->is_OS_main = avr_OS_main_function_p (decl);
-
-- isr = cfun->machine->is_interrupt ? "interrupt" : "signal";
-+ if (cfun->machine->is_interrupt)
-+ isr = "interrupt";
-+ else if (cfun->machine->is_nmi)
-+ isr = "nmi";
-+ else
-+ isr = "signal";
-
- /* Too much attributes make no sense as they request conflicting features. */
-
- if (cfun->machine->is_OS_task + cfun->machine->is_OS_main
-- + (cfun->machine->is_signal || cfun->machine->is_interrupt) > 1)
-+ + (cfun->machine->is_signal || cfun->machine->is_interrupt
-+ || cfun->machine->is_nmi) > 1)
- error_at (loc, "function attributes %qs, %qs and %qs are mutually"
- " exclusive", "OS_task", "OS_main", isr);
-
-@@ -555,7 +571,8 @@ avr_set_current_function (tree decl)
- warning_at (loc, OPT_Wattributes, "function attributes %qs and %qs have"
- " no effect on %qs function", "OS_task", "OS_main", "naked");
-
-- if (cfun->machine->is_interrupt || cfun->machine->is_signal)
-+ if (cfun->machine->is_interrupt || cfun->machine->is_signal
-+ || cfun->machine->is_nmi)
- {
- tree args = TYPE_ARG_TYPES (TREE_TYPE (decl));
- tree ret = TREE_TYPE (TREE_TYPE (decl));
-@@ -6827,6 +6844,8 @@ avr_attribute_table[] =
- false },
- { "interrupt", 0, 0, true, false, false, avr_handle_fndecl_attribute,
- false },
-+ { "nmi", 0, 0, true, false, false, avr_handle_fndecl_attribute,
-+ false },
- { "naked", 0, 0, false, true, true, avr_handle_fntype_attribute,
- false },
- { "OS_task", 0, 0, false, true, true, avr_handle_fntype_attribute,
-diff -Naurp gcc/config/avr/avr.h gcc/config/avr/avr.h
---- gcc/config/avr/avr.h 2012-06-28 19:28:32.000000000 +0530
-+++ gcc/config/avr/avr.h 2012-11-09 19:01:17.000000000 +0530
-@@ -683,6 +683,10 @@ struct GTY(()) machine_function
- /* 'true' - if current function is a signal function
- as specified by the "signal" attribute. */
- int is_signal;
-+
-+ /* 'true' - if current function is an nmi function
-+ as specified by the "nmi" attribute. */
-+ int is_nmi;
-
- /* 'true' - if current function is a 'task' function
- as specified by the "OS_task" attribute. */
-diff -Naurp gcc/testsuite/gcc.target/avr/misspelled-handler-warning.c gcc/testsuite/gcc.target/avr/misspelled-handler-warning.c
---- gcc/testsuite/gcc.target/avr/misspelled-handler-warning.c 1970-01-01 05:30:00.000000000 +0530
-+++ gcc/testsuite/gcc.target/avr/misspelled-handler-warning.c 2012-11-09 19:01:17.000000000 +0530
-@@ -0,0 +1,13 @@
-+/* Test warning emitted for functions with nmi attribute that do
-+ * not start with __vector */
-+/* { dg-do compile } */
-+
-+
-+void __attribute__((interrupt)) interrupt_fun() /* { dg-warning "'interrupt_fun' appears to be a misspelled interrupt handler" } */
-+{}
-+
-+void __attribute__((signal)) signal_fun() /* { dg-warning "'signal_fun' appears to be a misspelled signal handler" } */
-+{}
-+
-+void __attribute__((nmi)) nmi_fun() /* { dg-warning "'nmi_fun' appears to be a misspelled nmi handler" } */
-+{}
-diff -Naurp gcc/testsuite/gcc.target/avr/xmega_const_hi_io_address.c gcc/testsuite/gcc.target/avr/xmega_const_hi_io_address.c
---- gcc/testsuite/gcc.target/avr/xmega_const_hi_io_address.c 1970-01-01 05:30:00.000000000 +0530
-+++ gcc/testsuite/gcc.target/avr/xmega_const_hi_io_address.c 2012-11-09 19:01:17.000000000 +0530
-@@ -0,0 +1,15 @@
-+/* Verify that loading the contents of a constant int address in I/O range
-+ uses two IN instructions with the correct SFR offset for XMEGA*/
-+/* { dg-do compile } */
-+/* { dg-options "-Os" } */
-+/* { dg-skip-if "Only for XMEGAs" { "avr-*-*" } { "*" } { "-mmcu=atxmega128a1" } } */
-+
-+void func()
-+{
-+ volatile int val = *((int *)0x20);
-+ *((int *)0x20) = 0xCAFE;
-+
-+}
-+
-+/* { dg-final { scan-assembler "\tin r\\d+,0x20\n\tin r\\d+,0x20\\+1" } } */
-+/* { dg-final { scan-assembler "\tout 0x20,r\\d+\n\tout 0x20\\+1,r\\d+" } } */
-diff -Naurp gcc/testsuite/gcc.target/avr/xmega_const_qi_io_address.c gcc/testsuite/gcc.target/avr/xmega_const_qi_io_address.c
---- gcc/testsuite/gcc.target/avr/xmega_const_qi_io_address.c 1970-01-01 05:30:00.000000000 +0530
-+++ gcc/testsuite/gcc.target/avr/xmega_const_qi_io_address.c 2012-11-09 19:01:17.000000000 +0530
-@@ -0,0 +1,14 @@
-+/* Verify that loading the contents of a constant address in I/O range
-+ uses the IN instruction with the correct SFR offset for XMEGA*/
-+/* { dg-do compile } */
-+/* { dg-options "-Os" } */
-+/* { dg-skip-if "Only for XMEGAs" { "avr-*-*" } { "*" } { "-mmcu=atxmega128a1" } } */
-+
-+void func()
-+{
-+ volatile char val = *((char *)0x20);
-+ *((char *)0x20) = 42;
-+}
-+
-+/* { dg-final { scan-assembler "\tin r\\d+,0x20" } } */
-+/* { dg-final { scan-assembler "\tout 0x20,r\\d+" } } */
-diff -Naurp gcc/testsuite/gcc.target/avr/xmega_interrupt_no_cli.c gcc/testsuite/gcc.target/avr/xmega_interrupt_no_cli.c
---- gcc/testsuite/gcc.target/avr/xmega_interrupt_no_cli.c 1970-01-01 05:30:00.000000000 +0530
-+++ gcc/testsuite/gcc.target/avr/xmega_interrupt_no_cli.c 2012-11-09 19:01:17.000000000 +0530
-@@ -0,0 +1,14 @@
-+/* Verify that XMEGA interrupts don't have a cli or sei
-+ and that SPL is written before SPH*/
-+/* { dg-do compile } */
-+/* { dg-options "-Os" } */
-+/* { dg-skip-if "Only for XMEGAs" { "avr-*-*" } { "*" } { "-mmcu=atxmega128a1" } } */
-+
-+void __attribute__((interrupt)) __vector_1()
-+{
-+ volatile int w = 19, x = 20, y = 30, z = 42;
-+}
-+
-+/* { dg-final { scan-assembler-not "\tcli" } } */
-+/* { dg-final { scan-assembler "\tout __SP_L__,r\\d+\n\tout __SP_H__,r\\d+" } } */
-+
-diff -Naurp gcc/testsuite/gcc.target/avr/xmega_sfr_offsets.c gcc/testsuite/gcc.target/avr/xmega_sfr_offsets.c
---- gcc/testsuite/gcc.target/avr/xmega_sfr_offsets.c 1970-01-01 05:30:00.000000000 +0530
-+++ gcc/testsuite/gcc.target/avr/xmega_sfr_offsets.c 2012-11-09 19:01:17.000000000 +0530
-@@ -0,0 +1,18 @@
-+/* Verify that SFR offsets for XMEGAs do not have the 0x20 offset
-+ and that they are saved on entry, restored on exit for an interrupt
-+ function */
-+/* { dg-do compile } */
-+/* { dg-options "-Os" } */
-+/* { dg-skip-if "Only for XMEGAs" { "avr-*-*" } { "*" } { "-mmcu=atxmega128a1" } } */
-+
-+void __attribute__((interrupt)) __vector_1()
-+{
-+}
-+
-+/* { dg-final { scan-assembler "__SREG__ = 0x3f" } } */
-+/* { dg-final { scan-assembler "__RAMPD__ = 0x38" } } */
-+/* { dg-final { scan-assembler "\tin r0,__SREG__" } } */
-+/* { dg-final { scan-assembler "\tin r0,__RAMPD__" } } */
-+/* { dg-final { scan-assembler "\tpop r0\n\tout __SREG__,r0" } } */
-+/* { dg-final { scan-assembler "\tpop r0\n\tout __RAMPD__,r0" } } */
-+
diff --git a/301-gcc-tiny-support.patch b/301-gcc-tiny-support.patch
deleted file mode 100644
index 9c116a2..0000000
--- a/301-gcc-tiny-support.patch
+++ /dev/null
@@ -1,1970 +0,0 @@
-diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
---- gcc/config/avr/avr.c 2013-01-21 18:26:07.000000000 +0530
-+++ gcc/config/avr/avr.c 2013-01-21 18:40:04.000000000 +0530
-@@ -78,6 +78,17 @@
- ((SYMBOL_REF_FLAGS (sym) & AVR_SYMBOL_FLAG_PROGMEM) \
- / SYMBOL_FLAG_MACH_DEP)
-
-+#define TINY_ADIW(REG1, REG2, I) \
-+ "subi " #REG1 ",lo8(-(" #I "))" CR_TAB \
-+ "sbci " #REG2 ",hi8(-(" #I "))"
-+
-+#define TINY_SBIW(REG1, REG2, I) \
-+ "subi " #REG1 ",lo8((" #I "))" CR_TAB \
-+ "sbci " #REG2 ",hi8((" #I "))"
-+
-+#define AVR_TMP_REGNO (AVR_TINY ? TMP_REGNO_TINY : TMP_REGNO)
-+#define AVR_ZERO_REGNO (AVR_TINY ? ZERO_REGNO_TINY : ZERO_REGNO)
-+
- /* Known address spaces. The order must be the same as in the respective
- enum from avr.h (or designated initialized must be used). */
- const avr_addrspace_t avr_addrspace[] =
-@@ -157,6 +168,9 @@ static bool avr_rtx_costs (rtx, int, int
- /* Allocate registers from r25 to r8 for parameters for function calls. */
- #define FIRST_CUM_REG 26
-
-+/* Last call saved register */
-+#define LAST_CALLEE_SAVED_REG (AVR_TINY ? 21 : 17)
-+
- /* Implicit target register of LPM instruction (R0) */
- extern GTY(()) rtx lpm_reg_rtx;
- rtx lpm_reg_rtx;
-@@ -306,7 +320,7 @@ avr_option_override (void)
- avr_addr.rampy = 0x3A + avr_current_arch->sfr_offset;
- avr_addr.rampx = 0x39 + avr_current_arch->sfr_offset;
- avr_addr.rampd = 0x38 + avr_current_arch->sfr_offset;
-- avr_addr.ccp = 0x34 + avr_current_arch->sfr_offset;
-+ avr_addr.ccp = (AVR_TINY ? 0x3C : 0x34) + avr_current_arch->sfr_offset;
-
- /* SP: Stack Pointer (SP_H:SP_L) */
- avr_addr.sp_l = 0x3D + avr_current_arch->sfr_offset;
-@@ -338,8 +352,8 @@ avr_init_expanders (void)
- all_regs_rtx[regno] = gen_rtx_REG (QImode, regno);
-
- lpm_reg_rtx = all_regs_rtx[LPM_REGNO];
-- tmp_reg_rtx = all_regs_rtx[TMP_REGNO];
-- zero_reg_rtx = all_regs_rtx[ZERO_REGNO];
-+ tmp_reg_rtx = all_regs_rtx[AVR_TMP_REGNO];
-+ zero_reg_rtx = all_regs_rtx[AVR_ZERO_REGNO];
-
- lpm_addr_reg_rtx = gen_rtx_REG (HImode, REG_Z);
-
-@@ -351,6 +365,11 @@ avr_init_expanders (void)
-
- xstring_empty = gen_rtx_CONST_STRING (VOIDmode, "");
- xstring_e = gen_rtx_CONST_STRING (VOIDmode, "e");
-+
-+ /* TINY core does not have regs r10-r16, but avr-dimode.md expects them
-+ to be present */
-+ if (AVR_TINY)
-+ avr_have_dimode = false;
- }
-
-
-@@ -792,7 +811,7 @@ sequent_regs_live (void)
- int live_seq=0;
- int cur_seq=0;
-
-- for (reg = 0; reg < 18; ++reg)
-+ for (reg = 0; reg <= LAST_CALLEE_SAVED_REG; ++reg)
- {
- if (fixed_regs[reg])
- {
-@@ -903,7 +922,7 @@ emit_push_sfr (rtx sfr, bool frame_relat
- RTX_FRAME_RELATED_P (insn) = 1;
-
- /* PUSH __tmp_reg__ */
-- emit_push_byte (TMP_REGNO, frame_related_p);
-+ emit_push_byte (AVR_TMP_REGNO, frame_related_p);
-
- if (clr_p)
- {
-@@ -929,7 +948,8 @@ avr_prologue_setup_frame (HOST_WIDE_INT
- && live_seq
- && !isr_p
- && !cfun->machine->is_OS_task
-- && !cfun->machine->is_OS_main);
-+ && !cfun->machine->is_OS_main
-+ && !AVR_TINY);
-
- if (minimize
- && (frame_pointer_needed
-@@ -966,11 +986,11 @@ avr_prologue_setup_frame (HOST_WIDE_INT
- /* Note that live_seq always contains r28+r29, but the other
- registers to be saved are all below 18. */
-
-- first_reg = 18 - (live_seq - 2);
-+ first_reg = (LAST_CALLEE_SAVED_REG + 1) - (live_seq - 2);
-
- for (reg = 29, offset = -live_seq + 1;
- reg >= first_reg;
-- reg = (reg == 28 ? 17 : reg - 1), ++offset)
-+ reg = (reg == 28 ? LAST_CALLEE_SAVED_REG : reg - 1), ++offset)
- {
- rtx m, r;
-
-@@ -1201,10 +1221,10 @@ expand_prologue (void)
- emit_insn (gen_enable_interrupt ());
-
- /* Push zero reg. */
-- emit_push_byte (ZERO_REGNO, true);
-+ emit_push_byte (AVR_ZERO_REGNO, true);
-
- /* Push tmp reg. */
-- emit_push_byte (TMP_REGNO, true);
-+ emit_push_byte (AVR_TMP_REGNO, true);
-
- /* Push SREG. */
- /* ??? There's no dwarf2 column reserved for SREG. */
-@@ -1344,7 +1364,8 @@ expand_epilogue (bool sibcall_p)
- && live_seq
- && !isr_p
- && !cfun->machine->is_OS_task
-- && !cfun->machine->is_OS_main);
-+ && !cfun->machine->is_OS_main
-+ && !AVR_TINY);
-
- if (minimize
- && (live_seq > 4
-@@ -1502,14 +1523,14 @@ expand_epilogue (bool sibcall_p)
-
- /* Restore SREG using tmp_reg as scratch. */
-
-- emit_pop_byte (TMP_REGNO);
-+ emit_pop_byte (AVR_TMP_REGNO);
- emit_move_insn (sreg_rtx, tmp_reg_rtx);
-
- /* Restore tmp REG. */
-- emit_pop_byte (TMP_REGNO);
-+ emit_pop_byte (AVR_TMP_REGNO);
-
- /* Restore zero REG. */
-- emit_pop_byte (ZERO_REGNO);
-+ emit_pop_byte (AVR_ZERO_REGNO);
- }
-
- if (!sibcall_p)
-@@ -2009,7 +2030,7 @@ avr_print_operand (FILE *file, rtx x, in
- fprintf (file, "__RAMPX__");
- else if (AVR_HAVE_RAMPD && ival == avr_addr.rampd)
- fprintf (file, "__RAMPD__");
-- else if (AVR_XMEGA && ival == avr_addr.ccp)
-+ else if ((AVR_XMEGA || AVR_TINY) && ival == avr_addr.ccp)
- fprintf (file, "__CCP__");
- else if (ival == avr_addr.sreg) fprintf (file, "__SREG__");
- else if (ival == avr_addr.sp_l) fprintf (file, "__SP_L__");
-@@ -2052,6 +2073,13 @@ avr_print_operand (FILE *file, rtx x, in
-
- avr_print_operand (file, XEXP (addr, 1), 0);
- }
-+ else if (code == 'b')
-+ {
-+ if (GET_CODE (addr) != PLUS)
-+ fatal_insn ("bad address, not (reg+disp):", addr);
-+
-+ avr_print_operand_address (file, XEXP (addr, 0));
-+ }
- else if (code == 'p' || code == 'r')
- {
- if (GET_CODE (addr) != POST_INC && GET_CODE (addr) != PRE_DEC)
-@@ -2392,7 +2420,7 @@ avr_simplify_comparison_p (enum machine_
- int
- function_arg_regno_p(int r)
- {
-- return (r >= 8 && r <= 25);
-+ return (AVR_TINY ? r >= 20 && r <= 25 : r >= 8 && r <= 25);
- }
-
- /* Initializing the variable cum for the state at the beginning
-@@ -2402,7 +2430,7 @@ void
- init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, rtx libname,
- tree fndecl ATTRIBUTE_UNUSED)
- {
-- cum->nregs = 18;
-+ cum->nregs = AVR_TINY ? 6 : 18;
- cum->regno = FIRST_CUM_REG;
- if (!libname && stdarg_p (fntype))
- cum->nregs = 0;
-@@ -2900,6 +2928,25 @@ output_movhi (rtx insn, rtx xop[], int *
- return "";
- }
-
-+/* Same as out_movqi_r_mr, but TINY does not have ADIW or SBIW */
-+static const char*
-+avr_out_movqi_r_mr_reg_disp_tiny (rtx insn, rtx op[], int *plen)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx x = XEXP (src, 0);
-+ op[2] = XEXP(x, 0);
-+
-+ avr_asm_len (TINY_ADIW (%A2, %B2, %o1) CR_TAB
-+ "ld %0,%b1" , op, plen, -3);
-+
-+ if (!reg_overlap_mentioned_p (dest, XEXP (x,0))
-+ && !reg_unused_after (insn, XEXP (x,0)))
-+ avr_asm_len (TINY_SBIW (%A2, %B2, %o1), op, plen, 2);
-+
-+ return "";
-+}
-+
- static const char*
- out_movqi_r_mr (rtx insn, rtx op[], int *plen)
- {
-@@ -2913,13 +2960,18 @@ out_movqi_r_mr (rtx insn, rtx op[], int
- ? avr_asm_len ("in %0,%i1", op, plen, -1)
- : avr_asm_len ("lds %0,%m1", op, plen, -2);
- }
-- else if (GET_CODE (x) == PLUS
-+
-+
-+ if (GET_CODE (x) == PLUS
- && REG_P (XEXP (x, 0))
- && CONST_INT_P (XEXP (x, 1)))
- {
- /* memory access by reg+disp */
-
- int disp = INTVAL (XEXP (x, 1));
-+
-+ if (AVR_TINY)
-+ return avr_out_movqi_r_mr_reg_disp_tiny (insn, op, plen);
-
- if (disp - GET_MODE_SIZE (GET_MODE (src)) >= 63)
- {
-@@ -2941,25 +2993,105 @@ out_movqi_r_mr (rtx insn, rtx op[], int
- {
- /* This is a paranoid case LEGITIMIZE_RELOAD_ADDRESS must exclude
- it but I have this situation with extremal optimizing options. */
--
-- avr_asm_len ("adiw r26,%o1" CR_TAB
-- "ld %0,X", op, plen, -2);
-+
-+ avr_asm_len ("adiw r26, %o1" CR_TAB
-+ "ld %0,X", op, plen, -2);
-
- if (!reg_overlap_mentioned_p (dest, XEXP (x,0))
- && !reg_unused_after (insn, XEXP (x,0)))
- {
-- avr_asm_len ("sbiw r26,%o1", op, plen, 1);
-+ avr_asm_len ("sbiw r26, %o1", op, plen, 1);
- }
-
- return "";
- }
-
-- return avr_asm_len ("ldd %0,%1", op, plen, -1);
-+ return avr_asm_len ("ldd %0,%1", op, plen, -1);
- }
-
- return avr_asm_len ("ld %0,%1", op, plen, -1);
- }
-
-+/* Same as movhi_r_mr, but TINY does not have ADIW, SBIW and LDD */
-+static const char*
-+avr_out_movhi_r_mr_reg_no_disp_tiny (rtx op[], int *plen)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (src, 0);
-+
-+ int reg_dest = true_regnum (dest);
-+ int reg_base = true_regnum (base);
-+
-+ op[2] = base;
-+
-+ if (reg_dest == reg_base) /* R = (R) */
-+ return avr_asm_len ("ld __tmp_reg__,%1+" CR_TAB
-+ "ld %B0,%1" CR_TAB
-+ "mov %A0,__tmp_reg__", op, plen, -3);
-+
-+ return avr_asm_len ("ld %A0,%1" CR_TAB
-+ TINY_ADIW (%A2, %B2, 1) CR_TAB
-+ "ld %B0,%1" CR_TAB
-+ TINY_SBIW (%A2, %B2, 1), op, plen, -6);
-+
-+}
-+
-+/* Same as movhi_r_mr, but TINY does not have ADIW, SBIW and LDD */
-+static const char*
-+avr_out_movhi_r_mr_reg_disp_tiny (rtx op[], int *plen)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (src, 0);
-+
-+ int reg_dest = true_regnum (dest);
-+ int reg_base = true_regnum (XEXP (base, 0));
-+ op[2] = XEXP (base, 0);
-+
-+ if (reg_base == reg_dest)
-+ {
-+ return avr_asm_len (TINY_ADIW (%A2, %B2, %o1) CR_TAB
-+ "ld __tmp_reg__,%b1+" CR_TAB
-+ "ld %B0,%b1" CR_TAB
-+ "mov %A0,__tmp_reg__", op, plen, -5);
-+ }
-+ else
-+ {
-+ return avr_asm_len (TINY_ADIW (%A2, %B2, %o1) CR_TAB
-+ "ld %A0,%b1+" CR_TAB
-+ "ld %B0,%b1" CR_TAB
-+ TINY_SBIW (%A2, %B2, %o1+1), op, plen, -6);
-+ }
-+}
-+
-+/* Same as movhi_r_mr, but TINY does not have ADIW, SBIW and LDD */
-+static const char*
-+avr_out_movhi_r_mr_pre_dec_tiny (rtx insn, rtx op[], int *plen)
-+{
-+ int mem_volatile_p = 0;
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (src, 0);
-+ op[2] = XEXP (base, 0);
-+
-+ /* "volatile" forces reading low byte first, even if less efficient,
-+ for correct operation with 16-bit I/O registers. */
-+ mem_volatile_p = MEM_VOLATILE_P (src);
-+
-+ if (reg_overlap_mentioned_p (dest, XEXP (base, 0)))
-+ fatal_insn ("incorrect insn:", insn);
-+
-+ if (!mem_volatile_p)
-+ return avr_asm_len ("ld %B0,%1" CR_TAB
-+ "ld %A0,%1", op, plen, -2);
-+
-+ return avr_asm_len (TINY_SBIW (%A2, %B2, 2) CR_TAB
-+ "ld %A0,%p1+" CR_TAB
-+ "ld %B0,%p1" CR_TAB
-+ TINY_SBIW (%A2, %B2, 1), op, plen, -6);
-+}
-+
- static const char*
- out_movhi_r_mr (rtx insn, rtx op[], int *plen)
- {
-@@ -2974,20 +3106,27 @@ out_movhi_r_mr (rtx insn, rtx op[], int
-
- if (reg_base > 0)
- {
-+ if (AVR_TINY)
-+ return avr_out_movhi_r_mr_reg_no_disp_tiny (op, plen);
-+
- if (reg_dest == reg_base) /* R = (R) */
- return avr_asm_len ("ld __tmp_reg__,%1+" CR_TAB
- "ld %B0,%1" CR_TAB
- "mov %A0,__tmp_reg__", op, plen, -3);
-
- if (reg_base != REG_X)
-+ {
- return avr_asm_len ("ld %A0,%1" CR_TAB
-- "ldd %B0,%1+1", op, plen, -2);
--
-+ "ldd %B0,%1+1", op, plen, -2);
-+ }
-+
- avr_asm_len ("ld %A0,X+" CR_TAB
- "ld %B0,X", op, plen, -2);
-
- if (!reg_unused_after (insn, base))
-+ {
- avr_asm_len ("sbiw r26,1", op, plen, 1);
-+ }
-
- return "";
- }
-@@ -2996,6 +3135,9 @@ out_movhi_r_mr (rtx insn, rtx op[], int
- int disp = INTVAL (XEXP (base, 1));
- int reg_base = true_regnum (XEXP (base, 0));
-
-+ if (AVR_TINY)
-+ return avr_out_movhi_r_mr_reg_disp_tiny (op, plen);
-+
- if (disp > MAX_LD_OFFSET (GET_MODE (src)))
- {
- if (REGNO (XEXP (base, 0)) != REG_Y)
-@@ -3007,7 +3149,7 @@ out_movhi_r_mr (rtx insn, rtx op[], int
- "ldd %B0,Y+63" CR_TAB
- "sbiw r28,%o1-62", op, plen, -4)
-
-- : avr_asm_len ("subi r28,lo8(-%o1)" CR_TAB
-+ : avr_asm_len ("subi r28,lo8(-%o1)" CR_TAB
- "sbci r29,hi8(-%o1)" CR_TAB
- "ld %A0,Y" CR_TAB
- "ldd %B0,Y+1" CR_TAB
-@@ -3041,6 +3183,9 @@ out_movhi_r_mr (rtx insn, rtx op[], int
- }
- else if (GET_CODE (base) == PRE_DEC) /* (--R) */
- {
-+ if (AVR_TINY)
-+ return avr_out_movhi_r_mr_pre_dec_tiny (insn, op, plen);
-+
- if (reg_overlap_mentioned_p (dest, XEXP (base, 0)))
- fatal_insn ("incorrect insn:", insn);
-
-@@ -3081,6 +3226,101 @@ out_movhi_r_mr (rtx insn, rtx op[], int
- }
-
- static const char*
-+avr_out_movsi_r_mr_reg_no_disp_tiny (rtx insn, rtx op[], int *l)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (src, 0);
-+ int reg_dest = true_regnum (dest);
-+ int reg_base = true_regnum (base);
-+ op[2] = base;
-+
-+ if (reg_dest == reg_base)
-+ {
-+ /* "ld r26,-X" is undefined */
-+ return *l=9, (TINY_ADIW (%A2, %B2, 3) CR_TAB
-+ "ld %D0,%1" CR_TAB
-+ "ld %C0,-%1" CR_TAB
-+ "ld __tmp_reg__,-%1" CR_TAB
-+ TINY_SBIW (%A2, %B2, 1) CR_TAB
-+ "ld %A0,%1" CR_TAB
-+ "mov %B0,__tmp_reg__");
-+ }
-+ else if (reg_dest == reg_base - 2)
-+ {
-+ return *l=5, ("ld %A0,%1+" CR_TAB
-+ "ld %B0,%1+" CR_TAB
-+ "ld __tmp_reg__,%1+" CR_TAB
-+ "ld %D0,%1" CR_TAB
-+ "mov %C0,__tmp_reg__");
-+ }
-+ else if (reg_unused_after (insn, base))
-+ {
-+ return *l=4, ("ld %A0,%1+" CR_TAB
-+ "ld %B0,%1+" CR_TAB
-+ "ld %C0,%1+" CR_TAB
-+ "ld %D0,%1");
-+ }
-+ else
-+ {
-+ return *l=6, ("ld %A0,%1+" CR_TAB
-+ "ld %B0,%1+" CR_TAB
-+ "ld %C0,%1+" CR_TAB
-+ "ld %D0,%1" CR_TAB
-+ TINY_SBIW (%A2, %B2, 3));
-+ }
-+}
-+
-+static const char*
-+avr_out_movsi_r_mr_reg_disp_tiny (rtx insn, rtx op[], int *l)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (src, 0);
-+ int reg_dest = true_regnum (dest);
-+ int reg_base = true_regnum (XEXP (base, 0));
-+ op[2] = XEXP (base, 0);
-+
-+ if (reg_dest == reg_base)
-+ {
-+ /* "ld r26,-X" is undefined */
-+ return *l=9, (TINY_ADIW (%A2, %B2, %o1+3) CR_TAB
-+ "ld %D0,%b1" CR_TAB
-+ "ld %C0,-%b1" CR_TAB
-+ "ld __tmp_reg__,-%b1" CR_TAB
-+ TINY_SBIW (%A2, %B2, 1) CR_TAB
-+ "ld %A0,%b1" CR_TAB
-+ "mov %B0,__tmp_reg__");
-+ }
-+ else if (reg_dest == reg_base - 2)
-+ {
-+ return *l=7, (TINY_ADIW (%A2, %B2, %o1) CR_TAB
-+ "ld %A0,%b1+" CR_TAB
-+ "ld %B0,%b1+" CR_TAB
-+ "ld __tmp_reg__,%b1+" CR_TAB
-+ "ld %D0,%b1" CR_TAB
-+ "mov %C0,__tmp_reg__");
-+ }
-+ else if (reg_unused_after (insn, XEXP (base, 0)))
-+ {
-+ return *l=6, (TINY_ADIW (%A2, %B2, %o1) CR_TAB
-+ "ld %A0,%b1+" CR_TAB
-+ "ld %B0,%b1+" CR_TAB
-+ "ld %C0,%b1+" CR_TAB
-+ "ld %D0,%b1");
-+ }
-+ else
-+ {
-+ return *l=8, (TINY_ADIW (%A2, %B2, %o1) CR_TAB
-+ "ld %A0,%b1+" CR_TAB
-+ "ld %B0,%b1+" CR_TAB
-+ "ld %C0,%b1+" CR_TAB
-+ "ld %D0,%b1" CR_TAB
-+ TINY_SBIW (%A2, %B2, %o1+3));
-+ }
-+}
-+
-+static const char*
- out_movsi_r_mr (rtx insn, rtx op[], int *l)
- {
- rtx dest = op[0];
-@@ -3095,6 +3335,9 @@ out_movsi_r_mr (rtx insn, rtx op[], int
-
- if (reg_base > 0)
- {
-+ if (AVR_TINY)
-+ return avr_out_movsi_r_mr_reg_no_disp_tiny (insn, op, l);
-+
- if (reg_base == REG_X) /* (R26) */
- {
- if (reg_dest == REG_X)
-@@ -3149,6 +3392,9 @@ out_movsi_r_mr (rtx insn, rtx op[], int
- {
- int disp = INTVAL (XEXP (base, 1));
-
-+ if (AVR_TINY)
-+ return avr_out_movsi_r_mr_reg_disp_tiny (insn, op, l);
-+
- if (disp > MAX_LD_OFFSET (GET_MODE (src)))
- {
- if (REGNO (XEXP (base, 0)) != REG_Y)
-@@ -3242,6 +3488,113 @@ out_movsi_r_mr (rtx insn, rtx op[], int
- }
-
- static const char*
-+avr_out_movsi_mr_r_reg_no_disp_tiny (rtx insn, rtx op[], int *l)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (dest, 0);
-+ int reg_base = true_regnum (base);
-+ int reg_src = true_regnum (src);
-+ op[2] = base;
-+
-+ if (reg_base == reg_src)
-+ {
-+ /* "ld r26,-X" is undefined */
-+ if (reg_unused_after (insn, base))
-+ {
-+ return *l=7, ("mov __tmp_reg__, %B1" CR_TAB
-+ "st %0,%A1" CR_TAB
-+ TINY_ADIW (%A2, %B2, 1) CR_TAB
-+ "st %0+,__tmp_reg__" CR_TAB
-+ "st %0+,%C1" CR_TAB
-+ "st %0+,%D1");
-+ }
-+ else
-+ {
-+ return *l=9, ("mov __tmp_reg__, %B1" CR_TAB
-+ "st %0,%A1" CR_TAB
-+ TINY_ADIW (%A2, %B2, 1) CR_TAB
-+ "st %0+,__tmp_reg__" CR_TAB
-+ "st %0+,%C1" CR_TAB
-+ "st %0+,%D1" CR_TAB
-+ TINY_SBIW (%A2, %B2, 3));
-+ }
-+ }
-+ else if (reg_base == reg_src + 2)
-+ {
-+ if (reg_unused_after (insn, base))
-+ return *l=7, ("mov __zero_reg__,%C1" CR_TAB
-+ "mov __tmp_reg__,%D1" CR_TAB
-+ "st %0+,%A1" CR_TAB
-+ "st %0+,%B1" CR_TAB
-+ "st %0+,__zero_reg__" CR_TAB
-+ "st %0,__tmp_reg__" CR_TAB
-+ "clr __zero_reg__");
-+ else
-+ return *l=9, ("mov __zero_reg__,%C1" CR_TAB
-+ "mov __tmp_reg__,%D1" CR_TAB
-+ "st %0+,%A1" CR_TAB
-+ "st %0+,%B1" CR_TAB
-+ "st %0+,__zero_reg__" CR_TAB
-+ "st %0,__tmp_reg__" CR_TAB
-+ "clr __zero_reg__" CR_TAB
-+ TINY_SBIW (%A2, %B2, 3));
-+ }
-+
-+ return *l=6, ("st %0+,%A1" CR_TAB
-+ "st %0+,%B1" CR_TAB
-+ "st %0+,%C1" CR_TAB
-+ "st %0,%D1" CR_TAB
-+ TINY_SBIW (%A2, %B2, 3));
-+}
-+
-+static const char*
-+avr_out_movsi_mr_r_reg_disp_tiny (rtx op[], int *l)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (dest, 0);
-+ int reg_base = REGNO (XEXP (base, 0));
-+ int reg_src =true_regnum (src);
-+
-+ op[2] = XEXP (base, 0);
-+
-+ if (reg_base == reg_src)
-+ {
-+ *l = 11;
-+ return ("mov __tmp_reg__,%A2" CR_TAB
-+ "mov __zero_reg__,%B2" CR_TAB
-+ TINY_ADIW (%A2, %B2, %o0) CR_TAB
-+ "st %b0+,__tmp_reg__" CR_TAB
-+ "st %b0+,__zero_reg__" CR_TAB
-+ "st %b0+,%C2" CR_TAB
-+ "st %b0,%D2" CR_TAB
-+ "clr __zero_reg__" CR_TAB
-+ TINY_SBIW (%A2, %B2, %o0+3));
-+ }
-+ else if (reg_src == reg_base - 2)
-+ {
-+ *l = 11;
-+ return ("mov __tmp_reg__,%C2" CR_TAB
-+ "mov __zero_reg__,%D2" CR_TAB
-+ TINY_ADIW (%A2, %B2, %o0) CR_TAB
-+ "st %b0+,%A0" CR_TAB
-+ "st %b0+,%B0" CR_TAB
-+ "st %b0+,__tmp_reg__" CR_TAB
-+ "st %b0,__zero_reg__" CR_TAB
-+ "clr __zero_reg__" CR_TAB
-+ TINY_SBIW (%A2, %B2, %o0+3));
-+ }
-+ *l = 8;
-+ return (TINY_ADIW (%A2, %B2, %o0) CR_TAB
-+ "st %b0+,%A1" CR_TAB
-+ "st %b0+,%B1" CR_TAB
-+ "st %b0+,%C1" CR_TAB
-+ "st %b0,%D1" CR_TAB
-+ TINY_SBIW (%A2, %B2, %o0+3));
-+}
-+
-+static const char*
- out_movsi_mr_r (rtx insn, rtx op[], int *l)
- {
- rtx dest = op[0];
-@@ -3261,6 +3614,9 @@ out_movsi_mr_r (rtx insn, rtx op[], int
- "sts %m0+3,%D1");
- if (reg_base > 0) /* (r) */
- {
-+ if (AVR_TINY)
-+ return avr_out_movsi_mr_r_reg_no_disp_tiny (insn, op, l);
-+
- if (reg_base == REG_X) /* (R26) */
- {
- if (reg_src == REG_X)
-@@ -3317,6 +3673,10 @@ out_movsi_mr_r (rtx insn, rtx op[], int
- else if (GET_CODE (base) == PLUS) /* (R + i) */
- {
- int disp = INTVAL (XEXP (base, 1));
-+
-+ if (AVR_TINY)
-+ return avr_out_movsi_mr_r_reg_disp_tiny (op, l);
-+
- reg_base = REGNO (XEXP (base, 0));
- if (disp > MAX_LD_OFFSET (GET_MODE (dest)))
- {
-@@ -3476,6 +3836,75 @@ output_movsisf (rtx insn, rtx operands[]
- /* Handle loads of 24-bit types from memory to register. */
-
- static const char*
-+avr_out_load_psi_reg_no_disp_tiny (rtx insn, rtx *op, int *plen)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (src, 0);
-+ int reg_dest = true_regnum (dest);
-+ int reg_base = true_regnum (base);
-+ op[2] = base;
-+
-+ if (reg_base == reg_dest)
-+ {
-+ return avr_asm_len (TINY_ADIW (%A2, %B2, 2) CR_TAB
-+ "ld %C0,%1" CR_TAB
-+ "ld __tmp_reg__,-%1" CR_TAB
-+ TINY_SBIW (%A2, %B2, 1) CR_TAB
-+ "ld %A0,%1" CR_TAB
-+ "mov %B0,__tmp_reg__", op, plen, -8);
-+ }
-+ else
-+ {
-+ return avr_asm_len ("ld %A0,%1+" CR_TAB
-+ "ld %B0,%1+" CR_TAB
-+ "ld %C0,%1", op, plen, -3);
-+
-+ if (reg_dest != reg_base - 2 &&
-+ !reg_unused_after (insn, base))
-+ {
-+ avr_asm_len (TINY_SBIW (%A2, %B2, 2), op, plen, 2);
-+ }
-+ return "";
-+ }
-+}
-+
-+static const char*
-+avr_out_load_psi_reg_disp_tiny (rtx insn, rtx *op, int *plen)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (src, 0);
-+ int reg_dest = true_regnum (dest);
-+ int reg_base = true_regnum (base);
-+ op[2] = XEXP (base, 0);
-+
-+ reg_base = true_regnum (XEXP (base, 0));
-+ if (reg_base == reg_dest)
-+ {
-+ return avr_asm_len (TINY_ADIW (%A2, %B2, %o1+2) CR_TAB
-+ "ld %C0,%b1" CR_TAB
-+ "ld __tmp_reg__,-%b1" CR_TAB
-+ TINY_SBIW (%A2, %B2, 1) CR_TAB
-+ "ld %A0,%b1" CR_TAB
-+ "mov %B0,__tmp_reg__", op, plen, -8);
-+ }
-+ else
-+ {
-+ avr_asm_len (TINY_ADIW (%A2, %B2, %o1) CR_TAB
-+ "ld %A0,%b1+" CR_TAB
-+ "ld %B0,%b1+" CR_TAB
-+ "ld %C0,%b1", op, plen, -5);
-+
-+ if (reg_dest != (reg_base - 2)
-+ && !reg_unused_after (insn, XEXP (base, 0)))
-+ avr_asm_len (TINY_SBIW (%A2, %B2, %o1+2), op, plen, 2);
-+
-+ return "";
-+ }
-+}
-+
-+static const char*
- avr_out_load_psi (rtx insn, rtx *op, int *plen)
- {
- rtx dest = op[0];
-@@ -3486,6 +3915,9 @@ avr_out_load_psi (rtx insn, rtx *op, int
-
- if (reg_base > 0)
- {
-+ if (AVR_TINY)
-+ return avr_out_load_psi_reg_no_disp_tiny (insn, op, plen);
-+
- if (reg_base == REG_X) /* (R26) */
- {
- if (reg_dest == REG_X)
-@@ -3527,6 +3959,9 @@ avr_out_load_psi (rtx insn, rtx *op, int
- else if (GET_CODE (base) == PLUS) /* (R + i) */
- {
- int disp = INTVAL (XEXP (base, 1));
-+
-+ if (AVR_TINY)
-+ return avr_out_load_psi_reg_disp_tiny (insn, op, plen);
-
- if (disp > MAX_LD_OFFSET (GET_MODE (src)))
- {
-@@ -3604,6 +4039,85 @@ avr_out_load_psi (rtx insn, rtx *op, int
- return "";
- }
-
-+
-+static const char*
-+avr_out_store_psi_reg_no_disp_tiny (rtx insn, rtx *op, int *plen)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (dest, 0);
-+ int reg_base = true_regnum (base);
-+ int reg_src = true_regnum (src);
-+ op[2] = base;
-+
-+ if (reg_base == reg_src)
-+ {
-+ avr_asm_len ("st %0,%A1" CR_TAB
-+ "mov __tmp_reg__,%B1" CR_TAB
-+ TINY_ADIW (%A2, %B2, 1) CR_TAB /* st X+, r27 is undefined */
-+ "st %0+,__tmp_reg__" CR_TAB
-+ "st %0,%C1", op, plen, -6);
-+
-+ }
-+ else if (reg_src == reg_base - 2)
-+ {
-+ avr_asm_len ("st %0,%A1" CR_TAB
-+ "mov __tmp_reg__,%C1" CR_TAB
-+ TINY_ADIW (%A2, %B2, 1) CR_TAB
-+ "st %0+,%B1" CR_TAB
-+ "st %0,__tmp_reg__", op, plen, 6);
-+ }
-+ else
-+ {
-+ avr_asm_len ("st %0+,%A1" CR_TAB
-+ "st %0+,%B1" CR_TAB
-+ "st %0,%C1", op, plen, -3);
-+ }
-+
-+ if (!reg_unused_after (insn, base))
-+ avr_asm_len (TINY_SBIW (%A2, %B2, 2), op, plen, 2);
-+
-+ return "";
-+}
-+
-+static const char*
-+avr_out_store_psi_reg_disp_tiny (rtx *op, int *plen)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (dest, 0);
-+ int reg_base = REGNO (XEXP (base, 0));
-+ int reg_src = true_regnum (src);
-+ op[2] = XEXP (base, 0);
-+
-+ if (reg_src == reg_base)
-+ {
-+ return avr_asm_len ("mov __tmp_reg__,%A1" CR_TAB
-+ "mov __zero_reg__,%B1" CR_TAB
-+ TINY_ADIW (%A2, %B2, %o0) CR_TAB
-+ "st %b0+,__tmp_reg__" CR_TAB
-+ "st %b0+,__zero_reg__" CR_TAB
-+ "st %b0,%C1" CR_TAB
-+ "clr __zero_reg__" CR_TAB
-+ TINY_SBIW (%A2, %B2, %o0+2), op, plen, -10);
-+ }
-+ else if (reg_src == reg_base - 2)
-+ {
-+ return avr_asm_len ("mov __tmp_reg__,%C1" CR_TAB
-+ TINY_ADIW (%A2, %B2, %o0) CR_TAB
-+ "st %b0+,%A1" CR_TAB
-+ "st %b0+,%B1" CR_TAB
-+ "st %b0,__tmp_reg__" CR_TAB
-+ TINY_SBIW (%A2, %B2, %o0+2), op, plen, -8);
-+ }
-+
-+ return avr_asm_len (TINY_ADIW (%A2, %B2, %o0) CR_TAB
-+ "st %b0+,%A1" CR_TAB
-+ "st %b0+,%B1" CR_TAB
-+ "st %b0,%C1" CR_TAB
-+ TINY_SBIW (%A2, %B2, %o0+2), op, plen, -7);
-+}
-+
- /* Handle store of 24-bit type from register or zero to memory. */
-
- static const char*
-@@ -3621,6 +4135,9 @@ avr_out_store_psi (rtx insn, rtx *op, in
-
- if (reg_base > 0) /* (r) */
- {
-+ if (AVR_TINY)
-+ return avr_out_store_psi_reg_no_disp_tiny (insn, op, plen);
-+
- if (reg_base == REG_X) /* (R26) */
- {
- gcc_assert (!reg_overlap_mentioned_p (base, src));
-@@ -3642,6 +4159,10 @@ avr_out_store_psi (rtx insn, rtx *op, in
- else if (GET_CODE (base) == PLUS) /* (R + i) */
- {
- int disp = INTVAL (XEXP (base, 1));
-+
-+ if (AVR_TINY)
-+ return avr_out_store_psi_reg_disp_tiny (op, plen);
-+
- reg_base = REGNO (XEXP (base, 0));
-
- if (disp > MAX_LD_OFFSET (GET_MODE (dest)))
-@@ -3758,6 +4279,31 @@ avr_out_movpsi (rtx insn, rtx *op, int *
- return "";
- }
-
-+static const char*
-+avr_out_movqi_mr_r_reg_disp_tiny (rtx insn, rtx op[], int *plen)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx x = XEXP (dest, 0);
-+ op[2] = XEXP (x, 0);
-+
-+ if (reg_overlap_mentioned_p (src, XEXP (x, 0)))
-+ {
-+ avr_asm_len ("mov __tmp_reg__,%1" CR_TAB
-+ TINY_ADIW (%A2, %B2, %o0) CR_TAB
-+ "st %b0,__tmp_reg__", op, plen, -4);
-+ }
-+ else
-+ {
-+ avr_asm_len (TINY_ADIW (%A2, %B2, %o0) CR_TAB
-+ "st %b0,%1" , op, plen, -3);
-+ }
-+
-+ if (!reg_unused_after (insn, XEXP (x,0)))
-+ avr_asm_len (TINY_SBIW (%A2, %B2, %o0), op, plen, 2);
-+
-+ return "";
-+}
-
- static const char*
- out_movqi_mr_r (rtx insn, rtx op[], int *plen)
-@@ -3780,6 +4326,9 @@ out_movqi_mr_r (rtx insn, rtx op[], int
-
- int disp = INTVAL (XEXP (x, 1));
-
-+ if (AVR_TINY)
-+ return avr_out_movqi_mr_r_reg_disp_tiny (insn, op, plen);
-+
- if (disp - GET_MODE_SIZE (GET_MODE (dest)) >= 63)
- {
- if (REGNO (XEXP (x, 0)) != REG_Y)
-@@ -3934,6 +4483,76 @@ avr_out_movhi_mr_r_xmega (rtx insn, rtx
- return "";
- }
-
-+static const char*
-+avr_out_movhi_mr_r_reg_no_disp_tiny (rtx insn, rtx op[], int *plen)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (dest, 0);
-+ int reg_base = true_regnum (base);
-+ int reg_src = true_regnum (src);
-+ int mem_volatile_p = MEM_VOLATILE_P (dest);
-+ op[2] = base;
-+
-+ if (reg_base == reg_src)
-+ {
-+ return !mem_volatile_p && reg_unused_after (insn, src)
-+ ? avr_asm_len ("mov __tmp_reg__,%B1" CR_TAB
-+ "st %0,%A1" CR_TAB
-+ TINY_ADIW (%A2, %B2, 1) CR_TAB
-+ "st %0,__tmp_reg__", op, plen, -5)
-+ : avr_asm_len ("mov __tmp_reg__,%B1" CR_TAB
-+ TINY_ADIW (%A2, %B2, 1) CR_TAB
-+ "st %0,__tmp_reg__" CR_TAB
-+ TINY_SBIW (%A2, %B2, 1) CR_TAB
-+ "st %0, %A1", op, plen, -7);
-+ }
-+
-+ return !mem_volatile_p && reg_unused_after (insn, base)
-+ ? avr_asm_len ("st %0+,%A1" CR_TAB
-+ "st %0,%B1", op, plen, -2)
-+ : avr_asm_len (TINY_ADIW (%A2, %B2, 1) CR_TAB
-+ "st %0,%B1" CR_TAB
-+ "st -%0,%A1", op, plen, -4);
-+}
-+
-+static const char*
-+avr_out_movhi_mr_r_reg_disp_tiny (rtx op[], int *plen)
-+{
-+ rtx dest = op[0];
-+ rtx src = op[1];
-+ rtx base = XEXP (dest, 0);
-+ int reg_base = REGNO (XEXP (base, 0));
-+ int reg_src = true_regnum (src);
-+ op[2] = XEXP (base, 0);
-+
-+ return reg_src == reg_base
-+ ? avr_asm_len ("mov __tmp_reg__,%A1" CR_TAB
-+ "mov __zero_reg__,%B1" CR_TAB
-+ TINY_ADIW (%A2, %B2, %o0+1) CR_TAB
-+ "st %b0,__zero_reg__" CR_TAB
-+ "st -%b0,__tmp_reg__" CR_TAB
-+ "clr __zero_reg__" CR_TAB
-+ TINY_SBIW (%A2, %B2, %o0), op, plen, -9)
-+
-+ : avr_asm_len (TINY_ADIW (%A2, %B2, %o0+1) CR_TAB
-+ "st %b0,%B1" CR_TAB
-+ "st -%b0,%A1" CR_TAB
-+ TINY_SBIW (%A2, %B2, %o0), op, plen, -6);
-+}
-+
-+static const char*
-+avr_out_movhi_mr_r_post_inc_tiny (rtx op[], int *plen)
-+{
-+ rtx dest = op[0];
-+ rtx base = XEXP (dest, 0);
-+ op[2] = XEXP (base, 0);
-+
-+ return avr_asm_len (TINY_ADIW (%A2, %B2, 1) CR_TAB
-+ "st %p0,%B1" CR_TAB
-+ "st -%p0,%A1" CR_TAB
-+ TINY_ADIW (%A2, %B2, 2), op, plen, -6);
-+}
-
- static const char*
- out_movhi_mr_r (rtx insn, rtx op[], int *plen)
-@@ -3964,6 +4583,9 @@ out_movhi_mr_r (rtx insn, rtx op[], int
-
- if (reg_base > 0)
- {
-+ if (AVR_TINY)
-+ return avr_out_movhi_mr_r_reg_no_disp_tiny (insn, op, plen);
-+
- if (reg_base != REG_X)
- return avr_asm_len ("std %0+1,%B1" CR_TAB
- "st %0,%A1", op, plen, -2);
-@@ -3992,6 +4614,10 @@ out_movhi_mr_r (rtx insn, rtx op[], int
- else if (GET_CODE (base) == PLUS)
- {
- int disp = INTVAL (XEXP (base, 1));
-+
-+ if (AVR_TINY)
-+ return avr_out_movhi_mr_r_reg_disp_tiny (op, plen);
-+
- reg_base = REGNO (XEXP (base, 0));
- if (disp > MAX_LD_OFFSET (GET_MODE (dest)))
- {
-@@ -4040,6 +4666,8 @@ out_movhi_mr_r (rtx insn, rtx op[], int
- if (!mem_volatile_p)
- return avr_asm_len ("st %0,%A1" CR_TAB
- "st %0,%B1", op, plen, -2);
-+ if (AVR_TINY)
-+ return avr_out_movhi_mr_r_post_inc_tiny (op, plen);
-
- return REGNO (XEXP (base, 0)) == REG_X
- ? avr_asm_len ("adiw r26,1" CR_TAB
-@@ -4212,7 +4840,11 @@ avr_out_compare (rtx insn, rtx *xop, int
- && (val8 == 0
- || reg_unused_after (insn, xreg)))
- {
-- avr_asm_len ("sbiw %0,%1", xop, plen, 1);
-+ if (AVR_TINY)
-+ avr_asm_len (TINY_SBIW (%A0, %B0, %1), xop, plen, 2);
-+ else
-+ avr_asm_len ("sbiw %0,%1", xop, plen, 1);
-+
- i++;
- continue;
- }
-@@ -4222,7 +4854,9 @@ avr_out_compare (rtx insn, rtx *xop, int
- && compare_eq_p (insn)
- && reg_unused_after (insn, xreg))
- {
-- return avr_asm_len ("adiw %0,%n1", xop, plen, 1);
-+ return AVR_TINY
-+ ? avr_asm_len (TINY_ADIW (%A0, %B0, %n1), xop, plen, 2)
-+ : avr_asm_len ("adiw %0,%n1", xop, plen, 1);
- }
- }
-
-@@ -7411,10 +8045,10 @@ avr_file_start (void)
- fprintf (asm_out_file, "__RAMPX__ = 0x%02x\n", avr_addr.rampx - sfr_offset);
- if (AVR_HAVE_RAMPD)
- fprintf (asm_out_file, "__RAMPD__ = 0x%02x\n", avr_addr.rampd - sfr_offset);
-- if (AVR_XMEGA)
-+ if (AVR_XMEGA || AVR_TINY)
- fprintf (asm_out_file, "__CCP__ = 0x%02x\n", avr_addr.ccp - sfr_offset);
-- fprintf (asm_out_file, "__tmp_reg__ = %d\n", TMP_REGNO);
-- fprintf (asm_out_file, "__zero_reg__ = %d\n", ZERO_REGNO);
-+ fprintf (asm_out_file, "__tmp_reg__ = %d\n", AVR_TMP_REGNO);
-+ fprintf (asm_out_file, "__zero_reg__ = %d\n", AVR_ZERO_REGNO);
- }
-
-
-@@ -7461,6 +8095,17 @@ order_regs_for_local_alloc (void)
- 0,1,
- 32,33,34,35
- };
-+ static const int tiny_order_0[] = {
-+ 24,25,
-+ 22,23,
-+ 30,31,
-+ 26,27,
-+ 28,29,
-+ 21,20,19,18,
-+ 16,17,
-+ 32,33,34,35,
-+ 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
-+ };
- static const int order_1[] = {
- 18,19,
- 20,21,
-@@ -7473,6 +8118,17 @@ order_regs_for_local_alloc (void)
- 0,1,
- 32,33,34,35
- };
-+ static const int tiny_order_1[] = {
-+ 22,23,
-+ 24,25,
-+ 30,31,
-+ 26,27,
-+ 28,29,
-+ 21,20,19,18,
-+ 16,17,
-+ 32,33,34,35,
-+ 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
-+ };
- static const int order_2[] = {
- 25,24,
- 23,22,
-@@ -7487,9 +8143,14 @@ order_regs_for_local_alloc (void)
- 32,33,34,35
- };
-
-- const int *order = (TARGET_ORDER_1 ? order_1 :
-- TARGET_ORDER_2 ? order_2 :
-- order_0);
-+ /*
-+ Select specific register allocation order. Tiny Core (attiny4/5/9/10/20/40)
-+ devices has only 16 registers, so different allocation order should be used
-+ */
-+ const int *order = (TARGET_ORDER_1 ? (AVR_TINY ? tiny_order_1 : order_1) :
-+ TARGET_ORDER_2 ? (AVR_TINY ? tiny_order_1 : order_2) :
-+ (AVR_TINY ? tiny_order_0 : order_0));
-+
- for (i=0; i < ARRAY_SIZE (order_0); ++i)
- reg_alloc_order[i] = order[i];
- }
-@@ -9151,7 +9812,7 @@ output_reload_in_const (rtx *op, rtx clo
- {
- if (!clear_p)
- avr_asm_len (ldreg_p ? "ldi %0,0"
-- : ZERO_REGNO == REGNO (xdest[n]) ? "clr %0"
-+ : AVR_ZERO_REGNO == REGNO (xdest[n]) ? "clr %0"
- : "mov %0,__zero_reg__",
- &xdest[n], len, 1);
- continue;
-@@ -9350,6 +10011,50 @@ avr_output_addr_vec_elt (FILE *stream, i
- fprintf (stream, "\trjmp .L%d\n", value);
- }
-
-+static void
-+avr_conditional_register_usage(void) {
-+
-+ if (AVR_TINY) {
-+ unsigned int i;
-+
-+ const int tiny_reg_alloc_order[] = {
-+ 24,25,
-+ 22,23,
-+ 30,31,
-+ 26,27,
-+ 28,29,
-+ 21,20,19,18,
-+ 16,17,
-+ 32,33,34,35,
-+ 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
-+ };
-+
-+ /* Set R0-R17 as fixed registers. Reset R0-R17 in call used register list
-+ - R0-R15 are not available in Tiny Core devices
-+ - R16 and R17 are fixed registers
-+ */
-+ for (i = 0; i <= 17; i++) {
-+ fixed_regs[i] = 1;
-+ call_used_regs[i] = 1;
-+ }
-+
-+ /* Set R18 to R21 as callee saved registers
-+ - R18, R19, R20 and R21 are the callee saved registers in Tiny Core devices
-+ */
-+ for (i = 18; i <= LAST_CALLEE_SAVED_REG; i++) {
-+ call_used_regs[i] = 0;
-+ }
-+
-+ /*update register allocation order for Tiny Core devices */
-+ for (i=0; i < ARRAY_SIZE (tiny_reg_alloc_order); i++) {
-+ reg_alloc_order[i] = tiny_reg_alloc_order[i];
-+ }
-+
-+ CLEAR_HARD_REG_SET(reg_class_contents[(int)ADDW_REGS]);
-+ CLEAR_HARD_REG_SET(reg_class_contents[(int)NO_LD_REGS]);
-+ }
-+}
-+
- /* Returns true if SCRATCH are safe to be allocated as a scratch
- registers (for a define_peephole2) in the current function. */
-
-@@ -9495,13 +10200,20 @@ avr_asm_out_dtor (rtx symbol, int priori
- static bool
- avr_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
- {
-- if (TYPE_MODE (type) == BLKmode)
-- {
-- HOST_WIDE_INT size = int_size_in_bytes (type);
-- return (size == -1 || size > 8);
-- }
-+ HOST_WIDE_INT size = int_size_in_bytes (type);
-+ HOST_WIDE_INT ret_size_limit = AVR_TINY ? 4 : 8;
-+
-+ /* In avr, there are 8 return registers. But, for Tiny Core
-+ (attiny4/5/9/10/20/40) devices, only 4 registers available.
-+ Return true if size is unknown or greater than the limit */
-+ if ((size == -1) || (size > ret_size_limit))
-+ {
-+ return true;
-+ }
- else
-+ {
- return false;
-+ }
- }
-
- /* Worker function for CASE_VALUES_THRESHOLD. */
-@@ -10949,6 +11661,9 @@ avr_fold_builtin (tree fndecl, int n_arg
- #undef TARGET_BUILTIN_SETJMP_FRAME_VALUE
- #define TARGET_BUILTIN_SETJMP_FRAME_VALUE avr_builtin_setjmp_frame_value
-
-+#undef TARGET_CONDITIONAL_REGISTER_USAGE
-+#define TARGET_CONDITIONAL_REGISTER_USAGE avr_conditional_register_usage
-+
- #undef TARGET_HARD_REGNO_SCRATCH_OK
- #define TARGET_HARD_REGNO_SCRATCH_OK avr_hard_regno_scratch_ok
- #undef TARGET_CASE_VALUES_THRESHOLD
-diff -Naurp gcc/config/avr/avr-c.c gcc/config/avr/avr-c.c
---- gcc/config/avr/avr-c.c 2012-09-05 17:49:47.000000000 +0530
-+++ gcc/config/avr/avr-c.c 2013-01-21 18:40:04.000000000 +0530
-@@ -113,6 +113,23 @@ avr_cpu_cpp_builtins (struct cpp_reader
- }
- if (AVR_XMEGA)
- cpp_define (pfile, "__AVR_XMEGA__");
-+
-+ if (AVR_TINY)
-+ {
-+ cpp_define (pfile, "__AVR_TINY__");
-+
-+ /* Define macro "__AVR_TINY_PM_BASE_ADDRESS__" with mapped program memory
-+ start address. This macro shall be referred where mapped program memory
-+ is accessed. (Eg. copying data section (do_copy_data) contents to data
-+ memory region.
-+ NOTE:
-+ Program memory of AVR_TINY devices can not be accessed directly, it has
-+ been mapped to the data memory. For AVR_TINY devices (ATtiny4/ 5/ 9/ 10/
-+ 20 and 40) mapped program memory starts at 0x4000.
-+ */
-+ cpp_define (pfile, "__AVR_TINY_PM_BASE_ADDRESS__=0x4000");
-+ }
-+
- if (avr_current_arch->have_eijmp_eicall)
- {
- cpp_define (pfile, "__AVR_HAVE_EIJMP_EICALL__");
-diff -Naurp gcc/config/avr/avr-devices.c gcc/config/avr/avr-devices.c
---- gcc/config/avr/avr-devices.c 2012-08-06 20:04:27.000000000 +0530
-+++ gcc/config/avr/avr-devices.c 2013-01-21 18:40:04.000000000 +0530
-@@ -30,29 +30,30 @@ const struct base_arch_s
- avr_arch_types[] =
- {
- /* unknown device specified */
-- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, NULL, "avr2" },
-+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, NULL, "avr2" },
- /*
-- A M J LM E E E X R d S S O A
-- S U M PO L L I M A a t F ff r
-- M L P MV P P J E M t a R s c
-- XW M M M G P a r e h
-- X P A D t t ID */
-- { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, "1", "avr1" },
-- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, "2", "avr2" },
-- { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0x0060, 32, "25", "avr25" },
-- { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, "3", "avr3" },
-- { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0x0060, 32, "31", "avr31" },
-- { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0x0060, 32, "35", "avr35" },
-- { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0x0060, 32, "4", "avr4" },
-- { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0x0060, 32, "5", "avr5" },
-- { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, 32, "51", "avr51" },
-- { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0x0060, 32, "6", "avr6" },
-+ A M J LM E E E X R T d S S O A
-+ S U M PO L L I M A I a t F ff r
-+ M L P MV P P J E M N t a R s c
-+ XW M M M G P Y a r e h
-+ X P A D t t ID */
-+ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, "1", "avr1" },
-+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, "2", "avr2" },
-+ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, "25", "avr25" },
-+ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0x0060, 32, "3", "avr3" },
-+ { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0x0060, 32, "31", "avr31" },
-+ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, "35", "avr35" },
-+ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, "4", "avr4" },
-+ { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, "5", "avr5" },
-+ { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0x0060, 32, "51", "avr51" },
-+ { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, 32, "6", "avr6" },
-
-- { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0x2000, 0, "102", "avrxmega2" },
-- { 0, 1, 1, 1, 1, 1, 0, 1, 0, 0x2000, 0, "104", "avrxmega4" },
-- { 0, 1, 1, 1, 1, 1, 0, 1, 1, 0x2000, 0, "105", "avrxmega5" },
-- { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, 0, "106", "avrxmega6" },
-- { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0x2000, 0, "107", "avrxmega7" }
-+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0x0040, 0, "100", "avrtiny" },
-+ { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0x2000, 0, "102", "avrxmega2" },
-+ { 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0x2000, 0, "104", "avrxmega4" },
-+ { 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0x2000, 0, "105", "avrxmega5" },
-+ { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0x2000, 0, "106", "avrxmega6" },
-+ { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, 0, "107", "avrxmega7" }
- };
-
- const struct mcu_type_s avr_mcu_types[] = {
-diff -Naurp gcc/config/avr/avr.h gcc/config/avr/avr.h
---- gcc/config/avr/avr.h 2013-01-21 18:26:07.000000000 +0530
-+++ gcc/config/avr/avr.h 2013-01-21 18:40:04.000000000 +0530
-@@ -52,6 +52,9 @@ struct base_arch_s
- /* This core has the RAMPD special function register
- and thus also the RAMPX, RAMPY and RAMPZ registers. */
- int have_rampd;
-+
-+ /* This is a TINY core. */
-+ int tiny_p;
-
- /* Default start of data section address for architecture. */
- int default_data_section_start;
-@@ -83,6 +86,7 @@ enum avr_arch
- ARCH_AVR5,
- ARCH_AVR51,
- ARCH_AVR6,
-+ ARCH_AVRTINY,
- ARCH_AVRXMEGA2,
- ARCH_AVRXMEGA4,
- ARCH_AVRXMEGA5,
-@@ -213,6 +217,7 @@ enum
- #define AVR_3_BYTE_PC (AVR_HAVE_EIJMP_EICALL)
-
- #define AVR_XMEGA (avr_current_arch->xmega_p)
-+#define AVR_TINY (avr_current_arch->tiny_p)
-
- #define BITS_BIG_ENDIAN 0
- #define BYTES_BIG_ENDIAN 0
-@@ -342,7 +347,6 @@ enum reg_class {
- ALL_REGS, LIM_REG_CLASSES
- };
-
--
- #define N_REG_CLASSES (int)LIM_REG_CLASSES
-
- #define REG_CLASS_NAMES { \
-@@ -417,7 +421,7 @@ enum reg_class {
-
- #define ARG_POINTER_REGNUM 34
-
--#define STATIC_CHAIN_REGNUM 2
-+#define STATIC_CHAIN_REGNUM ((AVR_TINY) ? 18 :2)
-
- #define ELIMINABLE_REGS { \
- {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
-diff -Naurp gcc/config/avr/avr-mcus.def gcc/config/avr/avr-mcus.def
---- gcc/config/avr/avr-mcus.def 2012-09-10 16:16:27.000000000 +0530
-+++ gcc/config/avr/avr-mcus.def 2013-01-21 18:40:04.000000000 +0530
-@@ -231,6 +231,14 @@ AVR_MCU ("atxmega256d3", ARCH_AVRXME
- AVR_MCU ("avrxmega7", ARCH_AVRXMEGA7, NULL, 0, 0, 0x2000, 3, "x128a1")
- AVR_MCU ("atxmega128a1", ARCH_AVRXMEGA7, "__AVR_ATxmega128A1__", 0, 0, 0x2000, 3, "x128a1")
- AVR_MCU ("atxmega128a1u", ARCH_AVRXMEGA7, "__AVR_ATxmega128A1U__", 0, 0, 0x2000, 3, "x128a1u")
-+/* Tiny family */
-+AVR_MCU ("avrtiny", ARCH_AVRTINY, NULL, 0, 0, 0x0040, 1, "tn10")
-+AVR_MCU ("attiny4", ARCH_AVRTINY, "__AVR_ATtiny4__", 0, 0, 0x0040, 1, "tn4")
-+AVR_MCU ("attiny5", ARCH_AVRTINY, "__AVR_ATtiny5__", 0, 0, 0x0040, 1, "tn5")
-+AVR_MCU ("attiny9", ARCH_AVRTINY, "__AVR_ATtiny9__", 0, 0, 0x0040, 1, "tn9")
-+AVR_MCU ("attiny10", ARCH_AVRTINY, "__AVR_ATtiny10__", 0, 0, 0x0040, 1, "tn10")
-+AVR_MCU ("attiny20", ARCH_AVRTINY, "__AVR_ATtiny20__", 0, 0, 0x0040, 1, "tn20")
-+AVR_MCU ("attiny40", ARCH_AVRTINY, "__AVR_ATtiny40__", 0, 0, 0x0040, 1, "tn40")
- /* Assembler only. */
- AVR_MCU ("avr1", ARCH_AVR1, NULL, 0, 0, 0x0060, 1, "s1200")
- AVR_MCU ("at90s1200", ARCH_AVR1, "__AVR_AT90S1200__", 0, 0, 0x0060, 1, "s1200")
-diff -Naurp gcc/config/avr/avr.md gcc/config/avr/avr.md
---- gcc/config/avr/avr.md 2012-03-22 20:36:57.000000000 +0530
-+++ gcc/config/avr/avr.md 2013-01-21 18:40:04.000000000 +0530
-@@ -59,6 +59,11 @@
- (ZERO_REGNO 1) ; zero register r1
- ])
-
-+(define_constants
-+ [ (TMP_REGNO_TINY 16) ; r16 is temp register for TINY10
-+ (ZERO_REGNO_TINY 17) ; r17 is zero register for TINY10
-+ ])
-+
- (define_c_enum "unspec"
- [UNSPEC_STRLEN
- UNSPEC_MOVMEM
-@@ -158,9 +163,10 @@
- ;; lpm : ISA has no LPMX lpmx : ISA has LPMX
- ;; elpm : ISA has ELPM but no ELPMX elpmx : ISA has ELPMX
- ;; no_xmega: non-XMEGA core xmega : XMEGA core
-+;; no_tiny: non-TINY core tiny : TINY core
-
- (define_attr "isa"
-- "mov,movw, rjmp,jmp, ijmp,eijmp, lpm,lpmx, elpm,elpmx, no_xmega,xmega,
-+ "mov,movw, rjmp,jmp, ijmp,eijmp, lpm,lpmx, elpm,elpmx, no_xmega,xmega, no_tiny,tiny,
- standard"
- (const_string "standard"))
-
-@@ -212,9 +218,18 @@
- (match_test "AVR_XMEGA"))
- (const_int 1)
-
-+ (and (eq_attr "isa" "tiny")
-+ (match_test "AVR_TINY"))
-+ (const_int 1)
-+
- (and (eq_attr "isa" "no_xmega")
- (match_test "!AVR_XMEGA"))
- (const_int 1)
-+
-+ (and (eq_attr "isa" "no_tiny")
-+ (match_test "!AVR_TINY"))
-+ (const_int 1)
-+
- ] (const_int 0)))
-
-
-@@ -5413,18 +5428,18 @@
- (set_attr "cc" "clobber")])
-
- (define_insn "delay_cycles_2"
-- [(unspec_volatile [(match_operand:HI 0 "const_int_operand" "n")
-+ [(unspec_volatile [(match_operand:HI 0 "const_int_operand" "n,n")
- (const_int 2)]
- UNSPECV_DELAY_CYCLES)
- (set (match_operand:BLK 1 "" "")
- (unspec_volatile:BLK [(match_dup 1)] UNSPECV_MEMORY_BARRIER))
-- (clobber (match_scratch:HI 2 "=&w"))]
-+ (clobber (match_scratch:HI 2 "=&w,&d"))]
- ""
-- "ldi %A2,lo8(%0)
-- ldi %B2,hi8(%0)
-- 1: sbiw %A2,1
-- brne 1b"
-- [(set_attr "length" "4")
-+ "@
-+ ldi %A2,lo8(%0)\;ldi %B2,hi8(%0)\;1: sbiw %A2,1\;brne 1b
-+ ldi %A2,lo8(%0)\;ldi %B2,hi8(%0)\;1: subi %A2,1\;sbci %B2,0\;brne 1b"
-+ [(set_attr "length" "4,5")
-+ (set_attr "isa" "no_tiny,tiny")
- (set_attr "cc" "clobber")])
-
- (define_insn "delay_cycles_3"
-diff -Naurp gcc/config/avr/avr-tables.opt gcc/config/avr/avr-tables.opt
---- gcc/config/avr/avr-tables.opt 2012-09-20 12:53:55.000000000 +0530
-+++ gcc/config/avr/avr-tables.opt 2013-01-21 18:40:04.000000000 +0530
-@@ -579,20 +579,41 @@ EnumValue
- Enum(avr_mcu) String(atxmega128a1u) Value(184)
-
- EnumValue
--Enum(avr_mcu) String(avr1) Value(185)
-+Enum(avr_mcu) String(avrtiny) Value(185)
-
- EnumValue
--Enum(avr_mcu) String(at90s1200) Value(186)
-+Enum(avr_mcu) String(attiny4) Value(186)
-
- EnumValue
--Enum(avr_mcu) String(attiny11) Value(187)
-+Enum(avr_mcu) String(attiny5) Value(187)
-
- EnumValue
--Enum(avr_mcu) String(attiny12) Value(188)
-+Enum(avr_mcu) String(attiny9) Value(188)
-
- EnumValue
--Enum(avr_mcu) String(attiny15) Value(189)
-+Enum(avr_mcu) String(attiny10) Value(189)
-
- EnumValue
--Enum(avr_mcu) String(attiny28) Value(190)
-+Enum(avr_mcu) String(attiny20) Value(190)
-+
-+EnumValue
-+Enum(avr_mcu) String(attiny40) Value(191)
-+
-+EnumValue
-+Enum(avr_mcu) String(avr1) Value(192)
-+
-+EnumValue
-+Enum(avr_mcu) String(at90s1200) Value(193)
-+
-+EnumValue
-+Enum(avr_mcu) String(attiny11) Value(194)
-+
-+EnumValue
-+Enum(avr_mcu) String(attiny12) Value(195)
-+
-+EnumValue
-+Enum(avr_mcu) String(attiny15) Value(196)
-+
-+EnumValue
-+Enum(avr_mcu) String(attiny28) Value(197)
-
-diff -Naurp gcc/config/avr/t-multilib gcc/config/avr/t-multilib
---- gcc/config/avr/t-multilib 2012-09-20 12:53:55.000000000 +0530
-+++ gcc/config/avr/t-multilib 2013-01-21 18:40:04.000000000 +0530
-@@ -21,9 +21,9 @@
- # along with GCC; see the file COPYING3. If not see
- # <http://www.gnu.org/licenses/>.
-
--MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega2/mmcu=avrxmega4/mmcu=avrxmega5/mmcu=avrxmega6/mmcu=avrxmega7 msp8
-+MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega2/mmcu=avrxmega4/mmcu=avrxmega5/mmcu=avrxmega6/mmcu=avrxmega7/mmcu=avrtiny msp8
-
--MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega2 avrxmega4 avrxmega5 avrxmega6 avrxmega7 tiny-stack avr25/tiny-stack
-+MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega2 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny tiny-stack avr25/tiny-stack
-
- MULTILIB_EXCEPTIONS = \
- mmcu=avr3/msp8 \
-@@ -37,7 +37,8 @@ MULTILIB_EXCEPTIONS = \
- mmcu=avrxmega4/msp8 \
- mmcu=avrxmega5/msp8 \
- mmcu=avrxmega6/msp8 \
-- mmcu=avrxmega7/msp8
-+ mmcu=avrxmega7/msp8 \
-+ mmcu=avrtiny/msp8
-
- MULTILIB_MATCHES = \
- mmcu?avr2=mmcu?at90s2313 \
-@@ -210,4 +211,10 @@ MULTILIB_MATCHES = \
- mmcu?avrxmega6=mmcu?atxmega256a3bu \
- mmcu?avrxmega6=mmcu?atxmega256d3 \
- mmcu?avrxmega7=mmcu?atxmega128a1 \
-- mmcu?avrxmega7=mmcu?atxmega128a1u
-+ mmcu?avrxmega7=mmcu?atxmega128a1u \
-+ mmcu?avrtiny=mmcu?attiny4 \
-+ mmcu?avrtiny=mmcu?attiny5 \
-+ mmcu?avrtiny=mmcu?attiny9 \
-+ mmcu?avrtiny=mmcu?attiny10 \
-+ mmcu?avrtiny=mmcu?attiny20 \
-+ mmcu?avrtiny=mmcu?attiny40
-diff -Naurp libgcc/config/avr/lib1funcs.S libgcc/config/avr/lib1funcs.S
---- libgcc/config/avr/lib1funcs.S 2012-03-28 14:34:11.000000000 +0530
-+++ libgcc/config/avr/lib1funcs.S 2013-01-21 18:58:03.000000000 +0530
-@@ -22,8 +22,13 @@ a copy of the GCC Runtime Library Except
- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
- <http://www.gnu.org/licenses/>. */
-
-+#if defined (__AVR_TINY__)
-+#define __zero_reg__ r17
-+#define __tmp_reg__ r16
-+#else
- #define __zero_reg__ r1
- #define __tmp_reg__ r0
-+#endif
- #define __SREG__ 0x3f
- #if defined (__AVR_HAVE_SPH__)
- #define __SP_H__ 0x3e
-@@ -80,6 +85,15 @@ see the files COPYING3 and COPYING.RUNTI
- #define XJMP rjmp
- #endif
-
-+.macro wsubi r_arg1, i_arg2
-+#if defined (__AVR_TINY__)
-+ subi \r_arg1, lo8(\i_arg2)
-+ sbci \r_arg1+1, hi8(\i_arg2)
-+#else
-+ sbiw \r_arg1, \i_arg2
-+#endif
-+.endm
-+
- .macro DEFUN name
- .global \name
- .func \name
-@@ -150,12 +164,12 @@ ENDF __umulqihi3
- Multiplication 16 x 16 without MUL
- *******************************************************/
- #if defined (L_mulhi3)
--#define r_arg1L r24 /* multiplier Low */
--#define r_arg1H r25 /* multiplier High */
--#define r_arg2L r22 /* multiplicand Low */
--#define r_arg2H r23 /* multiplicand High */
-+#define r_arg1L 24 /* multiplier Low */
-+#define r_arg1H 25 /* multiplier High */
-+#define r_arg2L 22 /* multiplicand Low */
-+#define r_arg2H 23 /* multiplicand High */
- #define r_resL __tmp_reg__ /* result Low */
--#define r_resH r21 /* result High */
-+#define r_resH 21 /* result High */
-
- DEFUN __mulhi3
- clr r_resH ; clear result
-@@ -175,7 +189,7 @@ __mulhi3_skip1:
-
- lsr r_arg1H ; gets LSB of multiplier
- ror r_arg1L
-- sbiw r_arg1L,0
-+ wsubi r_arg1L,0
- brne __mulhi3_loop ; exit if multiplier = 0
- __mulhi3_exit:
- mov r_arg1H,r_resH ; result to return register
-@@ -230,22 +244,34 @@ ENDF __umulhisi3
- /*******************************************************
- Multiplication 32 x 32 without MUL
- *******************************************************/
--#define r_arg1L r22 /* multiplier Low */
--#define r_arg1H r23
--#define r_arg1HL r24
--#define r_arg1HH r25 /* multiplier High */
--
--#define r_arg2L r18 /* multiplicand Low */
--#define r_arg2H r19
--#define r_arg2HL r20
--#define r_arg2HH r21 /* multiplicand High */
-+#define r_arg1L 22 /* multiplier Low */
-+#define r_arg1H 23
-+#define r_arg1HL 24
-+#define r_arg1HH 25 /* multiplier High */
-+
-+#define r_arg2L 18 /* multiplicand Low */
-+#define r_arg2H 19
-+#define r_arg2HL 20
-+#define r_arg2HH 21 /* multiplicand High */
-
--#define r_resL r26 /* result Low */
--#define r_resH r27
--#define r_resHL r30
--#define r_resHH r31 /* result High */
-+#define r_resL 26 /* result Low */
-+#define r_resH 27
-+#define r_resHL 30
-+#define r_resHH 31 /* result High */
-
- DEFUN __mulsi3
-+#if defined (__AVR_TINY__)
-+ in r26,__SP_L__ ; safe to use X, as it is r_resL/H
-+ in r27,__SP_H__
-+ subi r26, lo8(-3) ; Add 3 to point past return address
-+ sbci r27, hi8(-3)
-+ push r_arg2L ; save callee saved regs
-+ push r_arg2H
-+ ld r_arg2L,X+ ; load from caller stack
-+ ld r_arg2H,X+
-+ ld r_arg2HL,X+
-+ ld r_arg2HH,X
-+#endif /* defined (__AVR_TINY__) */
- clr r_resHH ; clear result
- clr r_resHL ; clear result
- clr r_resH ; clear result
-@@ -268,7 +294,7 @@ __mulsi3_skip1:
- ror r_arg1H
- ror r_arg1L
- brne __mulsi3_loop
-- sbiw r_arg1HL,0
-+ wsubi r_arg1HL,0
- cpc r_arg1H,r_arg1L
- brne __mulsi3_loop ; exit if multiplier = 0
- __mulsi3_exit:
-@@ -276,6 +302,10 @@ __mulsi3_exit:
- mov_l r_arg1HL,r_resHL
- mov_h r_arg1H,r_resH
- mov_l r_arg1L,r_resL
-+#if defined (__AVR_TINY__)
-+ pop r_arg2H ; restore callee saved regs
-+ pop r_arg2L
-+#endif /* defined (__AVR_TINY__) */
- ret
- ENDF __mulsi3
-
-@@ -514,9 +544,12 @@ ENDF __mulpsi3
- #undef C0
-
- #else /* !HAVE_MUL */
--
- ;; C[0..2]: Expand Result
-+#if defined (__AVR_TINY__)
-+#define C0 16
-+#else
- #define C0 0
-+#endif /* defined (__AVR_TINY__) */
- #define C1 C0+1
- #define C2 21
-
-@@ -524,6 +557,17 @@ ENDF __mulpsi3
- ;; Clobbers: __tmp_reg__, R18, R19, R20, R21
-
- DEFUN __mulpsi3
-+#if defined (__AVR_TINY__)
-+ in r26,__SP_L__
-+ in r27,__SP_H__
-+ subi r26, lo8(-3) ; Add 3 to point past return address
-+ sbci r27, hi8(-3)
-+ push B0 ; save callee saved regs
-+ push B1
-+ ld B0,X+ ; load from caller stack
-+ ld B1,X+
-+ ld B2,X+
-+#endif /* defined (__AVR_TINY__) */
-
- ;; C[] = 0
- clr __tmp_reg__
-@@ -550,6 +594,10 @@ DEFUN __mulpsi3
- mov A2, C2
-
- clr __zero_reg__
-+#if defined (__AVR_TINY__)
-+ pop B1
-+ pop B0
-+#endif /* (__AVR_TINY__) */
- ret
- ENDF __mulpsi3
-
-@@ -618,6 +666,7 @@ ENDF __mulsqipsi3
- Multiplication 64 x 64
- *******************************************************/
-
-+#if !defined (__AVR_TINY__)
- #if defined (L_muldi3)
-
- ;; A[] = A[] * B[]
-@@ -855,6 +904,7 @@ ENDF __muldi3
- #undef A0
-
- #endif /* L_muldi3 */
-+#endif /* !defined (__AVR_TINY__) */
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-@@ -1027,7 +1077,7 @@ ENDF __divmodhi4
- #define r_cnt 21
-
- #if defined (L_udivmodpsi4)
--;; R24:R22 = R24:R22 udiv R20:R18
-+;; R24:R22 = R24:R24 udiv R20:R18
- ;; R20:R18 = R24:R22 umod R20:R18
- ;; Clobbers: R21, R25, R26
-
-@@ -1248,6 +1298,10 @@ ENDF __divmodsi4
- #endif /* defined (L_divmodsi4) */
-
-
-+/* *di routines use registers below R19 and won't work with tiny arch
-+ right now. */
-+
-+#if !defined (__AVR_TINY__)
- /*******************************************************
- Division 64 / 64
- Modulo 64 % 64
-@@ -1665,12 +1719,15 @@ ENDF __negdi2
- #undef A1
- #undef A0
-
-+#endif /* !defined (__AVR_TINY__) */
-+
-
- .section .text.libgcc.prologue, "ax", @progbits
-
- /**********************************
- * This is a prologue subroutine
- **********************************/
-+#if !defined (__AVR_TINY__)
- #if defined (L_prologue)
-
- ;; This function does not clobber T-flag; 64-bit division relies on it
-@@ -1776,6 +1833,7 @@ DEFUN __epilogue_restores__
- ret
- ENDF __epilogue_restores__
- #endif /* defined (L_epilogue) */
-+#endif /* !defined (__AVR_TINY__) */
-
- #ifdef L_exit
- .section .fini9,"ax", at progbits
-@@ -1820,8 +1878,13 @@ DEFUN __tablejump__
- #else
- ijmp
- #endif
--
--#else /* !HAVE_LPMX */
-+#elif defined (__AVR_TINY__)
-+ wsubi 30, -(__AVR_TINY_PM_BASE_ADDRESS__) ; Add PM offset to Z
-+ ld __tmp_reg__, Z+
-+ ld r31, Z ; Use ld instead of lpm to load Z
-+ mov r30, __tmp_reg__
-+ ijmp
-+#else /* !HAVE_LPMX && !AVR_TINY */
- lpm
- adiw r30, 1
- push r0
-@@ -1836,6 +1899,26 @@ DEFUN __tablejump__
- ENDF __tablejump__
- #endif /* defined (L_tablejump) */
-
-+#if defined(__AVR_TINY__)
-+#ifdef L_copy_data
-+ .section .init4,"ax", at progbits
-+ .global __do_copy_data
-+__do_copy_data:
-+ ldi r18, hi8(__data_end)
-+ ldi r26, lo8(__data_start)
-+ ldi r27, hi8(__data_start)
-+ ldi r30, lo8(__data_load_start + __AVR_TINY_PM_BASE_ADDRESS__)
-+ ldi r31, hi8(__data_load_start + __AVR_TINY_PM_BASE_ADDRESS__)
-+ rjmp .L__do_copy_data_start
-+.L__do_copy_data_loop:
-+ ld r19, z+
-+ st X+, r19
-+.L__do_copy_data_start:
-+ cpi r26, lo8(__data_end)
-+ cpc r27, r18
-+ brne .L__do_copy_data_loop
-+#endif
-+#else
- #ifdef L_copy_data
- .section .init4,"ax", at progbits
- DEFUN __do_copy_data
-@@ -1901,13 +1984,14 @@ DEFUN __do_copy_data
- #endif /* ELPM && RAMPD */
- ENDF __do_copy_data
- #endif /* L_copy_data */
-+#endif /* !defined (__AVR_TINY__) */
-
- /* __do_clear_bss is only necessary if there is anything in .bss section. */
-
- #ifdef L_clear_bss
- .section .init4,"ax", at progbits
- DEFUN __do_clear_bss
-- ldi r17, hi8(__bss_end)
-+ ldi r18, hi8(__bss_end)
- ldi r26, lo8(__bss_start)
- ldi r27, hi8(__bss_start)
- rjmp .do_clear_bss_start
-@@ -1915,7 +1999,7 @@ DEFUN __do_clear_bss
- st X+, __zero_reg__
- .do_clear_bss_start:
- cpi r26, lo8(__bss_end)
-- cpc r27, r17
-+ cpc r27, r18
- brne .do_clear_bss_loop
- ENDF __do_clear_bss
- #endif /* L_clear_bss */
-@@ -1951,7 +2035,7 @@ DEFUN __do_global_ctors
- ldi r29, hi8(__ctors_end)
- rjmp .L__do_global_ctors_start
- .L__do_global_ctors_loop:
-- sbiw r28, 2
-+ wsubi r28, 2
- mov_h r31, r29
- mov_l r30, r28
- XCALL __tablejump__
-@@ -1994,7 +2078,11 @@ DEFUN __do_global_dtors
- mov_h r31, r29
- mov_l r30, r28
- XCALL __tablejump__
-- adiw r28, 2
-+#if defined (__AVR_TINY__)
-+ wsubi r28, -2
-+#else
-+ adiw r28, 2
-+#endif
- .L__do_global_dtors_start:
- cpi r28, lo8(__dtors_end)
- cpc r29, r17
-@@ -2005,6 +2093,7 @@ ENDF __do_global_dtors
-
- .section .text.libgcc, "ax", @progbits
-
-+#if !defined (__AVR_TINY__)
- #ifdef L_tablejump_elpm
- DEFUN __tablejump_elpm__
- #if defined (__AVR_HAVE_ELPMX__)
-@@ -2035,7 +2124,9 @@ DEFUN __tablejump_elpm__
- #endif
- ENDF __tablejump_elpm__
- #endif /* defined (L_tablejump_elpm) */
-+#endif /* !defined (__AVR_TINY__) */
-
-+#if !defined (__AVR_TINY__)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Loading n bytes from Flash; n = 3,4
- ;; R22... = Flash[Z]
-@@ -2081,7 +2172,9 @@ ENDF __load_4
- #endif /* L_load_4 */
-
- #endif /* L_load_3 || L_load_3 */
-+#endif /* !defined (__AVR_TINY__) */
-
-+#if !defined (__AVR_TINY__)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Loading n bytes from Flash or RAM; n = 1,2,3,4
- ;; R22... = Flash[R21:Z] or RAM[Z] depending on R21.7
-@@ -2207,7 +2300,9 @@ ENDF __xload_4
- #endif /* L_xload_4 */
-
- #endif /* L_xload_{1|2|3|4} */
-+#endif /* if !defined (__AVR_TINY__) */
-
-+#if !defined (__AVR_TINY__)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; memcopy from Address Space __pgmx to RAM
- ;; R23:Z = Source Address
-@@ -2279,6 +2374,7 @@ ENDF __movmemx_hi
- #undef LOOP
-
- #endif /* L_movmemx */
-+#endif /* !defined (__AVR_TINY__) */
-
-
- .section .text.libgcc.builtins, "ax", @progbits
-diff -Naurp libgcc/config/avr/t-avr libgcc/config/avr/t-avr
---- libgcc/config/avr/t-avr 2012-01-10 15:12:10.000000000 +0530
-+++ libgcc/config/avr/t-avr 2013-01-21 18:40:04.000000000 +0530
-@@ -1,13 +1,9 @@
- LIB1ASMSRC = avr/lib1funcs.S
-+
- LIB1ASMFUNCS = \
- _mulqi3 \
- _mulhi3 \
-- _mulpsi3 _mulsqipsi3 \
-- _mulhisi3 \
-- _umulhisi3 \
-- _usmulhisi3 \
-- _muluhisi3 \
-- _mulshisi3 \
-+ _mulpsi3 \
- _mulsi3 \
- _udivmodqi4 \
- _divmodqi4 \
-@@ -16,19 +12,9 @@ LIB1ASMFUNCS = \
- _divmodpsi4 _udivmodpsi4 \
- _udivmodsi4 \
- _divmodsi4 \
-- _divdi3 _udivdi3 \
-- _muldi3 \
-- _udivmod64 \
-- _negdi2 \
-- _prologue \
-- _epilogue \
- _exit \
- _cleanup \
- _tablejump \
-- _tablejump_elpm \
-- _load_3 _load_4 \
-- _xload_1 _xload_2 _xload_3 _xload_4 \
-- _movmemx \
- _copy_data \
- _clear_bss \
- _ctors \
-@@ -38,22 +24,52 @@ LIB1ASMFUNCS = \
- _loop_ffsqi2 \
- _ctzsi2 \
- _ctzhi2 \
-- _clzdi2 \
- _clzsi2 \
- _clzhi2 \
-- _paritydi2 \
- _paritysi2 \
- _parityhi2 \
- _popcounthi2 \
- _popcountsi2 \
-- _popcountdi2 \
- _popcountqi2 \
- _bswapsi2 \
-+ _fmul _fmuls _fmulsu
-+
-+# The below functions either use registers that are not present
-+# in tiny core, or use a different register conventions (don't save
-+# callee saved regs, for example)
-+# _mulhisi3 and variations - clobber R18, R19
-+# All *di funcs - use regs < R16 or expect args in regs < R20
-+# _prologue and _epilogue save registers < R16
-+# _tablejump/_tablejump_elmp - expect lpm and elpm support
-+# _load ad _xload variations - expect lpm and elpm support
-+# _movmemx - expects elpm/lpm
-+
-+ifneq ($(MULTIFLAGS),-mmcu=avrtiny)
-+LIB1ASMFUNCS += \
-+ _mulsqipsi3 \
-+ _mulhisi3 \
-+ _umulhisi3 \
-+ _usmulhisi3 \
-+ _muluhisi3 \
-+ _mulshisi3 \
-+ _divdi3 _udivdi3 \
-+ _muldi3 \
-+ _udivmod64 \
-+ _negdi2 \
-+ _prologue \
-+ _epilogue \
-+ _tablejump_elpm \
-+ _load_3 _load_4 \
-+ _xload_1 _xload_2 _xload_3 _xload_4 \
-+ _movmemx \
-+ _clzdi2 \
-+ _paritydi2 \
-+ _popcountdi2 \
- _bswapdi2 \
- _ashldi3 _ashrdi3 _lshrdi3 _rotldi3 \
- _adddi3 _adddi3_s8 _subdi3 \
-- _cmpdi2 _cmpdi2_s8 \
-- _fmul _fmuls _fmulsu
-+ _cmpdi2 _cmpdi2_s8
-+endif
-
- LIB2FUNCS_EXCLUDE = \
- _moddi3 _umoddi3 \
diff --git a/302-gcc-mlist-devices.patch b/302-gcc-mlist-devices.patch
deleted file mode 100644
index 7663757..0000000
--- a/302-gcc-mlist-devices.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-diff --git gcc/common/config/avr/avr-common.c gcc/common/config/avr/avr-common.c
-index 0ede117..b2b8359 100644
---- gcc/common/config/avr/avr-common.c
-+++ gcc/common/config/avr/avr-common.c
-@@ -32,10 +32,39 @@ static const struct default_options avr_option_optimization_table[] =
- { OPT_LEVELS_NONE, 0, NULL, 0 }
- };
-
-+static bool
-+avr_handle_target_option (struct gcc_options *opts,
-+ struct gcc_options *opts_set, const struct cl_decoded_option *decoded,
-+ location_t loc)
-+{
-+ if (avr_list_supported_parts)
-+ {
-+ const struct mcu_type_s *list_part;
-+
-+ fprintf (stdout, "List of parts supported by avr-gcc:\n");
-+
-+ for (list_part = &avr_mcu_types[0]; list_part->name; list_part++)
-+ {
-+ if (!list_part->macro)
-+ list_part++;
-+ fprintf (stdout, "%-20s%s\n", list_part->name, list_part->macro);
-+ }
-+
-+ fprintf (stdout, "\n");
-+
-+ }
-+
-+ return true;
-+}
-+
-+
- #undef TARGET_OPTION_OPTIMIZATION_TABLE
- #define TARGET_OPTION_OPTIMIZATION_TABLE avr_option_optimization_table
-
- #undef TARGET_EXCEPT_UNWIND_INFO
- #define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
-
-+#undef TARGET_HANDLE_OPTION
-+#define TARGET_HANDLE_OPTION avr_handle_target_option
-+
- struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
-diff --git gcc/config/avr/avr.opt gcc/config/avr/avr.opt
-index 0ad38c6..3649c5b 100644
---- gcc/config/avr/avr.opt
-+++ gcc/config/avr/avr.opt
-@@ -66,6 +66,10 @@ mpmem-wrap-around
- Target Report
- Make the linker relaxation machine assume that a program counter wrap-around occurs.
-
-+mlist-devices
-+Target RejectNegative Var(avr_list_supported_parts)
-+Print the list of parts supported while printing --target-help
-+
- maccumulate-args
- Target Report Mask(ACCUMULATE_OUTGOING_ARGS)
- Accumulate outgoing function arguments and acquire/release the needed stack space for outpoing function arguments in function prologue/epilogue. Without this option, outgoing arguments are pushed before calling a function and popped afterwards. This option can lead to reduced code size for functions that call many functions that get their arguments on the stack like, for example printf.
diff --git a/303-ata6289-architecture-correction.patch b/303-ata6289-architecture-correction.patch
deleted file mode 100644
index d955524..0000000
--- a/303-ata6289-architecture-correction.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-diff -Naurp gcc/config/avr/avr-mcus.def gcc/config/avr/avr-mcus.def
---- gcc/config/avr/avr-mcus.def 2012-12-21 15:00:20.000000000 +0530
-+++ gcc/config/avr/avr-mcus.def 2012-12-21 14:52:57.000000000 +0530
-@@ -48,7 +48,6 @@ AVR_MCU ("at90c8534", ARCH_AV
- AVR_MCU ("at90s8535", ARCH_AVR2, "__AVR_AT90S8535__", 0, 0, 0x0060, 1, "s8535")
- /* Classic + MOVW, <= 8K. */
- AVR_MCU ("avr25", ARCH_AVR25, NULL, 0, 0, 0x0060, 1, "tn85")
--AVR_MCU ("ata6289", ARCH_AVR25, "__AVR_ATA6289__", 0, 0, 0x0100, 1, "a6289")
- AVR_MCU ("attiny13", ARCH_AVR25, "__AVR_ATtiny13__", 1, 0, 0x0060, 1, "tn13")
- AVR_MCU ("attiny13a", ARCH_AVR25, "__AVR_ATtiny13A__", 1, 0, 0x0060, 1, "tn13a")
- AVR_MCU ("attiny2313", ARCH_AVR25, "__AVR_ATtiny2313__", 1, 0, 0x0060, 1, "tn2313")
-@@ -92,6 +91,7 @@ AVR_MCU ("atmega32u2", ARCH_AV
- AVR_MCU ("attiny167", ARCH_AVR35, "__AVR_ATtiny167__", 0, 0, 0x0100, 1, "tn167")
- /* Enhanced, <= 8K. */
- AVR_MCU ("avr4", ARCH_AVR4, NULL, 0, 0, 0x0060, 1, "m8")
-+AVR_MCU ("ata6289", ARCH_AVR4, "__AVR_ATA6289__", 0, 0, 0x0100, 1, "a6289")
- AVR_MCU ("atmega8", ARCH_AVR4, "__AVR_ATmega8__", 0, 0, 0x0060, 1, "m8")
- AVR_MCU ("atmega48", ARCH_AVR4, "__AVR_ATmega48__", 0, 0, 0x0100, 1, "m48")
- AVR_MCU ("atmega48a", ARCH_AVR4, "__AVR_ATmega48A__", 0, 0, 0x0100, 1, "m48a")
-diff -Naurp gcc/config/avr/t-multilib gcc/config/avr/t-multilib
---- gcc/config/avr/t-multilib 2012-12-21 15:00:06.000000000 +0530
-+++ gcc/config/avr/t-multilib 2012-12-21 14:56:29.000000000 +0530
-@@ -53,7 +53,6 @@ MULTILIB_MATCHES = \
- mmcu?avr2=mmcu?at90s8515 \
- mmcu?avr2=mmcu?at90c8534 \
- mmcu?avr2=mmcu?at90s8535 \
-- mmcu?avr25=mmcu?ata6289 \
- mmcu?avr25=mmcu?attiny13 \
- mmcu?avr25=mmcu?attiny13a \
- mmcu?avr25=mmcu?attiny2313 \
-@@ -89,6 +88,7 @@ MULTILIB_MATCHES = \
- mmcu?avr35=mmcu?atmega16u2 \
- mmcu?avr35=mmcu?atmega32u2 \
- mmcu?avr35=mmcu?attiny167 \
-+ mmcu?avr4=mmcu?ata6289 \
- mmcu?avr4=mmcu?atmega8 \
- mmcu?avr4=mmcu?atmega48 \
- mmcu?avr4=mmcu?atmega48a \
diff --git a/400-gcc-public-devices-support.patch b/400-gcc-public-devices-support.patch
deleted file mode 100644
index 48c19a7..0000000
--- a/400-gcc-public-devices-support.patch
+++ /dev/null
@@ -1,222 +0,0 @@
-diff -Naurp gcc/config/avr/avr-mcus.def gcc/config/avr/avr-mcus.def
---- gcc/config/avr/avr-mcus.def 2012-12-21 16:12:57.000000000 +0530
-+++ gcc/config/avr/avr-mcus.def 2012-12-21 16:12:12.000000000 +0530
-@@ -32,7 +32,7 @@
-
- /* "avr2" must be first for the "0" default to work as intended. */
-
--/* Classic, <= 8K. */
-+/* Classic, <= 8K, 2-byte PC. */
- AVR_MCU ("avr2", ARCH_AVR2, NULL, 0, 1, 0x0060, 6, "s8515")
- AVR_MCU ("at90s2313", ARCH_AVR2, "__AVR_AT90S2313__", 1, 0, 0x0060, 1, "s2313")
- AVR_MCU ("at90s2323", ARCH_AVR2, "__AVR_AT90S2323__", 1, 0, 0x0060, 1, "s2323")
-@@ -46,8 +46,9 @@ AVR_MCU ("at90s4434", ARCH_AV
- AVR_MCU ("at90s8515", ARCH_AVR2, "__AVR_AT90S8515__", 0, 1, 0x0060, 1, "s8515")
- AVR_MCU ("at90c8534", ARCH_AVR2, "__AVR_AT90C8534__", 0, 0, 0x0060, 1, "c8534")
- AVR_MCU ("at90s8535", ARCH_AVR2, "__AVR_AT90S8535__", 0, 0, 0x0060, 1, "s8535")
--/* Classic + MOVW, <= 8K. */
-+/* Classic + MOVW/LPMX, <= 8K + 2-byte PC. */
- AVR_MCU ("avr25", ARCH_AVR25, NULL, 0, 0, 0x0060, 1, "tn85")
-+AVR_MCU ("ata5272", ARCH_AVR25, "__AVR_ATA5272__", 0, 0, 0x0100, 1, "a5272")
- AVR_MCU ("attiny13", ARCH_AVR25, "__AVR_ATtiny13__", 1, 0, 0x0060, 1, "tn13")
- AVR_MCU ("attiny13a", ARCH_AVR25, "__AVR_ATtiny13A__", 1, 0, 0x0060, 1, "tn13a")
- AVR_MCU ("attiny2313", ARCH_AVR25, "__AVR_ATtiny2313__", 1, 0, 0x0060, 1, "tn2313")
-@@ -72,30 +73,37 @@ AVR_MCU ("attiny43u", ARCH_AV
- AVR_MCU ("attiny87", ARCH_AVR25, "__AVR_ATtiny87__", 0, 0, 0x0100, 1, "tn87")
- AVR_MCU ("attiny48", ARCH_AVR25, "__AVR_ATtiny48__", 0, 0, 0x0100, 1, "tn48")
- AVR_MCU ("attiny88", ARCH_AVR25, "__AVR_ATtiny88__", 0, 0, 0x0100, 1, "tn88")
-+AVR_MCU ("attiny828", ARCH_AVR25, "__AVR_ATtiny828__", 0, 0, 0x0100, 1, "tn828")
- AVR_MCU ("at86rf401", ARCH_AVR25, "__AVR_AT86RF401__", 0, 0, 0x0060, 1, "86401")
--/* Classic, > 8K, <= 64K. */
-+/* Classic, > 8K, <= 64K + 2-byte PC + { JMP/CALL }. */
- AVR_MCU ("avr3", ARCH_AVR3, NULL, 0, 0, 0x0060, 1, "43355")
- AVR_MCU ("at43usb355", ARCH_AVR3, "__AVR_AT43USB355__", 0, 0, 0x0060, 1, "43355")
- AVR_MCU ("at76c711", ARCH_AVR3, "__AVR_AT76C711__", 0, 0, 0x0060, 1, "76711")
--/* Classic, == 128K. */
-+/* Classic, == 128K + 2-byte PC + {JMP/CALL, ELPM }. */
- AVR_MCU ("avr31", ARCH_AVR31, NULL, 0, 1, 0x0060, 2, "m103")
- AVR_MCU ("atmega103", ARCH_AVR31, "__AVR_ATmega103__", 0, 1, 0x0060, 2, "m103")
- AVR_MCU ("at43usb320", ARCH_AVR31, "__AVR_AT43USB320__", 0, 0, 0x0060, 2, "43320")
--/* Classic + MOVW + JMP/CALL. */
-+/* Classic, >=16K, <=64K + 2-byte PC + MOVW/LPMX + JMP/CALL. */
- AVR_MCU ("avr35", ARCH_AVR35, NULL, 0, 0, 0x0100, 1, "usb162")
-+AVR_MCU ("ata5505", ARCH_AVR35, "__AVR_ATA5505__", 0, 0, 0x0100, 1, "a5505")
- AVR_MCU ("at90usb82", ARCH_AVR35, "__AVR_AT90USB82__", 0, 0, 0x0100, 1, "usb82")
- AVR_MCU ("at90usb162", ARCH_AVR35, "__AVR_AT90USB162__", 0, 0, 0x0100, 1, "usb162")
- AVR_MCU ("atmega8u2", ARCH_AVR35, "__AVR_ATmega8U2__", 0, 0, 0x0100, 1, "m8u2")
- AVR_MCU ("atmega16u2", ARCH_AVR35, "__AVR_ATmega16U2__", 0, 0, 0x0100, 1, "m16u2")
- AVR_MCU ("atmega32u2", ARCH_AVR35, "__AVR_ATmega32U2__", 0, 0, 0x0100, 1, "m32u2")
- AVR_MCU ("attiny167", ARCH_AVR35, "__AVR_ATtiny167__", 0, 0, 0x0100, 1, "tn167")
--/* Enhanced, <= 8K. */
-+AVR_MCU ("attiny1634", ARCH_AVR35, "__AVR_ATtiny1634__", 0, 0, 0x0100, 1, "tn1634")
-+/* Enhanced, <= 8K + 2-byte PC + { MOVW/LPMX, MUL }. */
- AVR_MCU ("avr4", ARCH_AVR4, NULL, 0, 0, 0x0060, 1, "m8")
- AVR_MCU ("ata6289", ARCH_AVR4, "__AVR_ATA6289__", 0, 0, 0x0100, 1, "a6289")
-+AVR_MCU ("ata6285", ARCH_AVR4, "__AVR_ATA6285__", 0, 0, 0x0100, 1, "a6285")
-+AVR_MCU ("ata6286", ARCH_AVR4, "__AVR_ATA6286__", 0, 0, 0x0100, 1, "a6286")
- AVR_MCU ("atmega8", ARCH_AVR4, "__AVR_ATmega8__", 0, 0, 0x0060, 1, "m8")
-+AVR_MCU ("atmega8a", ARCH_AVR4, "__AVR_ATmega8A__", 0, 0, 0x0060, 1, "m8a")
- AVR_MCU ("atmega48", ARCH_AVR4, "__AVR_ATmega48__", 0, 0, 0x0100, 1, "m48")
- AVR_MCU ("atmega48a", ARCH_AVR4, "__AVR_ATmega48A__", 0, 0, 0x0100, 1, "m48a")
- AVR_MCU ("atmega48p", ARCH_AVR4, "__AVR_ATmega48P__", 0, 0, 0x0100, 1, "m48p")
-+AVR_MCU ("atmega48pa", ARCH_AVR4, "__AVR_ATmega48PA__", 0, 0, 0x0100, 1, "m48pa")
- AVR_MCU ("atmega88", ARCH_AVR4, "__AVR_ATmega88__", 0, 0, 0x0100, 1, "m88")
- AVR_MCU ("atmega88a", ARCH_AVR4, "__AVR_ATmega88A__", 0, 0, 0x0100, 1, "m88a")
- AVR_MCU ("atmega88p", ARCH_AVR4, "__AVR_ATmega88P__", 0, 0, 0x0100, 1, "m88p")
-@@ -109,8 +117,10 @@ AVR_MCU ("at90pwm2b", ARCH_AV
- AVR_MCU ("at90pwm3", ARCH_AVR4, "__AVR_AT90PWM3__", 0, 0, 0x0100, 1, "90pwm3")
- AVR_MCU ("at90pwm3b", ARCH_AVR4, "__AVR_AT90PWM3B__", 0, 0, 0x0100, 1, "90pwm3b")
- AVR_MCU ("at90pwm81", ARCH_AVR4, "__AVR_AT90PWM81__", 0, 0, 0x0100, 1, "90pwm81")
--/* Enhanced, > 8K, <= 64K. */
-+/* Enhanced, > 8K, <= 64K + 2-byte PC + { MOVW/LPMX, JMP/CALL, MUL }. */
- AVR_MCU ("avr5", ARCH_AVR5, NULL, 0, 0, 0x0060, 1, "m16")
-+AVR_MCU ("ata5790", ARCH_AVR5, "__AVR_ATA5790__", 0, 0, 0x0100, 1, "a5790")
-+AVR_MCU ("ata5795", ARCH_AVR5, "__AVR_ATA5795__", 0, 0, 0x0100, 1, "a5795")
- AVR_MCU ("atmega16", ARCH_AVR5, "__AVR_ATmega16__", 0, 0, 0x0060, 1, "m16")
- AVR_MCU ("atmega16a", ARCH_AVR5, "__AVR_ATmega16A__", 0, 0, 0x0060, 1, "m16a")
- AVR_MCU ("atmega161", ARCH_AVR5, "__AVR_ATmega161__", 0, 0, 0x0060, 1, "m161")
-@@ -118,17 +128,21 @@ AVR_MCU ("atmega162", ARCH_AV
- AVR_MCU ("atmega163", ARCH_AVR5, "__AVR_ATmega163__", 0, 0, 0x0060, 1, "m163")
- AVR_MCU ("atmega164a", ARCH_AVR5, "__AVR_ATmega164A__", 0, 0, 0x0100, 1, "m164a")
- AVR_MCU ("atmega164p", ARCH_AVR5, "__AVR_ATmega164P__", 0, 0, 0x0100, 1, "m164p")
-+AVR_MCU ("atmega164pa", ARCH_AVR5, "__AVR_ATmega164PA__", 0, 0, 0x0100, 1, "m164pa")
- AVR_MCU ("atmega165", ARCH_AVR5, "__AVR_ATmega165__", 0, 0, 0x0100, 1, "m165")
- AVR_MCU ("atmega165a", ARCH_AVR5, "__AVR_ATmega165A__", 0, 0, 0x0100, 1, "m165a")
- AVR_MCU ("atmega165p", ARCH_AVR5, "__AVR_ATmega165P__", 0, 0, 0x0100, 1, "m165p")
-+AVR_MCU ("atmega165pa", ARCH_AVR5, "__AVR_ATmega165PA__", 0, 0, 0x0100, 1, "m165pa")
- AVR_MCU ("atmega168", ARCH_AVR5, "__AVR_ATmega168__", 0, 0, 0x0100, 1, "m168")
- AVR_MCU ("atmega168a", ARCH_AVR5, "__AVR_ATmega168A__", 0, 0, 0x0100, 1, "m168a")
- AVR_MCU ("atmega168p", ARCH_AVR5, "__AVR_ATmega168P__", 0, 0, 0x0100, 1, "m168p")
-+AVR_MCU ("atmega168pa", ARCH_AVR5, "__AVR_ATmega168PA__", 0, 0, 0x0100, 1, "m168pa")
- AVR_MCU ("atmega169", ARCH_AVR5, "__AVR_ATmega169__", 0, 0, 0x0100, 1, "m169")
- AVR_MCU ("atmega169a", ARCH_AVR5, "__AVR_ATmega169A__", 0, 0, 0x0100, 1, "m169a")
- AVR_MCU ("atmega169p", ARCH_AVR5, "__AVR_ATmega169P__", 0, 0, 0x0100, 1, "m169p")
- AVR_MCU ("atmega169pa", ARCH_AVR5, "__AVR_ATmega169PA__", 0, 0, 0x0100, 1, "m169pa")
- AVR_MCU ("atmega32", ARCH_AVR5, "__AVR_ATmega32__", 0, 0, 0x0060, 1, "m32")
-+AVR_MCU ("atmega32a", ARCH_AVR5, "__AVR_ATmega32A__", 0, 0, 0x0060, 1, "m32a")
- AVR_MCU ("atmega323", ARCH_AVR5, "__AVR_ATmega323__", 0, 0, 0x0060, 1, "m323")
- AVR_MCU ("atmega324a", ARCH_AVR5, "__AVR_ATmega324A__", 0, 0, 0x0100, 1, "m324a")
- AVR_MCU ("atmega324p", ARCH_AVR5, "__AVR_ATmega324P__", 0, 0, 0x0100, 1, "m324p")
-@@ -136,9 +150,11 @@ AVR_MCU ("atmega324pa", ARCH_AV
- AVR_MCU ("atmega325", ARCH_AVR5, "__AVR_ATmega325__", 0, 0, 0x0100, 1, "m325")
- AVR_MCU ("atmega325a", ARCH_AVR5, "__AVR_ATmega325A__", 0, 0, 0x0100, 1, "m325a")
- AVR_MCU ("atmega325p", ARCH_AVR5, "__AVR_ATmega325P__", 0, 0, 0x0100, 1, "m325p")
-+AVR_MCU ("atmega325pa", ARCH_AVR5, "__AVR_ATmega325PA__", 0, 0, 0x0100, 1, "m325pa")
- AVR_MCU ("atmega3250", ARCH_AVR5, "__AVR_ATmega3250__", 0, 0, 0x0100, 1, "m3250")
- AVR_MCU ("atmega3250a", ARCH_AVR5, "__AVR_ATmega3250A__", 0, 0, 0x0100, 1, "m3250a")
- AVR_MCU ("atmega3250p", ARCH_AVR5, "__AVR_ATmega3250P__", 0, 0, 0x0100, 1, "m3250p")
-+AVR_MCU ("atmega3250pa", ARCH_AVR5, "__AVR_ATmega3250PA__", 0, 0, 0x0100, 1, "m3250pa")
- AVR_MCU ("atmega328", ARCH_AVR5, "__AVR_ATmega328__", 0, 0, 0x0100, 1, "m328")
- AVR_MCU ("atmega328p", ARCH_AVR5, "__AVR_ATmega328P__", 0, 0, 0x0100, 1, "m328p")
- AVR_MCU ("atmega329", ARCH_AVR5, "__AVR_ATmega329__", 0, 0, 0x0100, 1, "m329")
-@@ -148,8 +164,10 @@ AVR_MCU ("atmega329pa", ARCH_AV
- AVR_MCU ("atmega3290", ARCH_AVR5, "__AVR_ATmega3290__", 0, 0, 0x0100, 1, "m3290")
- AVR_MCU ("atmega3290a", ARCH_AVR5, "__AVR_ATmega3290A__", 0, 0, 0x0100, 1, "m3290a")
- AVR_MCU ("atmega3290p", ARCH_AVR5, "__AVR_ATmega3290P__", 0, 0, 0x0100, 1, "m3290p")
-+AVR_MCU ("atmega3290pa", ARCH_AVR5, "__AVR_ATmega3290PA__", 0, 0, 0x0100, 1, "m3290pa")
- AVR_MCU ("atmega406", ARCH_AVR5, "__AVR_ATmega406__", 0, 0, 0x0100, 1, "m406")
- AVR_MCU ("atmega64", ARCH_AVR5, "__AVR_ATmega64__", 0, 0, 0x0100, 1, "m64")
-+AVR_MCU ("atmega64a", ARCH_AVR5, "__AVR_ATmega64A__", 0, 0, 0x0100, 1, "m64a")
- AVR_MCU ("atmega640", ARCH_AVR5, "__AVR_ATmega640__", 0, 0, 0x0200, 1, "m640")
- AVR_MCU ("atmega644", ARCH_AVR5, "__AVR_ATmega644__", 0, 0, 0x0100, 1, "m644")
- AVR_MCU ("atmega644a", ARCH_AVR5, "__AVR_ATmega644A__", 0, 0, 0x0100, 1, "m644a")
-@@ -165,13 +183,18 @@ AVR_MCU ("atmega649", ARCH_AV
- AVR_MCU ("atmega649a", ARCH_AVR5, "__AVR_ATmega649A__", 0, 0, 0x0100, 1, "m649a")
- AVR_MCU ("atmega649p", ARCH_AVR5, "__AVR_ATmega649P__", 0, 0, 0x0100, 1, "m649p")
- AVR_MCU ("atmega6490", ARCH_AVR5, "__AVR_ATmega6490__", 0, 0, 0x0100, 1, "m6490")
-+AVR_MCU ("atmega6490a", ARCH_AVR5, "__AVR_ATmega6490A__", 0, 0, 0x0100, 1, "m6490a")
-+AVR_MCU ("atmega6490p", ARCH_AVR5, "__AVR_ATmega6490P__", 0, 0, 0x0100, 1, "m6490p")
- AVR_MCU ("atmega16hva", ARCH_AVR5, "__AVR_ATmega16HVA__", 0, 0, 0x0100, 1, "m16hva")
- AVR_MCU ("atmega16hva2", ARCH_AVR5, "__AVR_ATmega16HVA2__", 0, 0, 0x0100, 1, "m16hva2")
- AVR_MCU ("atmega16hvb", ARCH_AVR5, "__AVR_ATmega16HVB__", 0, 0, 0x0100, 1, "m16hvb")
-+AVR_MCU ("atmega16hvbrevb", ARCH_AVR5, "__AVR_ATmega16HVBREVB__", 0, 0, 0x0100, 1, "m16hvbrevb")
- AVR_MCU ("atmega32hvb", ARCH_AVR5, "__AVR_ATmega32HVB__", 0, 0, 0x0100, 1, "m32hvb")
-+AVR_MCU ("atmega32hvbrevb", ARCH_AVR5, "__AVR_ATmega32HVBREVB__", 0, 0, 0x0100, 1, "m32hvbrevb")
- AVR_MCU ("atmega64hve", ARCH_AVR5, "__AVR_ATmega64HVE__", 0, 0, 0x0100, 1, "m64hve")
- AVR_MCU ("at90can32", ARCH_AVR5, "__AVR_AT90CAN32__", 0, 0, 0x0100, 1, "can32")
- AVR_MCU ("at90can64", ARCH_AVR5, "__AVR_AT90CAN64__", 0, 0, 0x0100, 1, "can64")
-+AVR_MCU ("at90pwm161", ARCH_AVR5, "__AVR_AT90PWM161__", 0, 0, 0x0100, 1, "90pwm161")
- AVR_MCU ("at90pwm216", ARCH_AVR5, "__AVR_AT90PWM216__", 0, 0, 0x0100, 1, "90pwm216")
- AVR_MCU ("at90pwm316", ARCH_AVR5, "__AVR_AT90PWM316__", 0, 0, 0x0100, 1, "90pwm316")
- AVR_MCU ("atmega32c1", ARCH_AVR5, "__AVR_ATmega32C1__", 0, 0, 0x0100, 1, "m32c1")
-@@ -187,50 +210,76 @@ AVR_MCU ("at90usb646", ARCH_AV
- AVR_MCU ("at90usb647", ARCH_AVR5, "__AVR_AT90USB647__", 0, 0, 0x0100, 1, "usb647")
- AVR_MCU ("at94k", ARCH_AVR5, "__AVR_AT94K__", 0, 0, 0x0060, 1, "at94k")
- AVR_MCU ("m3000", ARCH_AVR5, "__AVR_M3000__", 0, 0, 0x1000, 1, "m3000")
--/* Enhanced, == 128K. */
-+/* Enhanced, == 128K + 2-byte PC + { MOVW/LPMX, JMP/CALL, MUL, ELPM, ELPMX }. */
- AVR_MCU ("avr51", ARCH_AVR51, NULL, 0, 0, 0x0100, 2, "m128")
- AVR_MCU ("atmega128", ARCH_AVR51, "__AVR_ATmega128__", 0, 0, 0x0100, 2, "m128")
-+AVR_MCU ("atmega128a", ARCH_AVR51, "__AVR_ATmega128A__", 0, 0, 0x0100, 2, "m128a")
- AVR_MCU ("atmega1280", ARCH_AVR51, "__AVR_ATmega1280__", 0, 0, 0x0200, 2, "m1280")
- AVR_MCU ("atmega1281", ARCH_AVR51, "__AVR_ATmega1281__", 0, 0, 0x0200, 2, "m1281")
-+AVR_MCU ("atmega1284", ARCH_AVR51, "__AVR_ATmega1284__", 0, 0, 0x0100, 2, "m1284")
- AVR_MCU ("atmega1284p", ARCH_AVR51, "__AVR_ATmega1284P__", 0, 0, 0x0100, 2, "m1284p")
- AVR_MCU ("atmega128rfa1", ARCH_AVR51, "__AVR_ATmega128RFA1__", 0, 0, 0x0200, 2, "m128rfa1")
- AVR_MCU ("at90can128", ARCH_AVR51, "__AVR_AT90CAN128__", 0, 0, 0x0100, 2, "can128")
- AVR_MCU ("at90usb1286", ARCH_AVR51, "__AVR_AT90USB1286__", 0, 0, 0x0100, 2, "usb1286")
- AVR_MCU ("at90usb1287", ARCH_AVR51, "__AVR_AT90USB1287__", 0, 0, 0x0100, 2, "usb1287")
--/* 3-Byte PC. */
-+/* Enhanced, == 256K + 3-Byte PC + { MOVW/LPMX, JMP/CALL, MUL, ELPM, ELPMX }. */
- AVR_MCU ("avr6", ARCH_AVR6, NULL, 0, 0, 0x0200, 4, "m2561")
- AVR_MCU ("atmega2560", ARCH_AVR6, "__AVR_ATmega2560__", 0, 0, 0x0200, 4, "m2560")
- AVR_MCU ("atmega2561", ARCH_AVR6, "__AVR_ATmega2561__", 0, 0, 0x0200, 4, "m2561")
- /* Xmega, 16K <= Flash < 64K, RAM <= 64K */
- AVR_MCU ("avrxmega2", ARCH_AVRXMEGA2, NULL, 0, 0, 0x2000, 1, "x32a4")
-+AVR_MCU ("atxmega8e5", ARCH_AVRXMEGA2, "__AVR_ATxmega8E5__", 0, 0, 0x2000, 1, "x8e5")
- AVR_MCU ("atxmega16a4", ARCH_AVRXMEGA2, "__AVR_ATxmega16A4__", 0, 0, 0x2000, 1, "x16a4")
-+AVR_MCU ("atxmega16a4u", ARCH_AVRXMEGA2, "__AVR_ATxmega16A4U__", 0, 0, 0x2000, 1, "x16a4u")
-+AVR_MCU ("atxmega16c4", ARCH_AVRXMEGA2, "__AVR_ATxmega16C4__", 0, 0, 0x2000, 1, "x16c4")
- AVR_MCU ("atxmega16d4", ARCH_AVRXMEGA2, "__AVR_ATxmega16D4__", 0, 0, 0x2000, 1, "x16d4")
-+AVR_MCU ("atxmega16e5", ARCH_AVRXMEGA2, "__AVR_ATxmega16E5__", 0, 0, 0x2000, 1, "x16e5")
- AVR_MCU ("atxmega16x1", ARCH_AVRXMEGA2, "__AVR_ATxmega16X1__", 0, 0, 0x2000, 1, "x16x1")
- AVR_MCU ("atxmega32a4", ARCH_AVRXMEGA2, "__AVR_ATxmega32A4__", 0, 0, 0x2000, 1, "x32a4")
-+AVR_MCU ("atxmega32a4u", ARCH_AVRXMEGA2, "__AVR_ATxmega32A4U__", 0, 0, 0x2000, 1, "x32a4u")
-+AVR_MCU ("atxmega32c4", ARCH_AVRXMEGA2, "__AVR_ATxmega32C4__", 0, 0, 0x2000, 1, "x32c4")
- AVR_MCU ("atxmega32d4", ARCH_AVRXMEGA2, "__AVR_ATxmega32D4__", 0, 0, 0x2000, 1, "x32d4")
-+AVR_MCU ("atxmega32e5", ARCH_AVRXMEGA2, "__AVR_ATxmega32E5__", 0, 0, 0x2000, 1, "x32e5")
- AVR_MCU ("atxmega32x1", ARCH_AVRXMEGA2, "__AVR_ATxmega32X1__", 0, 0, 0x2000, 1, "x32x1")
- /* Xmega, 64K < Flash <= 128K, RAM <= 64K */
- AVR_MCU ("avrxmega4", ARCH_AVRXMEGA4, NULL, 0, 0, 0x2000, 2, "x64a4")
- AVR_MCU ("atxmega64a3", ARCH_AVRXMEGA4, "__AVR_ATxmega64A3__", 0, 0, 0x2000, 2, "x64a3")
-+AVR_MCU ("atxmega64a3u", ARCH_AVRXMEGA4, "__AVR_ATxmega64A3U__", 0, 0, 0x2000, 2, "x64a3u")
-+AVR_MCU ("atxmega64a4u", ARCH_AVRXMEGA4, "__AVR_ATxmega64A4U__", 0, 0, 0x2000, 2, "x64a4u")
-+AVR_MCU ("atxmega64b1", ARCH_AVRXMEGA4, "__AVR_ATxmega64B1__", 0, 0, 0x2000, 2, "x64b1")
-+AVR_MCU ("atxmega64b3", ARCH_AVRXMEGA4, "__AVR_ATxmega64B3__", 0, 0, 0x2000, 2, "x64b3")
-+AVR_MCU ("atxmega64c3", ARCH_AVRXMEGA4, "__AVR_ATxmega64C3__", 0, 0, 0x2000, 2, "x64c3")
- AVR_MCU ("atxmega64d3", ARCH_AVRXMEGA4, "__AVR_ATxmega64D3__", 0, 0, 0x2000, 2, "x64d3")
-+AVR_MCU ("atxmega64d4", ARCH_AVRXMEGA4, "__AVR_ATxmega64D4__", 0, 0, 0x2000, 2, "x64d4")
- /* Xmega, 64K < Flash <= 128K, RAM > 64K */
- AVR_MCU ("avrxmega5", ARCH_AVRXMEGA5, NULL, 0, 0, 0x2000, 2, "x64a1")
- AVR_MCU ("atxmega64a1", ARCH_AVRXMEGA5, "__AVR_ATxmega64A1__", 0, 0, 0x2000, 2, "x64a1")
- AVR_MCU ("atxmega64a1u", ARCH_AVRXMEGA5, "__AVR_ATxmega64A1U__", 0, 0, 0x2000, 2, "x64a1u")
- /* Xmega, 128K < Flash, RAM <= 64K */
--AVR_MCU ("avrxmega6", ARCH_AVRXMEGA6, NULL, 0, 0, 0x2000, 5, "x128a3")
-+AVR_MCU ("avrxmega6", ARCH_AVRXMEGA6, NULL, 0, 0, 0x2000, 7, "x128a3")
- AVR_MCU ("atxmega128a3", ARCH_AVRXMEGA6, "__AVR_ATxmega128A3__", 0, 0, 0x2000, 3, "x128a3")
-+AVR_MCU ("atxmega128a3u", ARCH_AVRXMEGA6, "__AVR_ATxmega128A3U__", 0, 0, 0x2000, 3, "x128a3u")
-+AVR_MCU ("atxmega128b1", ARCH_AVRXMEGA6, "__AVR_ATxmega128B1__", 0, 0, 0x2000, 3, "x128b1")
-+AVR_MCU ("atxmega128b3", ARCH_AVRXMEGA6, "__AVR_ATxmega128B3__", 0, 0, 0x2000, 3, "x128b3")
- AVR_MCU ("atxmega128d3", ARCH_AVRXMEGA6, "__AVR_ATxmega128D3__", 0, 0, 0x2000, 3, "x128d3")
-+AVR_MCU ("atxmega128d4", ARCH_AVRXMEGA6, "__AVR_ATxmega128D4__", 0, 0, 0x2000, 3, "x128d4")
- AVR_MCU ("atxmega192a3", ARCH_AVRXMEGA6, "__AVR_ATxmega192A3__", 0, 0, 0x2000, 4, "x192a3")
-+AVR_MCU ("atxmega192a3u", ARCH_AVRXMEGA6, "__AVR_ATxmega192A3U__", 0, 0, 0x2000, 4, "x192a3u")
-+AVR_MCU ("atxmega192c3", ARCH_AVRXMEGA6, "__AVR_ATxmega192C3__", 0, 0, 0x2000, 4, "x192c3")
- AVR_MCU ("atxmega192d3", ARCH_AVRXMEGA6, "__AVR_ATxmega192D3__", 0, 0, 0x2000, 4, "x192d3")
- AVR_MCU ("atxmega256a3", ARCH_AVRXMEGA6, "__AVR_ATxmega256A3__", 0, 0, 0x2000, 5, "x256a3")
- AVR_MCU ("atxmega256a3b", ARCH_AVRXMEGA6, "__AVR_ATxmega256A3B__", 0, 0, 0x2000, 5, "x256a3b")
- AVR_MCU ("atxmega256a3bu", ARCH_AVRXMEGA6, "__AVR_ATxmega256A3BU__", 0, 0, 0x2000, 5, "x256a3bu")
-+AVR_MCU ("atxmega256c3", ARCH_AVRXMEGA6, "__AVR_ATxmega256C3__", 0, 0, 0x2000, 5, "x256c3")
-+AVR_MCU ("atxmega256a3u", ARCH_AVRXMEGA6, "__AVR_ATxmega256A3U__", 0, 0, 0x2000, 5, "x256a3u")
- AVR_MCU ("atxmega256d3", ARCH_AVRXMEGA6, "__AVR_ATxmega256D3__", 0, 0, 0x2000, 5, "x256d3")
--/* Xmega, 128K < Flash, RAM > 64K RAM. */
-+AVR_MCU ("atxmega384c3", ARCH_AVRXMEGA6, "__AVR_ATxmega384C3__", 0, 0, 0x2000, 7, "x384c3")
-+AVR_MCU ("atxmega384d3", ARCH_AVRXMEGA6, "__AVR_ATxmega384D3__", 0, 0, 0x2000, 7, "x384d3")
-+/* Xmega, >= 128K, <= 256K FLASH, > 64K RAM. */
- AVR_MCU ("avrxmega7", ARCH_AVRXMEGA7, NULL, 0, 0, 0x2000, 3, "x128a1")
- AVR_MCU ("atxmega128a1", ARCH_AVRXMEGA7, "__AVR_ATxmega128A1__", 0, 0, 0x2000, 3, "x128a1")
- AVR_MCU ("atxmega128a1u", ARCH_AVRXMEGA7, "__AVR_ATxmega128A1U__", 0, 0, 0x2000, 3, "x128a1u")
-+AVR_MCU ("atxmega128a4u", ARCH_AVRXMEGA7, "__AVR_ATxmega128A4U__", 0, 0, 0x2000, 3, "x128a4u")
- /* Tiny family */
- AVR_MCU ("avrtiny", ARCH_AVRTINY, NULL, 0, 0, 0x0040, 1, "tn10")
- AVR_MCU ("attiny4", ARCH_AVRTINY, "__AVR_ATtiny4__", 0, 0, 0x0040, 1, "tn4")
diff --git a/401-gcc-non-public-devices-support.patch b/401-gcc-non-public-devices-support.patch
deleted file mode 100644
index e31bc84..0000000
--- a/401-gcc-non-public-devices-support.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-diff -Naurp gcc/config/avr/avr-devices.c gcc/config/avr/avr-devices.c
---- gcc/config/avr/avr-devices.c 2013-01-28 12:48:37.000000000 +0530
-+++ gcc/config/avr/avr-devices.c 2013-01-28 15:22:00.000000000 +0530
-@@ -47,6 +47,7 @@ avr_arch_types[] =
- { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, 32, "5", "avr5" },
- { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0x0060, 32, "51", "avr51" },
- { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, 32, "6", "avr6" },
-+ { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0x0200, 32, "7", "avr7" },
-
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0x0040, 0, "100", "avrtiny" },
- { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0x2000, 0, "102", "avrxmega2" },
-diff -Naurp gcc/config/avr/avr.h gcc/config/avr/avr.h
---- gcc/config/avr/avr.h 2013-01-28 12:48:37.000000000 +0530
-+++ gcc/config/avr/avr.h 2013-01-28 15:22:00.000000000 +0530
-@@ -86,6 +86,7 @@ enum avr_arch
- ARCH_AVR5,
- ARCH_AVR51,
- ARCH_AVR6,
-+ ARCH_AVR7,
- ARCH_AVRTINY,
- ARCH_AVRXMEGA2,
- ARCH_AVRXMEGA4,
-diff -Naurp gcc/config/avr/avr-mcus.def gcc/config/avr/avr-mcus.def
---- gcc/config/avr/avr-mcus.def 2013-01-28 12:48:37.000000000 +0530
-+++ gcc/config/avr/avr-mcus.def 2013-01-28 15:22:00.000000000 +0530
-@@ -65,6 +65,7 @@ AVR_MCU ("attiny45", ARCH_AV
- AVR_MCU ("attiny85", ARCH_AVR25, "__AVR_ATtiny85__", 0, 0, 0x0060, 1, "tn85")
- AVR_MCU ("attiny261", ARCH_AVR25, "__AVR_ATtiny261__", 1, 0, 0x0060, 1, "tn261")
- AVR_MCU ("attiny261a", ARCH_AVR25, "__AVR_ATtiny261A__", 1, 0, 0x0060, 1, "tn261a")
-+AVR_MCU ("attiny474", ARCH_AVR25, "__AVR_ATtiny474__", 0, 0, 0x0100, 1, "tn474")
- AVR_MCU ("attiny461", ARCH_AVR25, "__AVR_ATtiny461__", 0, 0, 0x0060, 1, "tn461")
- AVR_MCU ("attiny461a", ARCH_AVR25, "__AVR_ATtiny461A__", 0, 0, 0x0060, 1, "tn461a")
- AVR_MCU ("attiny861", ARCH_AVR25, "__AVR_ATtiny861__", 0, 0, 0x0060, 1, "tn861")
-@@ -74,6 +75,7 @@ AVR_MCU ("attiny87", ARCH_AV
- AVR_MCU ("attiny48", ARCH_AVR25, "__AVR_ATtiny48__", 0, 0, 0x0100, 1, "tn48")
- AVR_MCU ("attiny88", ARCH_AVR25, "__AVR_ATtiny88__", 0, 0, 0x0100, 1, "tn88")
- AVR_MCU ("attiny828", ARCH_AVR25, "__AVR_ATtiny828__", 0, 0, 0x0100, 1, "tn828")
-+AVR_MCU ("attiny841", ARCH_AVR25, "__AVR_ATtiny841__", 0, 0, 0x0100, 1, "tn841")
- AVR_MCU ("at86rf401", ARCH_AVR25, "__AVR_AT86RF401__", 0, 0, 0x0060, 1, "86401")
- /* Classic, > 8K, <= 64K + 2-byte PC + { JMP/CALL }. */
- AVR_MCU ("avr3", ARCH_AVR3, NULL, 0, 0, 0x0060, 1, "43355")
-@@ -120,6 +122,7 @@ AVR_MCU ("at90pwm81", ARCH_AV
- /* Enhanced, > 8K, <= 64K + 2-byte PC + { MOVW/LPMX, JMP/CALL, MUL }. */
- AVR_MCU ("avr5", ARCH_AVR5, NULL, 0, 0, 0x0060, 1, "m16")
- AVR_MCU ("ata5790", ARCH_AVR5, "__AVR_ATA5790__", 0, 0, 0x0100, 1, "a5790")
-+AVR_MCU ("ata5790n", ARCH_AVR5, "__AVR_ATA5790N__", 0, 0, 0x0100, 1, "a5790n")
- AVR_MCU ("ata5795", ARCH_AVR5, "__AVR_ATA5795__", 0, 0, 0x0100, 1, "a5795")
- AVR_MCU ("atmega16", ARCH_AVR5, "__AVR_ATmega16__", 0, 0, 0x0060, 1, "m16")
- AVR_MCU ("atmega16a", ARCH_AVR5, "__AVR_ATmega16A__", 0, 0, 0x0060, 1, "m16a")
-@@ -191,7 +194,11 @@ AVR_MCU ("atmega16hvb", ARCH_AV
- AVR_MCU ("atmega16hvbrevb", ARCH_AVR5, "__AVR_ATmega16HVBREVB__", 0, 0, 0x0100, 1, "m16hvbrevb")
- AVR_MCU ("atmega32hvb", ARCH_AVR5, "__AVR_ATmega32HVB__", 0, 0, 0x0100, 1, "m32hvb")
- AVR_MCU ("atmega32hvbrevb", ARCH_AVR5, "__AVR_ATmega32HVBREVB__", 0, 0, 0x0100, 1, "m32hvbrevb")
-+AVR_MCU ("atmega48hvf", ARCH_AVR5, "__AVR_ATmega48HVF__", 0, 0, 0x0100, 1, "m48hvf")
- AVR_MCU ("atmega64hve", ARCH_AVR5, "__AVR_ATmega64HVE__", 0, 0, 0x0100, 1, "m64hve")
-+AVR_MCU ("atmega64hve2", ARCH_AVR5, "__AVR_ATmega64HVE2__", 0, 0, 0x0100, 1, "m64hve2")
-+AVR_MCU ("atmega64rfa2", ARCH_AVR5, "__AVR_ATmega64RFA2__", 0, 0, 0x0200, 1, "m64rfa2")
-+AVR_MCU ("atmega64rfr2", ARCH_AVR5, "__AVR_ATmega64RFR2__", 0, 0, 0x0200, 1, "m64rfr2")
- AVR_MCU ("at90can32", ARCH_AVR5, "__AVR_AT90CAN32__", 0, 0, 0x0100, 1, "can32")
- AVR_MCU ("at90can64", ARCH_AVR5, "__AVR_AT90CAN64__", 0, 0, 0x0100, 1, "can64")
- AVR_MCU ("at90pwm161", ARCH_AVR5, "__AVR_AT90PWM161__", 0, 0, 0x0100, 1, "90pwm161")
-@@ -203,6 +210,7 @@ AVR_MCU ("atmega16m1", ARCH_AV
- AVR_MCU ("atmega32m1", ARCH_AVR5, "__AVR_ATmega32M1__", 0, 0, 0x0100, 1, "m32m1")
- AVR_MCU ("atmega64m1", ARCH_AVR5, "__AVR_ATmega64M1__", 0, 0, 0x0100, 1, "m64m1")
- AVR_MCU ("atmega16u4", ARCH_AVR5, "__AVR_ATmega16U4__", 0, 0, 0x0100, 1, "m16u4")
-+AVR_MCU ("atmega26hvg", ARCH_AVR5, "__AVR_ATmega26HVG__", 0, 0, 0x0100, 1, "m26hvg")
- AVR_MCU ("atmega32u4", ARCH_AVR5, "__AVR_ATmega32U4__", 0, 0, 0x0100, 1, "m32u4")
- AVR_MCU ("atmega32u6", ARCH_AVR5, "__AVR_ATmega32U6__", 0, 0, 0x0100, 1, "m32u6")
- AVR_MCU ("at90scr100", ARCH_AVR5, "__AVR_AT90SCR100__", 0, 0, 0x0100, 1, "90scr100")
-@@ -219,16 +227,27 @@ AVR_MCU ("atmega1281", ARCH_AV
- AVR_MCU ("atmega1284", ARCH_AVR51, "__AVR_ATmega1284__", 0, 0, 0x0100, 2, "m1284")
- AVR_MCU ("atmega1284p", ARCH_AVR51, "__AVR_ATmega1284P__", 0, 0, 0x0100, 2, "m1284p")
- AVR_MCU ("atmega128rfa1", ARCH_AVR51, "__AVR_ATmega128RFA1__", 0, 0, 0x0200, 2, "m128rfa1")
-+AVR_MCU ("atmega128rfa2", ARCH_AVR51, "__AVR_ATmega128RFA2__", 0, 0, 0x0200, 2, "m128rfa2")
-+AVR_MCU ("atmega128rfr2", ARCH_AVR51, "__AVR_ATmega128RFR2__", 0, 0, 0x0200, 2, "m128rfr2")
- AVR_MCU ("at90can128", ARCH_AVR51, "__AVR_AT90CAN128__", 0, 0, 0x0100, 2, "can128")
- AVR_MCU ("at90usb1286", ARCH_AVR51, "__AVR_AT90USB1286__", 0, 0, 0x0100, 2, "usb1286")
- AVR_MCU ("at90usb1287", ARCH_AVR51, "__AVR_AT90USB1287__", 0, 0, 0x0100, 2, "usb1287")
--/* Enhanced, == 256K + 3-Byte PC + { MOVW/LPMX, JMP/CALL, MUL, ELPM, ELPMX }. */
-+/* Enhanced, == 256K + 3-Byte PC + { MOVW/LPMX, JMP/CALL, MUL, ELPM, ELPMX, EIJMP/EICALL }. */
- AVR_MCU ("avr6", ARCH_AVR6, NULL, 0, 0, 0x0200, 4, "m2561")
- AVR_MCU ("atmega2560", ARCH_AVR6, "__AVR_ATmega2560__", 0, 0, 0x0200, 4, "m2560")
- AVR_MCU ("atmega2561", ARCH_AVR6, "__AVR_ATmega2561__", 0, 0, 0x0200, 4, "m2561")
-+AVR_MCU ("atmega256rfa2", ARCH_AVR6, "__AVR_ATmega256RFA2__", 0, 0, 0x0200, 4, "m256rfa2")
-+AVR_MCU ("atmega256rfr2", ARCH_AVR6, "__AVR_ATmega256RFR2__", 0, 0, 0x0200, 4, "m256rfr2")
-+/* Enhanced, == 20K starts at 0x8000 */
-+AVR_MCU ("avr7", ARCH_AVR7, NULL, 0, 0, 0x0200, 1, "a5831")
-+AVR_MCU ("ata5831", ARCH_AVR7, "__AVR_ATA5831__", 0, 0, 0x0200, 1, "a5831")
- /* Xmega, 16K <= Flash < 64K, RAM <= 64K */
- AVR_MCU ("avrxmega2", ARCH_AVRXMEGA2, NULL, 0, 0, 0x2000, 1, "x32a4")
- AVR_MCU ("atxmega8e5", ARCH_AVRXMEGA2, "__AVR_ATxmega8E5__", 0, 0, 0x2000, 1, "x8e5")
-+AVR_MCU ("atmxt112sl", ARCH_AVRXMEGA2, "__AVR_ATMXT112SL__", 0, 0, 0x2000, 1, "mxt112sl")
-+AVR_MCU ("atmxt224", ARCH_AVRXMEGA2, "__AVR_ATMXT224__", 0, 0, 0x2000, 1, "mxt224")
-+AVR_MCU ("atmxt224e", ARCH_AVRXMEGA2, "__AVR_ATMXT224E__", 0, 0, 0x2000, 1, "mxt224e")
-+AVR_MCU ("atmxt336s", ARCH_AVRXMEGA2, "__AVR_ATMXT336S__", 0, 0, 0x2000, 1, "mxt336s")
- AVR_MCU ("atxmega16a4", ARCH_AVRXMEGA2, "__AVR_ATxmega16A4__", 0, 0, 0x2000, 1, "x16a4")
- AVR_MCU ("atxmega16a4u", ARCH_AVRXMEGA2, "__AVR_ATxmega16A4U__", 0, 0, 0x2000, 1, "x16a4u")
- AVR_MCU ("atxmega16c4", ARCH_AVRXMEGA2, "__AVR_ATxmega16C4__", 0, 0, 0x2000, 1, "x16c4")
-@@ -261,8 +280,11 @@ AVR_MCU ("atxmega128a3", ARCH_AVRXME
- AVR_MCU ("atxmega128a3u", ARCH_AVRXMEGA6, "__AVR_ATxmega128A3U__", 0, 0, 0x2000, 3, "x128a3u")
- AVR_MCU ("atxmega128b1", ARCH_AVRXMEGA6, "__AVR_ATxmega128B1__", 0, 0, 0x2000, 3, "x128b1")
- AVR_MCU ("atxmega128b3", ARCH_AVRXMEGA6, "__AVR_ATxmega128B3__", 0, 0, 0x2000, 3, "x128b3")
-+AVR_MCU ("atxmega128c3", ARCH_AVRXMEGA6, "__AVR_ATxmega128C3__", 0, 0, 0x2000, 3, "x128c3")
- AVR_MCU ("atxmega128d3", ARCH_AVRXMEGA6, "__AVR_ATxmega128D3__", 0, 0, 0x2000, 3, "x128d3")
- AVR_MCU ("atxmega128d4", ARCH_AVRXMEGA6, "__AVR_ATxmega128D4__", 0, 0, 0x2000, 3, "x128d4")
-+AVR_MCU ("atmxt540s", ARCH_AVRXMEGA6, "__AVR_ATMXT540S__", 0, 0, 0x2000, 3, "mxt540s")
-+AVR_MCU ("atmxt540sreva", ARCH_AVRXMEGA6, "__AVR_ATMXT540SREVA__", 0, 0, 0x2000, 3, "mxt540sreva")
- AVR_MCU ("atxmega192a3", ARCH_AVRXMEGA6, "__AVR_ATxmega192A3__", 0, 0, 0x2000, 4, "x192a3")
- AVR_MCU ("atxmega192a3u", ARCH_AVRXMEGA6, "__AVR_ATxmega192A3U__", 0, 0, 0x2000, 4, "x192a3u")
- AVR_MCU ("atxmega192c3", ARCH_AVRXMEGA6, "__AVR_ATxmega192C3__", 0, 0, 0x2000, 4, "x192c3")
diff --git a/402-gcc-atmega64_128_2564RFR2.patch b/402-gcc-atmega64_128_2564RFR2.patch
deleted file mode 100644
index 8817ba9..0000000
--- a/402-gcc-atmega64_128_2564RFR2.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff -Naurp gcc/config/avr/avr-mcus.def gcc/config/avr/avr-mcus.def
---- gcc/config/avr/avr-mcus.def 2013-02-07 12:08:53.000000000 +0530
-+++ gcc/config/avr/avr-mcus.def 2013-02-07 12:16:18.000000000 +0530
-@@ -199,6 +199,7 @@ AVR_MCU ("atmega64hve", ARCH_AV
- AVR_MCU ("atmega64hve2", ARCH_AVR5, "__AVR_ATmega64HVE2__", 0, 0, 0x0100, 1, "m64hve2")
- AVR_MCU ("atmega64rfa2", ARCH_AVR5, "__AVR_ATmega64RFA2__", 0, 0, 0x0200, 1, "m64rfa2")
- AVR_MCU ("atmega64rfr2", ARCH_AVR5, "__AVR_ATmega64RFR2__", 0, 0, 0x0200, 1, "m64rfr2")
-+AVR_MCU ("atmega644rfr2", ARCH_AVR5, "__AVR_ATmega644RFR2__", 0, 0, 0x0200, 1, "m644rfr2")
- AVR_MCU ("at90can32", ARCH_AVR5, "__AVR_AT90CAN32__", 0, 0, 0x0100, 1, "can32")
- AVR_MCU ("at90can64", ARCH_AVR5, "__AVR_AT90CAN64__", 0, 0, 0x0100, 1, "can64")
- AVR_MCU ("at90pwm161", ARCH_AVR5, "__AVR_AT90PWM161__", 0, 0, 0x0100, 1, "90pwm161")
-@@ -229,6 +230,7 @@ AVR_MCU ("atmega1284p", ARCH_AV
- AVR_MCU ("atmega128rfa1", ARCH_AVR51, "__AVR_ATmega128RFA1__", 0, 0, 0x0200, 2, "m128rfa1")
- AVR_MCU ("atmega128rfa2", ARCH_AVR51, "__AVR_ATmega128RFA2__", 0, 0, 0x0200, 2, "m128rfa2")
- AVR_MCU ("atmega128rfr2", ARCH_AVR51, "__AVR_ATmega128RFR2__", 0, 0, 0x0200, 2, "m128rfr2")
-+AVR_MCU ("atmega1284rfr2", ARCH_AVR51, "__AVR_ATmega1284RFR2__", 0, 0, 0x0200, 2, "m1284rfr2")
- AVR_MCU ("at90can128", ARCH_AVR51, "__AVR_AT90CAN128__", 0, 0, 0x0100, 2, "can128")
- AVR_MCU ("at90usb1286", ARCH_AVR51, "__AVR_AT90USB1286__", 0, 0, 0x0100, 2, "usb1286")
- AVR_MCU ("at90usb1287", ARCH_AVR51, "__AVR_AT90USB1287__", 0, 0, 0x0100, 2, "usb1287")
-@@ -238,6 +240,7 @@ AVR_MCU ("atmega2560", ARCH_AV
- AVR_MCU ("atmega2561", ARCH_AVR6, "__AVR_ATmega2561__", 0, 0, 0x0200, 4, "m2561")
- AVR_MCU ("atmega256rfa2", ARCH_AVR6, "__AVR_ATmega256RFA2__", 0, 0, 0x0200, 4, "m256rfa2")
- AVR_MCU ("atmega256rfr2", ARCH_AVR6, "__AVR_ATmega256RFR2__", 0, 0, 0x0200, 4, "m256rfr2")
-+AVR_MCU ("atmega2564rfr2", ARCH_AVR6, "__AVR_ATmega2564RFR2__", 0, 0, 0x0200, 4, "m2564rfr2")
- /* Enhanced, == 20K starts at 0x8000 */
- AVR_MCU ("avr7", ARCH_AVR7, NULL, 0, 0, 0x0200, 1, "a5831")
- AVR_MCU ("ata5831", ARCH_AVR7, "__AVR_ATA5831__", 0, 0, 0x0200, 1, "a5831")
diff --git a/403-gcc-atmxts200.patch b/403-gcc-atmxts200.patch
deleted file mode 100644
index 743f9bc..0000000
--- a/403-gcc-atmxts200.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Naurp gcc/config/avr/avr-mcus.def gcc/config/avr/avr-mcus.def
---- gcc/config/avr/avr-mcus.def 2013-03-25 10:50:37.000000000 +0530
-+++ gcc/config/avr/avr-mcus.def 2013-03-25 11:52:38.000000000 +0530
-@@ -251,6 +251,7 @@ AVR_MCU ("atmxt112sl", ARCH_AVRXME
- AVR_MCU ("atmxt224", ARCH_AVRXMEGA2, "__AVR_ATMXT224__", 0, 0, 0x2000, 1, "mxt224")
- AVR_MCU ("atmxt224e", ARCH_AVRXMEGA2, "__AVR_ATMXT224E__", 0, 0, 0x2000, 1, "mxt224e")
- AVR_MCU ("atmxt336s", ARCH_AVRXMEGA2, "__AVR_ATMXT336S__", 0, 0, 0x2000, 1, "mxt336s")
-+AVR_MCU ("atmxts200", ARCH_AVRXMEGA2, "__AVR_ATMXTS200__", 0, 0, 0x2000, 1, "mxts200")
- AVR_MCU ("atxmega16a4", ARCH_AVRXMEGA2, "__AVR_ATxmega16A4__", 0, 0, 0x2000, 1, "x16a4")
- AVR_MCU ("atxmega16a4u", ARCH_AVRXMEGA2, "__AVR_ATxmega16A4U__", 0, 0, 0x2000, 1, "x16a4u")
- AVR_MCU ("atxmega16c4", ARCH_AVRXMEGA2, "__AVR_ATxmega16C4__", 0, 0, 0x2000, 1, "x16c4")
diff --git a/501-gcc-avrtc579.patch b/501-gcc-avrtc579.patch
deleted file mode 100644
index 135e486..0000000
--- a/501-gcc-avrtc579.patch
+++ /dev/null
@@ -1,304 +0,0 @@
-diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
---- gcc/config/avr/avr.c 2012-11-09 19:05:47.000000000 +0530
-+++ gcc/config/avr/avr.c 2012-11-14 13:57:13.000000000 +0530
-@@ -2801,6 +2801,35 @@ avr_out_xload (rtx insn ATTRIBUTE_UNUSED
- return "";
- }
-
-+/*
-+AVRTC-579
-+if operand is symbol or constant expression with value > 0xbf
-+ return false, otherwise true
-+This check is used to avoid lds/sts instruction with invalid memory
-+access range (valid range 0x40..0xbf). For io operand range 0x0..0x3f,
-+in/out instruction will be generated.
-+*/
-+bool tiny_valid_direct_memory_access_range(rtx op, enum machine_mode mode)
-+{
-+ rtx x;
-+
-+ if (!AVR_TINY)
-+ return true;
-+
-+ x = XEXP(op,0);
-+
-+ if (MEM_P(op) && x && (GET_CODE(x) == SYMBOL_REF))
-+ {
-+ return false;
-+ }
-+ if (MEM_P(op) && x && (CONSTANT_ADDRESS_P (x)) &&
-+ !(IN_RANGE (INTVAL (x), 0, 0xC0 - GET_MODE_SIZE (mode))))
-+ {
-+ return false;
-+ }
-+
-+ return true;
-+}
-
- const char*
- output_movqi (rtx insn, rtx operands[], int *real_l)
-@@ -2956,9 +2985,10 @@ out_movqi_r_mr (rtx insn, rtx op[], int
-
- if (CONSTANT_ADDRESS_P (x))
- {
-+ int n_words = AVR_TINY ? 1 : 2;
- return optimize > 0 && io_address_operand (x, QImode)
- ? avr_asm_len ("in %0,%i1", op, plen, -1)
-- : avr_asm_len ("lds %0,%m1", op, plen, -2);
-+ : avr_asm_len ("lds %0,%m1", op, plen, -n_words);
- }
-
-
-@@ -3213,12 +3243,13 @@ out_movhi_r_mr (rtx insn, rtx op[], int
- }
- else if (CONSTANT_ADDRESS_P (base))
- {
-+ int n_words = AVR_TINY ? 2 : 4;
- return optimize > 0 && io_address_operand (base, HImode)
- ? avr_asm_len ("in %A0,%i1" CR_TAB
- "in %B0,%i1+1", op, plen, -2)
-
- : avr_asm_len ("lds %A0,%m1" CR_TAB
-- "lds %B0,%m1+1", op, plen, -4);
-+ "lds %B0,%m1+1", op, plen, -n_words);
- }
-
- fatal_insn ("unknown move insn:",insn);
-@@ -3478,10 +3509,24 @@ out_movsi_r_mr (rtx insn, rtx op[], int
- "ld %C0,%1" CR_TAB
- "ld %D0,%1");
- else if (CONSTANT_ADDRESS_P (base))
-- return *l=8, ("lds %A0,%m1" CR_TAB
-- "lds %B0,%m1+1" CR_TAB
-- "lds %C0,%m1+2" CR_TAB
-- "lds %D0,%m1+3");
-+ {
-+ if (io_address_operand (base, SImode))
-+ {
-+ *l = 4;
-+ return ("in %A0,%i1" CR_TAB
-+ "in %B0,%i1+1" CR_TAB
-+ "in %C0,%i1+2" CR_TAB
-+ "in %D0,%i1+3");
-+ }
-+ else
-+ {
-+ *l = AVR_TINY ? 4 : 8;
-+ return ("lds %A0,%m1" CR_TAB
-+ "lds %B0,%m1+1" CR_TAB
-+ "lds %C0,%m1+2" CR_TAB
-+ "lds %D0,%m1+3");
-+ }
-+ }
-
- fatal_insn ("unknown move insn:",insn);
- return "";
-@@ -3608,10 +3653,24 @@ out_movsi_mr_r (rtx insn, rtx op[], int
- l = &tmp;
-
- if (CONSTANT_ADDRESS_P (base))
-- return *l=8,("sts %m0,%A1" CR_TAB
-- "sts %m0+1,%B1" CR_TAB
-- "sts %m0+2,%C1" CR_TAB
-- "sts %m0+3,%D1");
-+ {
-+ if (io_address_operand (base, SImode))
-+ {
-+ return *l=4,("out %i0, %A1" CR_TAB
-+ "out %i0+1,%B1" CR_TAB
-+ "out %i0+2,%C1" CR_TAB
-+ "out %i0+3,%D1");
-+ }
-+ else
-+ {
-+ *l = AVR_TINY ? 4 : 8;
-+ return ("sts %m0,%A1" CR_TAB
-+ "sts %m0+1,%B1" CR_TAB
-+ "sts %m0+2,%C1" CR_TAB
-+ "sts %m0+3,%D1");
-+ }
-+ }
-+
- if (reg_base > 0) /* (r) */
- {
- if (AVR_TINY)
-@@ -4031,9 +4090,12 @@ avr_out_load_psi (rtx insn, rtx *op, int
- "ld %C0,%1", op, plen, -3);
-
- else if (CONSTANT_ADDRESS_P (base))
-+ {
-+ int n_words = AVR_TINY ? 3 : 6;
- return avr_asm_len ("lds %A0,%m1" CR_TAB
- "lds %B0,%m1+1" CR_TAB
-- "lds %C0,%m1+2", op, plen , -6);
-+ "lds %C0,%m1+2", op, plen , -n_words);
-+ }
-
- fatal_insn ("unknown move insn:",insn);
- return "";
-@@ -4129,9 +4191,12 @@ avr_out_store_psi (rtx insn, rtx *op, in
- int reg_base = true_regnum (base);
-
- if (CONSTANT_ADDRESS_P (base))
-+ {
-+ int n_words = AVR_TINY ? 3 : 6;
- return avr_asm_len ("sts %m0,%A1" CR_TAB
- "sts %m0+1,%B1" CR_TAB
-- "sts %m0+2,%C1", op, plen, -6);
-+ "sts %m0+2,%C1", op, plen, -n_words);
-+ }
-
- if (reg_base > 0) /* (r) */
- {
-@@ -4314,9 +4379,10 @@ out_movqi_mr_r (rtx insn, rtx op[], int
-
- if (CONSTANT_ADDRESS_P (x))
- {
-+ int n_words = AVR_TINY ? 1 : 2;
- return optimize > 0 && io_address_operand (x, QImode)
- ? avr_asm_len ("out %i0,%1", op, plen, -1)
-- : avr_asm_len ("sts %m0,%1", op, plen, -2);
-+ : avr_asm_len ("sts %m0,%1", op, plen, -n_words);
- }
- else if (GET_CODE (x) == PLUS
- && REG_P (XEXP (x, 0))
-@@ -4389,12 +4455,15 @@ avr_out_movhi_mr_r_xmega (rtx insn, rtx
- int mem_volatile_p = MEM_VOLATILE_P (dest);
-
- if (CONSTANT_ADDRESS_P (base))
-+ {
-+ int n_words = AVR_TINY ? 2 : 4;
- return optimize > 0 && io_address_operand (base, HImode)
- ? avr_asm_len ("out %i0,%A1" CR_TAB
- "out %i0+1,%B1", op, plen, -2)
-
- : avr_asm_len ("sts %m0,%A1" CR_TAB
-- "sts %m0+1,%B1", op, plen, -4);
-+ "sts %m0+1,%B1", op, plen, -n_words);
-+ }
-
- if (reg_base > 0)
- {
-@@ -4574,12 +4643,15 @@ out_movhi_mr_r (rtx insn, rtx op[], int
- mem_volatile_p = MEM_VOLATILE_P (dest);
-
- if (CONSTANT_ADDRESS_P (base))
-+ {
-+ int n_words = AVR_TINY ? 2 : 4;
- return optimize > 0 && io_address_operand (base, HImode)
- ? avr_asm_len ("out %i0+1,%B1" CR_TAB
- "out %i0,%A1", op, plen, -2)
-
- : avr_asm_len ("sts %m0+1,%B1" CR_TAB
-- "sts %m0,%A1", op, plen, -4);
-+ "sts %m0,%A1", op, plen, -n_words);
-+ }
-
- if (reg_base > 0)
- {
-diff -Naurp gcc/config/avr/avr.md gcc/config/avr/avr.md
---- gcc/config/avr/avr.md 2012-11-09 19:05:47.000000000 +0530
-+++ gcc/config/avr/avr.md 2012-11-14 13:57:13.000000000 +0530
-@@ -629,6 +629,32 @@
- DONE;
- }
-
-+ /* AVRTC-579
-+ if the source operand expression is out of range for 'lds' instruction
-+ copy source operand expression to register
-+ For tiny core, LDS instruction's memory access range limited to 0x40..0xbf
-+ */
-+ if (!tiny_valid_direct_memory_access_range(src,<MODE>mode))
-+ {
-+ rtx srcx = XEXP(src,0);
-+ operands[1] = src = replace_equiv_address (src,copy_to_mode_reg (GET_MODE(srcx),srcx));
-+ emit_move_insn(dest,src);
-+ DONE;
-+ }
-+
-+ /* AVRTC-579
-+ if the destination operand expression is out of range for 'sts' instruction
-+ copy destination operand expression to register
-+ For tiny core, STS instruction's memory access range limited to 0x40..0xbf
-+ */
-+ if (!tiny_valid_direct_memory_access_range(dest,<MODE>mode))
-+ {
-+ rtx destx = XEXP(dest,0);
-+ operands[0] = dest = replace_equiv_address (dest,copy_to_mode_reg (GET_MODE(destx),destx));
-+ emit_move_insn(dest,src);
-+ DONE;
-+ }
-+
- /* ; The only address-space for which we use plain MEM and reload
- ; machinery are 1-byte loads from __flash. */
- })
-@@ -645,9 +671,14 @@
- (define_insn "movqi_insn"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=r ,d,Qm,r ,q,r,*r")
- (match_operand:QI 1 "nox_general_operand" "rL,i,rL,Qm,r,q,i"))]
-- "register_operand (operands[0], QImode)
-+ "(register_operand (operands[0], QImode)
- || register_operand (operands[1], QImode)
-- || const0_rtx == operands[1]"
-+ || const0_rtx == operands[1]) &&
-+ /* skip if operands are out of lds/sts memory access range(0x40..0xbf)
-+ though access range is checked during define_expand, it is required
-+ here to avoid merging rtls during combine pass */
-+ tiny_valid_direct_memory_access_range(operands[0],QImode) &&
-+ tiny_valid_direct_memory_access_range(operands[1],QImode)"
- {
- return output_movqi (insn, operands, NULL);
- }
-@@ -732,9 +763,14 @@
- (define_insn "*movhi"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,m ,d,*r,q,r")
- (match_operand:HI 1 "nox_general_operand" "r,L,m,rL,i,i ,r,q"))]
-- "register_operand (operands[0], HImode)
-+ "(register_operand (operands[0], HImode)
- || register_operand (operands[1], HImode)
-- || const0_rtx == operands[1]"
-+ || const0_rtx == operands[1]) &&
-+ /* skip if operands are out of lds/sts memory access range(0x40..0xbf)
-+ though access range is checked during define_expand, it is required
-+ here to avoid merging rtls during combine pass */
-+ tiny_valid_direct_memory_access_range(operands[0],HImode) &&
-+ tiny_valid_direct_memory_access_range(operands[1],HImode)"
- {
- return output_movhi (insn, operands, NULL);
- }
-@@ -842,9 +878,15 @@
- (define_insn "*movsi"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r ,Qm,!d,r")
- (match_operand:SI 1 "nox_general_operand" "r,L,Qm,rL,i ,i"))]
-- "register_operand (operands[0], SImode)
-+ "((register_operand (operands[0], SImode)
- || register_operand (operands[1], SImode)
-- || const0_rtx == operands[1]"
-+ || const0_rtx == operands[1]) &&
-+ /* skip if operands are out of lds/sts memory access range(0x40..0xbf)
-+ though access range is checked during define_expand, it is required
-+ here to avoid merging rtls during combine pass */
-+ tiny_valid_direct_memory_access_range(operands[0],SImode) &&
-+ tiny_valid_direct_memory_access_range(operands[1],SImode))
-+ "
- {
- return output_movsisf (insn, operands, NULL);
- }
-@@ -858,9 +900,15 @@
- (define_insn "*movsf"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,r ,Qm,!d,r")
- (match_operand:SF 1 "nox_general_operand" "r,G,Qm,rG,F ,F"))]
-- "register_operand (operands[0], SFmode)
-+ "((register_operand (operands[0], SFmode)
- || register_operand (operands[1], SFmode)
-- || operands[1] == CONST0_RTX (SFmode)"
-+ || operands[1] == CONST0_RTX (SFmode)) &&
-+ /* skip if operands are out of lds/sts memory access range(0x40..0xbf)
-+ though access range is checked during define_expand, it is required
-+ here to avoid merging rtls during combine pass */
-+ tiny_valid_direct_memory_access_range(operands[0],SFmode) &&
-+ tiny_valid_direct_memory_access_range(operands[1],SFmode))
-+ "
- {
- return output_movsisf (insn, operands, NULL);
- }
diff --git a/502-gcc-pr54796.patch b/502-gcc-pr54796.patch
deleted file mode 100644
index 131c405..0000000
--- a/502-gcc-pr54796.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-diff -Naurp gcc/alias.c gcc/alias.c
---- gcc/alias.c 2012-03-01 22:28:11.000000000 +0530
-+++ gcc/alias.c 2012-11-06 15:25:38.000000000 +0530
-@@ -1595,6 +1595,9 @@ find_base_term (rtx x)
- if (!val)
- return ret;
-
-+ if (cselib_sp_based_value_p (val))
-+ return static_reg_base_value[STACK_POINTER_REGNUM];
-+
- f = val->locs;
- /* Temporarily reset val->locs to avoid infinite recursion. */
- val->locs = NULL;
-diff -Naurp gcc/cselib.c gcc/cselib.c
---- gcc/cselib.c 2012-03-01 22:28:11.000000000 +0530
-+++ gcc/cselib.c 2012-11-06 15:25:38.000000000 +0530
-@@ -209,6 +209,9 @@ void (*cselib_record_sets_hook) (rtx ins
- #define PRESERVED_VALUE_P(RTX) \
- (RTL_FLAG_CHECK1("PRESERVED_VALUE_P", (RTX), VALUE)->unchanging)
-
-+#define SP_BASED_VALUE_P(RTX) \
-+ (RTL_FLAG_CHECK1("SP_BASED_VALUE_P", (RTX), VALUE)->jump)
-+
-
-
- /* Allocate a struct elt_list and fill in its two elements with the
-@@ -738,6 +741,23 @@ cselib_preserve_only_values (void)
- gcc_assert (first_containing_mem == &dummy_val);
- }
-
-+/* Arrange for a value to be marked as based on stack pointer
-+ for find_base_term purposes. */
-+
-+void
-+cselib_set_value_sp_based (cselib_val *v)
-+{
-+ SP_BASED_VALUE_P (v->val_rtx) = 1;
-+}
-+
-+/* Test whether a value is preserved. */
-+
-+bool
-+cselib_sp_based_value_p (cselib_val *v)
-+{
-+ return SP_BASED_VALUE_P (v->val_rtx);
-+}
-+
- /* Return the mode in which a register was last set. If X is not a
- register, return its mode. If the mode in which the register was
- set is not known, or the value was already clobbered, return
-diff -Naurp gcc/cselib.h gcc/cselib.h
---- gcc/cselib.h 2012-03-01 22:28:11.000000000 +0530
-+++ gcc/cselib.h 2012-11-06 15:25:38.000000000 +0530
-@@ -99,6 +99,8 @@ extern void cselib_preserve_only_values
- extern void cselib_preserve_cfa_base_value (cselib_val *, unsigned int);
- extern void cselib_add_permanent_equiv (cselib_val *, rtx, rtx);
- extern bool cselib_have_permanent_equivalences (void);
-+extern void cselib_set_value_sp_based (cselib_val *);
-+extern bool cselib_sp_based_value_p (cselib_val *);
-
- extern void dump_cselib_table (FILE *);
-
-diff -Naurp gcc/rtl.h gcc/rtl.h
---- gcc/rtl.h 2012-01-25 00:36:38.000000000 +0530
-+++ gcc/rtl.h 2012-11-06 15:25:38.000000000 +0530
-@@ -266,7 +266,8 @@ struct GTY((chain_next ("RTX_NEXT (&%h)"
- 1 in a CALL_INSN if it is a sibling call.
- 1 in a SET that is for a return.
- In a CODE_LABEL, part of the two-bit alternate entry field.
-- 1 in a CONCAT is VAL_EXPR_IS_COPIED in var-tracking.c. */
-+ 1 in a CONCAT is VAL_EXPR_IS_COPIED in var-tracking.c.
-+ 1 in a VALUE is SP_BASED_VALUE_P in cselib.c. */
- unsigned int jump : 1;
- /* In a CODE_LABEL, part of the two-bit alternate entry field.
- 1 in a MEM if it cannot trap.
-diff -Naurp gcc/testsuite/gcc.dg/guality/pr54796.c gcc/testsuite/gcc.dg/guality/pr54796.c
---- gcc/testsuite/gcc.dg/guality/pr54796.c 1970-01-01 05:30:00.000000000 +0530
-+++ gcc/testsuite/gcc.dg/guality/pr54796.c 2012-11-06 15:25:38.000000000 +0530
-@@ -0,0 +1,25 @@
-+/* PR debug/54796 */
-+/* { dg-do run } */
-+/* { dg-options "-g" } */
-+
-+__attribute__((noinline, noclone)) void
-+bar (char *a, int b)
-+{
-+ __asm volatile ("" : "+r" (a), "+r" (b) : : "memory");
-+}
-+
-+__attribute__((noinline, noclone)) void
-+foo (int a, int b)
-+{
-+ int c = a;
-+ char d[b]; /* { dg-final { gdb-test 17 "a" "5" } } */
-+ bar (d, 2); /* { dg-final { gdb-test 17 "b" "6" } } */
-+ bar (d, 4); /* { dg-final { gdb-test 17 "c" "5" } } */
-+}
-+
-+int
-+main ()
-+{
-+ foo (5, 6);
-+ return 0;
-+}
-diff -Naurp gcc/var-tracking.c gcc/var-tracking.c
---- gcc/var-tracking.c 2012-02-25 17:39:27.000000000 +0530
-+++ gcc/var-tracking.c 2012-11-06 15:25:38.000000000 +0530
-@@ -5521,6 +5521,11 @@ add_stores (rtx loc, const_rtx expr, voi
-
- resolve = preserve = !cselib_preserved_value_p (v);
-
-+ if (loc == stack_pointer_rtx
-+ && hard_frame_pointer_adjustment != -1
-+ && preserve)
-+ cselib_set_value_sp_based (v);
-+
- nloc = replace_expr_with_values (oloc);
- if (nloc)
- oloc = nloc;
-@@ -9446,6 +9451,19 @@ vt_initialize (void)
- {
- vt_init_cfa_base ();
- hard_frame_pointer_adjustment = fp_cfa_offset;
-+ /* Disassociate sp from fp now. */
-+ if (MAY_HAVE_DEBUG_INSNS)
-+ {
-+ cselib_val *v;
-+ cselib_invalidate_rtx (stack_pointer_rtx);
-+ v = cselib_lookup (stack_pointer_rtx, Pmode, 1,
-+ VOIDmode);
-+ if (v && !cselib_preserved_value_p (v))
-+ {
-+ cselib_set_value_sp_based (v);
-+ preserve_value (v);
-+ }
-+ }
- }
- }
- }
diff --git a/503-gcc-avrtc-513.patch b/503-gcc-avrtc-513.patch
deleted file mode 100644
index 3d000f5..0000000
--- a/503-gcc-avrtc-513.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
---- gcc/config/avr/avr.c 2012-12-06 19:22:10.000000000 +0530
-+++ gcc/config/avr/avr.c 2012-12-06 19:23:44.000000000 +0530
-@@ -169,7 +169,7 @@ static bool avr_rtx_costs (rtx, int, int
- #define FIRST_CUM_REG 26
-
- /* Last call saved register */
--#define LAST_CALLEE_SAVED_REG (AVR_TINY ? 21 : 17)
-+#define LAST_CALLEE_SAVED_REG (AVR_TINY ? 19 : 17)
-
- /* Implicit target register of LPM instruction (R0) */
- extern GTY(()) rtx lpm_reg_rtx;
-@@ -7451,7 +7451,8 @@ avr_assemble_integer (rtx x, unsigned in
- static bool
- avr_class_likely_spilled_p (reg_class_t c)
- {
-- return (c != ALL_REGS && c != ADDW_REGS);
-+ return (c != ALL_REGS &&
-+ (AVR_TINY ? 1 : c != ADDW_REGS));
- }
-
- /* Valid attributes:
-@@ -8168,12 +8169,13 @@ order_regs_for_local_alloc (void)
- 32,33,34,35
- };
- static const int tiny_order_0[] = {
-- 24,25,
-+ 20,21,
- 22,23,
-+ 24,25,
- 30,31,
- 26,27,
- 28,29,
-- 21,20,19,18,
-+ 19,18,
- 16,17,
- 32,33,34,35,
- 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
-@@ -8220,7 +8222,7 @@ order_regs_for_local_alloc (void)
- devices has only 16 registers, so different allocation order should be used
- */
- const int *order = (TARGET_ORDER_1 ? (AVR_TINY ? tiny_order_1 : order_1) :
-- TARGET_ORDER_2 ? (AVR_TINY ? tiny_order_1 : order_2) :
-+ TARGET_ORDER_2 ? (AVR_TINY ? tiny_order_0 : order_2) :
- (AVR_TINY ? tiny_order_0 : order_0));
-
- for (i=0; i < ARRAY_SIZE (order_0); ++i)
-@@ -10090,12 +10092,13 @@ avr_conditional_register_usage(void) {
- unsigned int i;
-
- const int tiny_reg_alloc_order[] = {
-- 24,25,
-+ 20,21,
- 22,23,
-+ 24,25,
- 30,31,
- 26,27,
- 28,29,
-- 21,20,19,18,
-+ 19,18,
- 16,17,
- 32,33,34,35,
- 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
diff --git a/504-gcc-avrtc-610.patch b/504-gcc-avrtc-610.patch
deleted file mode 100644
index 530b1ba..0000000
--- a/504-gcc-avrtc-610.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -Naurp gcc/config/avr/avr.h gcc/config/avr/avr.h
---- gcc/config/avr/avr.h
-+++ gcc/config/avr/avr.h
-@@ -627,7 +627,8 @@ extern const char *avr_device_to_sp8 (in
- #define ASM_SPEC "%{mmcu=avr25:-mmcu=avr2;mmcu=avr35:-mmcu=avr3;mmcu=avr31:-mmcu=avr3;mmcu=avr51:-mmcu=avr5;\
- mmcu=*:-mmcu=%*} \
- %{mmcu=*:%{!mmcu=avr2:%{!mmcu=at90s8515:%{!mmcu=avr31:%{!mmcu=atmega103:\
---mno-skip-bug}}}}}"
-+-mno-skip-bug}}}}} \
-+%{mrelax:-mlink-relax}"
-
- #define LINK_SPEC "\
- %{mrelax:--relax\
diff --git a/505-gcc-avrtc586.patch b/505-gcc-avrtc586.patch
deleted file mode 100644
index 6aa4189..0000000
--- a/505-gcc-avrtc586.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-diff -Naurp libgcc/config/avr/lib1funcs.S libgcc/config/avr/lib1funcs.S
---- libgcc/config/avr/lib1funcs.S 2013-01-21 18:58:03.000000000 +0530
-+++ libgcc/config/avr/lib1funcs.S 2013-01-21 19:12:51.000000000 +0530
-@@ -2010,7 +2010,21 @@ ENDF __do_clear_bss
- #ifdef L_ctors
- .section .init6,"ax", at progbits
- DEFUN __do_global_ctors
--#if defined(__AVR_HAVE_ELPM__)
-+#if defined(__AVR_TINY__)
-+ ldi r18, hi8(__ctors_start)
-+ ldi r28, lo8(__ctors_end)
-+ ldi r29, hi8(__ctors_end)
-+ rjmp .L__do_global_ctors_start
-+.L__do_global_ctors_loop:
-+ wsubi 28, 2
-+ mov_h r31, r29
-+ mov_l r30, r28
-+ XCALL __tablejump__
-+.L__do_global_ctors_start:
-+ cpi r28, lo8(__ctors_start)
-+ cpc r29, r18
-+ brne .L__do_global_ctors_loop
-+#elif defined(__AVR_HAVE_ELPM__)
- ldi r17, hi8(__ctors_start)
- ldi r28, lo8(__ctors_end)
- ldi r29, hi8(__ctors_end)
-@@ -2035,7 +2049,7 @@ DEFUN __do_global_ctors
- ldi r29, hi8(__ctors_end)
- rjmp .L__do_global_ctors_start
- .L__do_global_ctors_loop:
-- wsubi r28, 2
-+ sbiw r28, 2
- mov_h r31, r29
- mov_l r30, r28
- XCALL __tablejump__
-@@ -2050,7 +2064,21 @@ ENDF __do_global_ctors
- #ifdef L_dtors
- .section .fini6,"ax", at progbits
- DEFUN __do_global_dtors
--#if defined(__AVR_HAVE_ELPM__)
-+#if defined(__AVR_TINY__)
-+ ldi r18, hi8(__dtors_end)
-+ ldi r28, lo8(__dtors_start)
-+ ldi r29, hi8(__dtors_start)
-+ rjmp .L__do_global_dtors_start
-+.L__do_global_dtors_loop:
-+ mov_h r31, r29
-+ mov_l r30, r28
-+ XCALL __tablejump__
-+ wsubi 28, -2
-+.L__do_global_dtors_start:
-+ cpi r28, lo8(__dtors_end)
-+ cpc r29, r18
-+ brne .L__do_global_dtors_loop
-+#elif defined(__AVR_HAVE_ELPM__)
- ldi r17, hi8(__dtors_end)
- ldi r28, lo8(__dtors_start)
- ldi r29, hi8(__dtors_start)
-@@ -2079,7 +2107,7 @@ DEFUN __do_global_dtors
- mov_l r30, r28
- XCALL __tablejump__
- #if defined (__AVR_TINY__)
-- wsubi r28, -2
-+ wsubi 28, -2
- #else
- adiw r28, 2
- #endif
diff --git a/gnu_inline-mismatch.patch b/gnu_inline-mismatch.patch
deleted file mode 100644
index e47a171..0000000
--- a/gnu_inline-mismatch.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From: Mike Frysinger <vapier at gentoo dot org>
-To: gcc-patches at gcc dot gnu dot org
-Subject: [PATCH] cfns: fix mismatch in gnu_inline attributes
-Date: Thu, 6 Aug 2015 23:47:06 -0400
-Message-Id: <1438919226-30427-1-git-send-email-vapier at gentoo.org>
-
-Since the 3.0.3 release of gperf (made in May 2007), the generated func
-has had the gnu_inline attribute applied to it. The gcc source however
-has not been updated to include that which has lead to a mismatch.
-
-In practice, this hasn't been an issue for two reasons:
-(1) Before gcc-5, the default standard was (gnu) C89, and gcc does not
-warn or throw an error in this mode.
-(2) Starting with gcc-4.8, the compiler driver used to build gcc was
-changed to C++, and g++ does not warn or throw an error in this mode.
-
-This error does show up though when using gcc-5 to build gcc-4.7 or
-older as then the default is (gnu) C11 and the C compiler driver is
-used. That failure looks like:
-In file included from .../gcc-4.7.4/gcc/cp/except.c:990:0:
-cfns.gperf: At top level:
-cfns.gperf:101:1: error: 'gnu_inline' attribute present on 'libc_name_p'
-cfns.gperf:26:14: error: but not here
-
-Whether the compiler should always emit this error regardless of the
-active standard or compiler driver is debatable (I think it should be
-consistent -- either always do it or never do it).
-
-2015-08-06 Mike Frysinger <vapier at gentoo.org>
-
- * cfns.gperf [__GNUC__, __GNUC_STDC_INLINE__]: Apply the
- __gnu_inline__ attribute.
- * cfns.h: Regenerated.
----
- gcc/cp/cfns.gperf | 3 +++
- gcc/cp/cfns.h | 3 +++
- 2 files changed, 6 insertions(+)
-
-diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
-index 68acd3d..953262f 100644
---- a/gcc/cp/cfns.gperf
-+++ b/gcc/cp/cfns.gperf
-@@ -22,6 +22,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);
- %}
-diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
-index 1c6665d..6d00c0e 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 */
---
-2.4.4
-
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/crossavr-gcc.git/commitdiff/c05f3826462966c76cebee573dec92d9ebb99697
More information about the pld-cvs-commit
mailing list