- patches synchronized with FreeBSD ports (includes recent changes from WinAVR project)
Changed files:
crossavr-gcc-attribute_alias.patch -> 1.2
crossavr-gcc-bug-11259-v3.patch -> 1.2
crossavr-gcc-bug-18145.patch -> 1.1
crossavr-gcc-bug-19636-24894-31644-31786.patch -> 1.1
crossavr-gcc-bug-34210-35508.patch -> 1.1
crossavr-gcc-bug-35013.patch -> 1.2
crossavr-gcc-bug-spill-v4.patch -> 1.2
crossavr-gcc-builtins-v6.patch -> 1.2
crossavr-gcc-dwarf.patch -> 1.2
crossavr-gcc-libgcc.patch -> 1.1
crossavr-gcc-libiberty-Makefile.in.patch -> 1.2
crossavr-gcc-new-devices.patch -> 1.1
crossavr-gcc-osmain.patch -> 1.2
crossavr-gcc-param-inline-call-cost.patch -> 1.1
crossavr-gcc-xmega-v9.patch -> 1.2
crossavr-gcc-xmega.patch -> 1.1
crossavr-gcc-xmega2.patch -> 1.2
crossavr-gcc.spec -> 1.36
+++ /dev/null
---- gcc/config/avr/avr.h.orig Sat Jun 25 03:22:41 2005
-+++ gcc/config/avr/avr.h Tue Sep 26 23:07:01 2006
-@@ -631,6 +631,8 @@
- /* Globalizing directive for a label. */
- #define GLOBAL_ASM_OP ".global\t"
-
-+#define SET_ASM_OP "\t.set\t"
-+
- #define ASM_WEAKEN_LABEL(FILE, NAME) \
- do \
- { \
-Index: gcc/config/avr/avr.md
-===================================================================
---- gcc/config/avr/avr.md (revision 129892)
-+++ gcc/config/avr/avr.md (working copy)
-@@ -45,21 +45,22 @@
- (REG_SP 32)
- (TMP_REGNO 0) ; temporary register r0
- (ZERO_REGNO 1) ; zero register r1
-
- (SREG_ADDR 0x5F)
- (RAMPZ_ADDR 0x5B)
-
- (UNSPEC_STRLEN 0)
+diff -ur ../gcc-4.3.4.orig/gcc/config/avr/avr.md ./gcc/config/avr/avr.md
+--- ../gcc-4.3.4.orig/gcc/config/avr/avr.md 2009-10-02 15:08:58.000000000 +0200
++++ ./gcc/config/avr/avr.md 2009-10-02 15:09:26.000000000 +0200
+@@ -54,6 +54,7 @@
(UNSPEC_INDEX_JMP 1)
(UNSPEC_SEI 2)
(UNSPEC_CLI 3)
(UNSPECV_PROLOGUE_SAVES 0)
(UNSPECV_EPILOGUE_RESTORES 1)])
-
- (include "predicates.md")
- (include "constraints.md")
-
- ;; Condition code settings.
- (define_attr "cc" "none,set_czn,set_zn,set_n,compare,clobber"
- (const_string "none"))
-@@ -1185,20 +1186,33 @@
- return (AS2 (andi, %A0,lo8(%2)) CR_TAB
- AS2 (andi, %B0,hi8(%2)) CR_TAB
- AS2 (andi, %C0,hlo8(%2)) CR_TAB
- AS2 (andi, %D0,hhi8(%2)));
- }
- return \"bug\";
- }"
+@@ -1183,6 +1184,19 @@
[(set_attr "length" "4,4")
- (set_attr "cc" "set_n,set_n")])
+ (set_attr "cc" "set_n,clobber")])
+(define_peephole2 ; andi
+ [(set (match_operand:QI 0 "d_register_operand" "")
;;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
;; ior
- (define_insn "iorqi3"
- [(set (match_operand:QI 0 "register_operand" "=r,d")
- (ior:QI (match_operand:QI 1 "register_operand" "%0,0")
- (match_operand:QI 2 "nonmemory_operand" "r,i")))]
- ""
- "@
- or %0,%2
-@@ -1313,24 +1327,71 @@
- (xor:SI (match_operand:SI 1 "register_operand" "%0")
- (match_operand:SI 2 "register_operand" "r")))]
- ""
- "eor %0,%2
- eor %B0,%B2
- eor %C0,%C2
- eor %D0,%D2"
+@@ -1311,10 +1325,57 @@
[(set_attr "length" "4")
(set_attr "cc" "set_n")])
[(set (match_operand:QI 0 "register_operand" "=r,r,r,r,!d,r,r")
(ashift:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0,0,0")
(match_operand:QI 2 "general_operand" "r,L,P,K,n,n,Qm")))]
- ""
- "* return ashlqi3_out (insn, operands, NULL);"
- [(set_attr "length" "5,0,1,2,4,6,9")
- (set_attr "cc" "clobber,none,set_czn,set_czn,set_czn,set_czn,clobber")])
-
- (define_insn "ashlhi3"
- [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r,r")
-@@ -1346,20 +1407,61 @@
- (ashift:SI (match_operand:SI 1 "register_operand" "0,0,0,r,0,0,0")
- (match_operand:QI 2 "general_operand" "r,L,P,O,K,n,Qm")))]
- ""
- "* return ashlsi3_out (insn, operands, NULL);"
- [(set_attr "length" "8,0,4,4,8,10,12")
- (set_attr "cc" "clobber,none,set_n,clobber,set_n,clobber,clobber")])
-
+@@ -1344,6 +1405,47 @@
;; Optimize if a scratch register from LD_REGS happens to be available.
(define_peephole2
[(match_scratch:QI 3 "d")
(set (match_operand:HI 0 "register_operand" "")
(ashift:HI (match_operand:HI 1 "register_operand" "")
- (match_operand:QI 2 "const_int_operand" "")))]
- ""
- [(parallel [(set (match_dup 0) (ashift:HI (match_dup 1) (match_dup 2)))
- (clobber (match_dup 3))])]
- "if (!avr_peep2_scratch_safe (operands[3]))
- FAIL;")
-
-@@ -1464,21 +1566,63 @@
- (match_operand:QI 2 "const_int_operand" "L,P,O,n")))
- (clobber (match_scratch:QI 3 "=X,X,X,&d"))]
- "reload_completed"
- "* return ashrsi3_out (insn, operands, NULL);"
- [(set_attr "length" "0,4,4,10")
- (set_attr "cc" "none,clobber,set_n,clobber")])
-
+@@ -1462,7 +1564,49 @@
;; >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
;; logical shift right
[(set (match_operand:QI 0 "register_operand" "=r,r,r,r,!d,r,r")
(lshiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0,0,0")
(match_operand:QI 2 "general_operand" "r,L,P,K,n,n,Qm")))]
- ""
- "* return lshrqi3_out (insn, operands, NULL);"
- [(set_attr "length" "5,0,1,2,4,6,9")
- (set_attr "cc" "clobber,none,set_czn,set_czn,set_czn,set_czn,clobber")])
-
- (define_insn "lshrhi3"
- [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r,r")
-@@ -1494,20 +1638,61 @@
- (lshiftrt:SI (match_operand:SI 1 "register_operand" "0,0,0,r,0,0,0")
- (match_operand:QI 2 "general_operand" "r,L,P,O,K,n,Qm")))]
- ""
- "* return lshrsi3_out (insn, operands, NULL);"
- [(set_attr "length" "8,0,4,4,8,10,12")
- (set_attr "cc" "clobber,none,clobber,clobber,clobber,clobber,clobber")])
-
+@@ -1492,6 +1636,47 @@
;; Optimize if a scratch register from LD_REGS happens to be available.
(define_peephole2
[(match_scratch:QI 3 "d")
(set (match_operand:HI 0 "register_operand" "")
(lshiftrt:HI (match_operand:HI 1 "register_operand" "")
- (match_operand:QI 2 "const_int_operand" "")))]
- ""
- [(parallel [(set (match_dup 0) (lshiftrt:HI (match_dup 1) (match_dup 2)))
- (clobber (match_dup 3))])]
- "if (!avr_peep2_scratch_safe (operands[3]))
- FAIL;")
-
+Only in ./gcc/config/avr: avr.md.orig
--- /dev/null
+--- ./gcc/config/avr/avr.c.orig 2010-03-05 15:10:10.000000000 +0100
++++ ./gcc/config/avr/avr.c 2010-03-05 15:20:53.000000000 +0100
+@@ -72,6 +72,12 @@
+ static void avr_insert_attributes (tree, tree *);
+ static void avr_asm_init_sections (void);
+ static unsigned int avr_section_type_flags (tree, const char *, int);
++static void avr_asm_named_section (const char *name, unsigned int flags, tree decl);
++/* Track if code will use .bss and/or .data */
++static int avr_need_clear_bss_p = 0;
++static int avr_need_copy_data_p = 0;
++static void avr_output_data_section_asm_op (const void*);
++static void avr_output_bss_section_asm_op (const void*);
+
+ static void avr_reorg (void);
+ static void avr_asm_out_ctor (rtx, int);
+@@ -4782,6 +4788,54 @@
+ fprintf (asm_out_file, "\t.p2align 1\n");
+ }
+
++/* ASM_OUTPUT_COMMON */
++/* Track need of __do_clear_bss */
++
++void
++avr_asm_output_common (FILE *stream, const char *name,
++ unsigned HOST_WIDE_INT size,
++ unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED)
++{
++ avr_need_clear_bss_p = 1;
++ fputs ("\t.comm ", stream);
++ assemble_name (stream, name);
++ fprintf (stream, ",%lu,1\n", (unsigned long) size);
++}
++
++/* ASM_OUTPUT_LOCAL */
++/* Track need of __do_clear_bss */
++
++void
++avr_asm_output_local (FILE *stream, const char *name,
++ unsigned HOST_WIDE_INT size,
++ unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED)
++{
++ avr_need_clear_bss_p = 1;
++ fputs ("\t.lcomm ", stream);
++ assemble_name (stream, name);
++ fprintf (stream, ",%d\n", (int) size);
++}
++
++/* Unnamed section callback to track need of __do_copy_data */
++
++static void
++avr_output_data_section_asm_op (const void *data)
++{
++ avr_need_copy_data_p = 1;
++ /* Dispatch to default */
++ output_section_asm_op (data);
++}
++
++/* Unnamed section callback to track need of __do_clear_bss */
++
++static void
++avr_output_bss_section_asm_op (const void *data)
++{
++ avr_need_clear_bss_p = 1;
++ /* Dispatch to default */
++ output_section_asm_op (data);
++}
++
+ /* Implement TARGET_ASM_INIT_SECTIONS. */
+
+ static void
+@@ -4791,6 +4845,27 @@
+ avr_output_progmem_section_asm_op,
+ NULL);
+ readonly_data_section = data_section;
++
++ data_section->unnamed.callback = avr_output_data_section_asm_op;
++ bss_section->unnamed.callback = avr_output_bss_section_asm_op;
++}
++
++/* TARGET_ASM_NAMED_SECTION */
++/* Track need of __do_clear_bss, __do_copy_data for named sections */
++
++static void
++avr_asm_named_section (const char *name, unsigned int flags, tree decl)
++{
++ if (!avr_need_copy_data_p)
++ avr_need_copy_data_p =
++ (0 == strncmp (name, ".data", 5)
++ || 0 == strncmp (name, ".rodata", 7)
++ || 0 == strncmp (name, ".gnu.linkonce.", 14));
++
++ if (!avr_need_clear_bss_p)
++ avr_need_clear_bss_p = (0 == strncmp (name, ".bss", 4));
++
++ default_elf_asm_named_section (name, flags, decl);
+ }
+
+ static unsigned int
+@@ -4829,12 +4904,6 @@
+
+ fputs ("__tmp_reg__ = 0\n"
+ "__zero_reg__ = 1\n", asm_out_file);
+-
+- /* FIXME: output these only if there is anything in the .data / .bss
+- sections - some code size could be saved by not linking in the
+- initialization code from libgcc if one or both sections are empty. */
+- fputs ("\t.global __do_copy_data\n", asm_out_file);
+- fputs ("\t.global __do_clear_bss\n", asm_out_file);
+ }
+
+ /* Outputs to the stdio stream FILE some
+@@ -4843,6 +4912,16 @@
+ static void
+ avr_file_end (void)
+ {
++ /* Output these only if there is anything in the
++ .data* / .rodata* / .gnu.linkonce.* resp. .bss*
++ input section(s) - some code size can be saved by not
++ linking in the initialization code from libgcc if resp.
++ sections are empty. */
++ if (avr_need_copy_data_p)
++ fputs (".global __do_copy_data\n", asm_out_file);
++
++ if (avr_need_clear_bss_p)
++ fputs (".global __do_clear_bss\n", asm_out_file);
+ }
+
+ /* Choose the order in which to allocate hard registers for
+--- ./gcc/config/avr/avr.h.orig 2010-03-05 15:10:10.000000000 +0100
++++ ./gcc/config/avr/avr.h 2010-03-05 15:20:53.000000000 +0100
+@@ -533,29 +533,21 @@
+ #define ASM_APP_OFF "/* #NOAPP */\n"
+
+ /* Switch into a generic section. */
+-#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
++#define TARGET_ASM_NAMED_SECTION avr_asm_named_section
+ #define TARGET_ASM_INIT_SECTIONS avr_asm_init_sections
+
+ #define ASM_OUTPUT_ASCII(FILE, P, SIZE) gas_output_ascii (FILE,P,SIZE)
+
+ #define IS_ASM_LOGICAL_LINE_SEPARATOR(C, STR) ((C) == '\n' || ((C) == '$'))
+
+-#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
+-do { \
+- fputs ("\t.comm ", (STREAM)); \
+- assemble_name ((STREAM), (NAME)); \
+- fprintf ((STREAM), ",%lu,1\n", (unsigned long)(SIZE)); \
+-} while (0)
++#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
++ avr_asm_output_common (STREAM, NAME, SIZE, ROUNDED)
+
+-#define ASM_OUTPUT_BSS(FILE, DECL, NAME, SIZE, ROUNDED) \
+- asm_output_bss ((FILE), (DECL), (NAME), (SIZE), (ROUNDED))
++#define ASM_OUTPUT_BSS(FILE, DECL, NAME, SIZE, ROUNDED) \
++ asm_output_bss ((FILE), (DECL), (NAME), (SIZE), (ROUNDED))
+
+-#define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \
+-do { \
+- fputs ("\t.lcomm ", (STREAM)); \
+- assemble_name ((STREAM), (NAME)); \
+- fprintf ((STREAM), ",%d\n", (int)(SIZE)); \
+-} while (0)
++#define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \
++ avr_asm_output_local (STREAM, NAME, SIZE, ROUNDED)
+
+ #undef TYPE_ASM_OP
+ #undef SIZE_ASM_OP
+--- ./gcc/config/avr/avr-protos.h.orig 2008-06-15 23:32:29.000000000 +0200
++++ ./gcc/config/avr/avr-protos.h 2010-03-05 15:20:53.000000000 +0100
+@@ -38,6 +38,8 @@
+ extern void gas_output_limited_string (FILE *file, const char *str);
+ extern void gas_output_ascii (FILE *file, const char *str, size_t length);
+ extern int avr_hard_regno_rename_ok (unsigned int, unsigned int);
++extern void avr_asm_output_common (FILE *stream, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded);
++extern void avr_asm_output_local (FILE *stream, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded);
+
+ #ifdef TREE_CODE
+ extern void asm_output_external (FILE *file, tree decl, char *name);
+@@ -123,6 +125,7 @@
+ extern int compare_eq_p (rtx insn);
+ extern void out_shift_with_cnt (const char *template, rtx insn,
+ rtx operands[], int *len, int t_len);
++extern rtx avr_return_addr_rtx (int count, rtx tem);
+ extern int avr_io_address_p (rtx x, int size);
+ extern int avr_peep2_scratch_safe (rtx reg_rtx);
+ #endif /* RTX_CODE */
-
-2008-09-10 Andy Hutchinson <hutchinsonandy@aim.com>
-
- * config/avr/avr.c (legitimate_address_p): Fix problem where subreg
- is not recognized as a valid register usage. Allow REG_X to be used
- as a base pointer.
- * config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Remove code that
- forces a reload when using a base register.
-
-
-Index: gcc/config/avr/avr.c
-===================================================================
---- gcc/config/avr/avr.c (revision 140164)
-+++ gcc/config/avr/avr.c (working copy)
-@@ -1089,6 +1089,8 @@
+--- gcc/config/avr/avr.h.orig 2010-03-05 15:20:53.000000000 +0100
++++ gcc/config/avr/avr.h 2010-03-05 15:22:53.000000000 +0100
+@@ -470,10 +470,6 @@
+ OPNUM, TYPE); \
+ goto WIN; \
+ } \
+- push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL, \
+- BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
+- OPNUM, TYPE); \
+- goto WIN; \
+ } \
+ else if (! (frame_pointer_needed && XEXP (X,0) == frame_pointer_rtx)) \
+ { \
+--- gcc/config/avr/avr.c.orig 2010-03-05 15:20:53.000000000 +0100
++++ gcc/config/avr/avr.c 2010-03-05 15:22:53.000000000 +0100
+@@ -993,6 +993,8 @@
true_regnum (XEXP (x, 0)));
debug_rtx (x);
}
if (REG_P (x) && (strict ? REG_OK_FOR_BASE_STRICT_P (x)
: REG_OK_FOR_BASE_NOSTRICT_P (x)))
r = POINTER_REGS;
-@@ -1103,6 +1105,7 @@
+@@ -1007,6 +1009,7 @@
if (fit)
{
if (! strict
|| REGNO (XEXP (x,0)) == REG_Y
|| REGNO (XEXP (x,0)) == REG_Z)
r = BASE_POINTER_REGS;
-Index: gcc/config/avr/avr.h
-===================================================================
---- gcc/config/avr/avr.h (revision 140164)
-+++ gcc/config/avr/avr.h (working copy)
-@@ -483,10 +483,6 @@
- OPNUM, TYPE); \
- goto WIN; \
- } \
-- push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL, \
-- BASE_POINTER_REGS, GET_MODE (X), VOIDmode, 0, 0, \
-- OPNUM, TYPE); \
-- goto WIN; \
- } \
- else if (! (frame_pointer_needed && XEXP (X,0) == frame_pointer_rtx)) \
- { \
-
--- /dev/null
+Fix for bugs #34210, #35508.
+
+===================================================================
+--- libgcc/config.host.orig 2008-01-25 13:49:04.000000000 -0700
++++ libgcc/config.host 2008-03-22 22:04:25.965018200 -0600
+@@ -77,6 +77,9 @@ strongarm*-*-*)
+ arm*-*-*)
+ cpu_type=arm
+ ;;
++avr-*-*)
++ cpu_type=avr
++ ;;
+ bfin*-*)
+ cpu_type=bfin
+ ;;
+@@ -243,6 +246,8 @@ arm*-*-kaos*)
+ avr-*-rtems*)
+ ;;
+ avr-*-*)
++ # Make HImode functions for AVR
++ tmake_file=${cpu_type}/t-avr
+ ;;
+ bfin*-elf*)
+ ;;
+Index: config/avr/t-avr
+===================================================================
+--- libgcc/config/avr/t-avr (revision 0)
++++ libgcc/config/avr/t-avr (revision 0)
+@@ -0,0 +1,19 @@
++# Extra 16-bit integer functions.
++intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 _ffsXX2 _clzXX2 \
++ _ctzXX2 _popcountXX2 _parityXX2
++hiintfuncs16 = $(subst XX,hi,$(intfuncs16))
++siintfuncs16 = $(subst XX,si,$(intfuncs16))
++
++iter-items := $(hiintfuncs16)
++iter-labels := $(siintfuncs16)
++iter-sizes := $(patsubst %,2,$(siintfuncs16)) $(patsubst %,2,$(hiintfuncs16))
++
++
++include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items))
++libgcc-objects += $(patsubst %,%$(objext),$(hiintfuncs16))
++
++ifeq ($(enable_shared),yes)
++libgcc-s-objects += $(patsubst %,%_s$(objext),$(hiintfuncs16))
++endif
++
++
-Patch to fix GCC bug #35013.
-
-Index: avr-protos.h
-===================================================================
---- gcc/config/avr/avr-protos.h (revision 132369)
-+++ gcc/config/avr/avr-protos.h (working copy)
-@@ -111,6 +111,7 @@
+--- ./gcc/config/avr/avr-protos.h.orig 2010-03-05 15:20:53.000000000 +0100
++++ ./gcc/config/avr/avr-protos.h 2010-03-05 15:24:52.000000000 +0100
+@@ -114,6 +114,7 @@
extern int _reg_unused_after (rtx insn, rtx reg);
extern int avr_jump_mode (rtx x, rtx insn);
extern int byte_immediate_operand (rtx op, enum machine_mode mode);
extern int test_hard_reg_class (enum reg_class class, rtx x);
extern int jump_over_one_insn_p (rtx insn, rtx dest);
-Index: avr.c
-===================================================================
---- gcc/config/avr/avr.c (revision 132366)
-+++ gcc/config/avr/avr.c (working copy)
-@@ -1116,8 +1116,7 @@
+--- ./gcc/config/avr/avr.c.orig 2010-03-05 15:22:53.000000000 +0100
++++ ./gcc/config/avr/avr.c 2010-03-05 15:24:52.000000000 +0100
+@@ -1136,8 +1136,7 @@
default:
if (CONSTANT_ADDRESS_P (addr)
- || GET_CODE (addr) == LABEL_REF))
+ && text_segment_operand (addr, VOIDmode))
{
- fprintf (file, "pm(");
+ fprintf (file, "gs(");
output_addr_const (file,addr);
-@@ -1428,6 +1427,26 @@
+@@ -1453,6 +1452,26 @@
&& INTVAL (op) <= 0xff && INTVAL (op) >= 0);
}
/* Output all insn addresses and their sizes into the assembly language
output file. This is helpful for debugging whether the length attributes
in the md file are correct.
-@@ -4465,8 +4484,7 @@
+@@ -4490,8 +4509,7 @@
avr_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
if (size == POINTER_SIZE / BITS_PER_UNIT && aligned_p
- || GET_CODE (x) == LABEL_REF))
+ && text_segment_operand (x, VOIDmode) )
{
- fputs ("\t.word\tpm(", asm_out_file);
+ fputs ("\t.word\tgs(", asm_out_file);
output_addr_const (asm_out_file, x);
-Index: gcc/config/avr/predicates.md
-===================================================================
---- gcc/config/avr/predicates.md (revision 134489)
-+++ gcc/config/avr/predicates.md (working copy)
+--- ./gcc/config/avr/predicates.md.orig 2007-08-02 12:49:31.000000000 +0200
++++ ./gcc/config/avr/predicates.md 2010-03-05 15:25:53.000000000 +0100
@@ -27,6 +27,11 @@
(and (match_code "reg")
(match_test "REGNO (op) >= 16 && REGNO (op) <= 31")))
(define_predicate "even_register_operand"
(and (match_code "reg")
(and (match_test "REGNO (op) <= 31")
---- gcc/config/avr/avr.md.orig 2008-12-02 12:44:25.418762100 -0700
-+++ gcc/config/avr/avr.md 2008-12-02 15:31:40.788948300 -0700
-@@ -49,12 +49,26 @@
+--- ./gcc/config/avr/avr.md.orig 2010-03-05 15:20:25.000000000 +0100
++++ ./gcc/config/avr/avr.md 2010-03-05 15:25:53.000000000 +0100
+@@ -52,12 +52,26 @@
(UNSPEC_STRLEN 0)
(UNSPEC_INDEX_JMP 1)
(include "predicates.md")
(include "constraints.md")
-@@ -2537,13 +2551,6 @@
+@@ -2541,13 +2555,6 @@
(const_int 1))
(const_int 3)])])
; indirect jump
(define_insn "indirect_jump"
[(set (pc) (match_operand:HI 0 "register_operand" "!z,*r"))]
-@@ -2923,7 +2930,7 @@
+@@ -2925,7 +2932,7 @@
;; Enable Interrupts
(define_insn "enable_interrupt"
""
"sei"
[(set_attr "length" "1")
-@@ -2932,7 +2939,7 @@
+@@ -2934,7 +2941,7 @@
;; Disable Interrupts
(define_insn "disable_interrupt"
""
"cli"
[(set_attr "length" "1")
-@@ -3032,3 +3039,219 @@
+@@ -3034,3 +3041,219 @@
expand_epilogue ();
DONE;
}")
+ [(set_attr "length" "3")
+ (set_attr "cc" "clobber")])
+
---- gcc/config/avr/avr.c.orig 2008-12-01 10:51:45.062273700 -0700
-+++ gcc/config/avr/avr.c 2008-12-01 11:18:33.980387900 -0700
+--- ./gcc/config/avr/avr.c.orig 2010-03-05 15:24:52.000000000 +0100
++++ ./gcc/config/avr/avr.c 2010-03-05 15:25:53.000000000 +0100
@@ -30,6 +30,7 @@
#include "insn-config.h"
#include "conditions.h"
#include "tm_p.h"
#include "target.h"
#include "target-def.h"
-@@ -83,6 +86,9 @@ static bool avr_rtx_costs (rtx, int, int
+@@ -87,6 +90,9 @@
static int avr_address_cost (rtx);
static bool avr_return_in_memory (const_tree, const_tree);
static struct machine_function * avr_init_machine_status (void);
/* Allocate registers from r25 to r8 for parameters for function calls. */
#define FIRST_CUM_REG 26
-@@ -373,6 +379,12 @@ int avr_case_values_threshold = 30000;
+@@ -340,6 +346,12 @@
#undef TARGET_STRICT_ARGUMENT_NAMING
#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true
struct gcc_target targetm = TARGET_INITIALIZER;
\f
void
-@@ -6258,4 +6270,237 @@ avr_return_in_memory (const_tree type, c
+@@ -6079,4 +6091,237 @@
return false;
}
+++ /dev/null
---- gcc/config/avr/avr.h.orig 2006-04-13 15:31:19.000000000 +0200
-+++ gcc/config/avr/avr.h 2006-04-13 16:23:16.000000000 +0200
-@@ -892,3 +892,7 @@
- #define ZERO_REGNO 1
-
-+#define DWARF2_DEBUGGING_INFO 1
- #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-+
-+/* Offset from the frame pointer register value to the top of the stack. */
-+#define FRAME_POINTER_CFA_OFFSET(FNDECL) 0
--- /dev/null
+diff -ur ../gcc-4.3.4.orig/gcc/config/avr/avr.c ./gcc/config/avr/avr.c
+--- ../gcc-4.3.4.orig/gcc/config/avr/avr.c 2008-06-15 23:32:29.000000000 +0200
++++ ./gcc/config/avr/avr.c 2009-10-02 14:27:56.000000000 +0200
+@@ -127,7 +127,8 @@
+ { 0, 0, 1, 1, 0, 0, 0, 0, "__AVR_ARCH__=35" },
+ { 0, 1, 0, 1, 0, 0, 0, 0, "__AVR_ARCH__=4" },
+ { 0, 1, 1, 1, 0, 0, 0, 0, "__AVR_ARCH__=5" },
+- { 0, 1, 1, 1, 1, 1, 0, 0, "__AVR_ARCH__=51" }
++ { 0, 1, 1, 1, 1, 1, 0, 0, "__AVR_ARCH__=51" },
++ { 0, 1, 1, 1, 1, 1, 1, 0, "__AVR_ARCH__=6" }
+ };
+
+ /* These names are used as the index into the avr_arch_types[] table
+@@ -144,7 +145,8 @@
+ ARCH_AVR35,
+ ARCH_AVR4,
+ ARCH_AVR5,
+- ARCH_AVR51
++ ARCH_AVR51,
++ ARCH_AVR6
+ };
+
+ struct mcu_type_s {
+@@ -273,6 +275,10 @@
+ { "at90can128", ARCH_AVR51, "__AVR_AT90CAN128__" },
+ { "at90usb1286", ARCH_AVR51, "__AVR_AT90USB1286__" },
+ { "at90usb1287", ARCH_AVR51, "__AVR_AT90USB1287__" },
++ /* 3-Byte PC. */
++ { "avr6", ARCH_AVR6, NULL },
++ { "atmega2560", ARCH_AVR6, "__AVR_ATmega2560__" },
++ { "atmega2561", ARCH_AVR6, "__AVR_ATmega2561__" },
+ /* Assembler only. */
+ { "avr1", ARCH_AVR1, NULL },
+ { "at90s1200", ARCH_AVR1, "__AVR_AT90S1200__" },
+@@ -513,9 +519,10 @@
+ else
+ {
+ int offset = frame_pointer_needed ? 2 : 0;
++ int avr_pc_size = AVR_HAVE_EIJMP_EICALL ? 3 : 2;
+
+ offset += avr_regs_to_save (NULL);
+- return get_frame_size () + 2 + 1 + offset;
++ return get_frame_size () + (avr_pc_size) + 1 + offset;
+ }
+ }
+
+@@ -662,7 +669,9 @@
+ /* Prevent any attempt to delete the setting of ZERO_REG! */
+ emit_insn (gen_rtx_USE (VOIDmode, zero_reg_rtx));
+ }
+- if (minimize && (frame_pointer_needed || live_seq > 6))
++ if (minimize && (frame_pointer_needed
++ || (AVR_2_BYTE_PC && live_seq > 6)
++ || live_seq > 7))
+ {
+ insn = emit_move_insn (gen_rtx_REG (HImode, REG_X),
+ gen_int_mode (size, HImode));
+@@ -1121,7 +1130,7 @@
+ && ((GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (addr))
+ || GET_CODE (addr) == LABEL_REF))
+ {
+- fprintf (file, "pm(");
++ fprintf (file, "gs(");
+ output_addr_const (file,addr);
+ fprintf (file ,")");
+ }
+@@ -1146,6 +1155,11 @@
+ if (!AVR_MEGA)
+ fputc ('r', file);
+ }
++ else if (code == '!')
++ {
++ if (AVR_HAVE_EIJMP_EICALL)
++ fputc ('e', file);
++ }
+ else if (REG_P (x))
+ {
+ if (x == zero_reg_rtx)
+@@ -4470,7 +4484,7 @@
+ && ((GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (x))
+ || GET_CODE (x) == LABEL_REF))
+ {
+- fputs ("\t.word\tpm(", asm_out_file);
++ fputs ("\t.word\tgs(", asm_out_file);
+ output_addr_const (asm_out_file, x);
+ fputs (")\n", asm_out_file);
+ return true;
+@@ -5817,7 +5831,7 @@
+ {
+ switch_to_section (progmem_section);
+ if (AVR_MEGA)
+- fprintf (stream, "\t.word pm(.L%d)\n", value);
++ fprintf (stream, "\t.word gs(.L%d)\n", value);
+ else
+ fprintf (stream, "\trjmp .L%d\n", value);
+ }
+Only in ./gcc/config/avr: avr.c.orig
+diff -ur ../gcc-4.3.4.orig/gcc/config/avr/avr.h ./gcc/config/avr/avr.h
+--- ../gcc-4.3.4.orig/gcc/config/avr/avr.h 2008-06-15 23:32:29.000000000 +0200
++++ ./gcc/config/avr/avr.h 2009-10-02 14:27:56.000000000 +0200
+@@ -80,6 +80,12 @@
+ builtin_define ("__AVR_MEGA__"); \
+ if (avr_current_arch->have_jmp_call) \
+ builtin_define ("__AVR_HAVE_JMP_CALL__"); \
++ if (!avr_current_arch->have_eijmp_eicall) \
++ builtin_define ("__AVR_2_BYTE_PC__"); \
++ if (avr_current_arch->have_eijmp_eicall) \
++ builtin_define ("__AVR_3_BYTE_PC__"); \
++ if (avr_current_arch->have_eijmp_eicall) \
++ builtin_define ("__AVR_HAVE_EIJMP_EICALL__"); \
+ if (TARGET_NO_INTERRUPTS) \
+ builtin_define ("__NO_INTERRUPTS__"); \
+ } \
+@@ -100,9 +106,10 @@
+ #define AVR_HAVE_MOVW (avr_have_movw_lpmx_p)
+ #define AVR_HAVE_LPMX (avr_have_movw_lpmx_p)
+ #define AVR_HAVE_RAMPZ (avr_current_arch->have_elpm)
++#define AVR_HAVE_EIJMP_EICALL (avr_current_arch->have_eijmp_eicall)
+
+-#define AVR_2_BYTE_PC 1
+-#define AVR_3_BYTE_PC 0
++#define AVR_2_BYTE_PC (!AVR_HAVE_EIJMP_EICALL)
++#define AVR_3_BYTE_PC (AVR_HAVE_EIJMP_EICALL)
+
+ #define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)");
+
+@@ -681,7 +688,7 @@
+
+ #define PRINT_OPERAND(STREAM, X, CODE) print_operand (STREAM, X, CODE)
+
+-#define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '~')
++#define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '~' || (CODE) == '!')
+
+ #define PRINT_OPERAND_ADDRESS(STREAM, X) print_operand_address(STREAM, X)
+
+@@ -838,6 +845,7 @@
+ mmcu=at90usb64*|\
+ mmcu=at90usb128*|\
+ mmcu=at94k: -m avr5}\
++%{mmcu=atmega256*:-m avr6}\
+ %{mmcu=atmega324*|\
+ mmcu=atmega325*|\
+ mmcu=atmega328p|\
+@@ -866,7 +874,8 @@
+ mmcu=at90usb*: -Tdata 0x800100}\
+ %{mmcu=atmega640|\
+ mmcu=atmega1280|\
+- mmcu=atmega1281: -Tdata 0x800200} "
++ mmcu=atmega1281|\
++ mmcu=atmega256*: -Tdata 0x800200} "
+
+ #define LIB_SPEC \
+ "%{!mmcu=at90s1*:%{!mmcu=attiny11:%{!mmcu=attiny12:%{!mmcu=attiny15:%{!mmcu=attiny28: -lc }}}}}"
+@@ -978,6 +987,8 @@
+ %{mmcu=atmega1280:crtm1280.o%s} \
+ %{mmcu=atmega1281:crtm1281.o%s} \
+ %{mmcu=atmega1284p:crtm1284p.o%s} \
++%{mmcu=atmega2560:crtm2560.o%s} \
++%{mmcu=atmega2561:crtm2561.o%s} \
+ %{mmcu=at90can128:crtcan128.o%s} \
+ %{mmcu=at90usb1286:crtusb1286.o%s} \
+ %{mmcu=at90usb1287:crtusb1287.o%s}"
+Only in ./gcc/config/avr: avr.h.orig
+diff -ur ../gcc-4.3.4.orig/gcc/config/avr/avr.md ./gcc/config/avr/avr.md
+--- ../gcc-4.3.4.orig/gcc/config/avr/avr.md 2009-03-09 21:49:28.000000000 +0100
++++ ./gcc/config/avr/avr.md 2009-10-02 14:27:56.000000000 +0200
+@@ -32,6 +32,7 @@
+ ;; p POST_INC or PRE_DEC address as a pointer (X, Y, Z)
+ ;; r POST_INC or PRE_DEC address as a register (r26, r28, r30)
+ ;; ~ Output 'r' if not AVR_MEGA.
++;; ! Output 'e' if AVR_HAVE_EIJMP_EICALL.
+
+ ;; UNSPEC usage:
+ ;; 0 Length of a string, see "strlenhi".
+@@ -2290,22 +2291,22 @@
+ "(register_operand (operands[0], HImode) || CONSTANT_P (operands[0]))"
+ "*{
+ if (which_alternative==0)
+- return \"icall\";
++ return \"%!icall\";
+ else if (which_alternative==1)
+ {
+ if (AVR_HAVE_MOVW)
+ return (AS2 (movw, r30, %0) CR_TAB
+- \"icall\");
++ \"%!icall\");
+ else
+ return (AS2 (mov, r30, %A0) CR_TAB
+ AS2 (mov, r31, %B0) CR_TAB
+- \"icall\");
++ \"%!icall\");
+ }
+ else if (which_alternative==2)
+ return AS1(%~call,%c0);
+ return (AS2 (ldi,r30,lo8(%0)) CR_TAB
+ AS2 (ldi,r31,hi8(%0)) CR_TAB
+- \"icall\");
++ \"%!icall\");
+ }"
+ [(set_attr "cc" "clobber,clobber,clobber,clobber")
+ (set_attr_alternative "length"
+@@ -2327,22 +2328,22 @@
+ "(register_operand (operands[0], VOIDmode) || CONSTANT_P (operands[0]))"
+ "*{
+ if (which_alternative==0)
+- return \"icall\";
++ return \"%!icall\";
+ else if (which_alternative==1)
+ {
+ if (AVR_HAVE_MOVW)
+ return (AS2 (movw, r30, %1) CR_TAB
+- \"icall\");
++ \"%!icall\");
+ else
+ return (AS2 (mov, r30, %A1) CR_TAB
+ AS2 (mov, r31, %B1) CR_TAB
+- \"icall\");
++ \"%!icall\");
+ }
+ else if (which_alternative==2)
+ return AS1(%~call,%c1);
+ return (AS2 (ldi, r30, lo8(%1)) CR_TAB
+ AS2 (ldi, r31, hi8(%1)) CR_TAB
+- \"icall\");
++ \"%!icall\");
+ }"
+ [(set_attr "cc" "clobber,clobber,clobber,clobber")
+ (set_attr_alternative "length"
+@@ -2365,13 +2366,20 @@
+ ; indirect jump
+ (define_insn "indirect_jump"
+ [(set (pc) (match_operand:HI 0 "register_operand" "!z,*r"))]
+- ""
++ "!AVR_HAVE_EIJMP_EICALL"
+ "@
+ ijmp
+ push %A0\;push %B0\;ret"
+ [(set_attr "length" "1,3")
+ (set_attr "cc" "none,none")])
+
++(define_insn "*indirect_jump_avr6"
++ [(set (pc) (match_operand:HI 0 "register_operand" "z"))]
++ "AVR_HAVE_EIJMP_EICALL"
++ "eijmp"
++ [(set_attr "length" "1")
++ (set_attr "cc" "none")])
++
+ ;; table jump
+
+ ;; Table made from "rjmp" instructions for <=8K devices.
+@@ -2380,7 +2388,7 @@
+ UNSPEC_INDEX_JMP))
+ (use (label_ref (match_operand 1 "" "")))
+ (clobber (match_dup 0))]
+- "!AVR_MEGA"
++ "(!AVR_MEGA) && (!AVR_HAVE_EIJMP_EICALL)"
+ "@
+ ijmp
+ push %A0\;push %B0\;ret"
+@@ -2409,7 +2417,7 @@
+ lpm __tmp_reg__,Z+
+ lpm r31,Z
+ mov r30,__tmp_reg__
+- ijmp"
++ %!ijmp"
+ [(set_attr "length" "6")
+ (set_attr "cc" "clobber")])
+
+@@ -2418,7 +2426,7 @@
+ UNSPEC_INDEX_JMP))
+ (use (label_ref (match_operand 1 "" "")))
+ (clobber (match_dup 0))]
+- "AVR_MEGA"
++ "AVR_MEGA && !AVR_HAVE_EIJMP_EICALL"
+ "lsl r30
+ rol r31
+ lpm
+@@ -2758,8 +2766,8 @@
+ (use (reg:HI REG_X))
+ (clobber (reg:HI REG_Z))]
+ ""
+- "ldi r30,pm_lo8(1f)
+- ldi r31,pm_hi8(1f)
++ "ldi r30,lo8(gs(1f))
++ ldi r31,hi8(gs(1f))
+ %~jmp __prologue_saves__+((18 - %0) * 2)
+ 1:"
+ [(set_attr_alternative "length"
+Only in ./gcc/config/avr: avr.md.orig
+diff -ur ../gcc-4.3.4.orig/gcc/config/avr/libgcc.S ./gcc/config/avr/libgcc.S
+--- ../gcc-4.3.4.orig/gcc/config/avr/libgcc.S 2008-01-19 13:15:02.000000000 +0100
++++ ./gcc/config/avr/libgcc.S 2009-10-02 14:27:56.000000000 +0200
+@@ -594,7 +594,12 @@
+ out __SP_H__,r29
+ out __SREG__,__tmp_reg__
+ out __SP_L__,r28
++#if defined (__AVR_HAVE_EIJMP_EICALL__)
++ eijmp
++#else
+ ijmp
++#endif
++
+ .endfunc
+ #endif /* defined (L_prologue) */
+
+@@ -674,13 +679,22 @@
+ lpm __tmp_reg__, Z+
+ lpm r31, Z
+ mov r30, __tmp_reg__
++
++#if defined (__AVR_HAVE_EIJMP_EICALL__)
++ eijmp
++#else
+ ijmp
++#endif
++
+ #else
+ lpm
+ adiw r30, 1
+ push r0
+ lpm
+ push r0
++#if defined (__AVR_HAVE_EIJMP_EICALL__)
++ push __zero_reg__
++#endif
+ ret
+ #endif
+ .endfunc
+diff -ur ../gcc-4.3.4.orig/gcc/config/avr/t-avr ./gcc/config/avr/t-avr
+--- ../gcc-4.3.4.orig/gcc/config/avr/t-avr 2008-01-23 16:07:09.000000000 +0100
++++ ./gcc/config/avr/t-avr 2009-10-02 14:27:56.000000000 +0200
+@@ -37,8 +37,8 @@
+
+ FPBIT = fp-bit.c
+
+-MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51
+-MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51
++MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6
++MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6
+
+ # The many avr2 matches are not listed here - this is the default.
+ MULTILIB_MATCHES = \
+@@ -123,7 +123,9 @@
+ mmcu?avr51=mmcu?atmega1284p \
+ mmcu?avr51=mmcu?at90can128 \
+ mmcu?avr51=mmcu?at90usb1286 \
+- mmcu?avr51=mmcu?at90usb1287
++ mmcu?avr51=mmcu?at90usb1287 \
++ mmcu?avr6=mmcu?atmega2560 \
++ mmcu?avr6=mmcu?atmega2561
+
+ MULTILIB_EXCEPTIONS =
+
---- libiberty/Makefile.in.orig Mon Sep 26 22:55:10 2005
-+++ libiberty/Makefile.in Wed Mar 22 22:13:44 2006
-@@ -275,7 +275,8 @@
+diff -ur ../gcc-4.3.4.orig/libiberty/Makefile.in ./libiberty/Makefile.in
+--- ../gcc-4.3.4.orig/libiberty/Makefile.in 2007-07-25 08:26:45.000000000 +0200
++++ ./libiberty/Makefile.in 2009-10-02 15:20:13.000000000 +0200
+@@ -344,7 +344,8 @@
@MAINT@ echo stamp > stamp-functions
INSTALL_DEST = @INSTALL_DEST@
+#install: install_to_$(INSTALL_DEST) install-subdir
+install:
- install_to_libdir: all
- ${mkinstalldirs} $(DESTDIR)$(libdir)$(MULTISUBDIR)
+ # This is tricky. Even though CC in the Makefile contains
+ # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
+Only in ./libiberty: Makefile.in.orig
--- /dev/null
+--- ./gcc/config/avr/avr.c~ 2010-03-05 17:16:20.000000000 +0100
++++ ./gcc/config/avr/avr.c 2010-03-05 17:19:30.000000000 +0100
+@@ -193,18 +193,28 @@
+ { "at90s8535", ARCH_AVR2, "__AVR_AT90S8535__" },
+ /* Classic + MOVW, <= 8K. */
+ { "avr25", ARCH_AVR25, NULL },
++ { "ata6289", ARCH_AVR25, "__AVR_ATA6289__" },
+ { "attiny13", ARCH_AVR25, "__AVR_ATtiny13__" },
++ { "attiny13a", ARCH_AVR25, "__AVR_ATtiny13A__" },
+ { "attiny2313", ARCH_AVR25, "__AVR_ATtiny2313__" },
++ { "attiny2313a", ARCH_AVR25, "__AVR_ATtiny2313A__" },
+ { "attiny24", ARCH_AVR25, "__AVR_ATtiny24__" },
++ { "attiny24a", ARCH_AVR25, "__AVR_ATtiny24A__" },
++ { "attiny4313", ARCH_AVR25, "__AVR_ATtiny4313__" },
+ { "attiny44", ARCH_AVR25, "__AVR_ATtiny44__" },
++ { "attiny44a", ARCH_AVR25, "__AVR_ATtiny44A__" },
+ { "attiny84", ARCH_AVR25, "__AVR_ATtiny84__" },
+ { "attiny25", ARCH_AVR25, "__AVR_ATtiny25__" },
+ { "attiny45", ARCH_AVR25, "__AVR_ATtiny45__" },
+ { "attiny85", ARCH_AVR25, "__AVR_ATtiny85__" },
+ { "attiny261", ARCH_AVR25, "__AVR_ATtiny261__" },
++ { "attiny261a", ARCH_AVR25, "__AVR_ATtiny261A__" },
+ { "attiny461", ARCH_AVR25, "__AVR_ATtiny461__" },
++ { "attiny461a", ARCH_AVR25, "__AVR_ATtiny461A__" },
+ { "attiny861", ARCH_AVR25, "__AVR_ATtiny861__" },
++ { "attiny861a", ARCH_AVR25, "__AVR_ATtiny861A__" },
+ { "attiny43u", ARCH_AVR25, "__AVR_ATtiny43U__" },
++ { "attiny87", ARCH_AVR25, "__AVR_ATtiny87__" },
+ { "attiny48", ARCH_AVR25, "__AVR_ATtiny48__" },
+ { "attiny88", ARCH_AVR25, "__AVR_ATtiny88__" },
+ { "at86rf401", ARCH_AVR25, "__AVR_AT86RF401__" },
+@@ -220,61 +230,104 @@
+ { "avr35", ARCH_AVR35, NULL },
+ { "at90usb82", ARCH_AVR35, "__AVR_AT90USB82__" },
+ { "at90usb162", ARCH_AVR35, "__AVR_AT90USB162__" },
++ { "atmega8u2", ARCH_AVR35, "__AVR_ATmega8U2__" },
++ { "atmega16u2", ARCH_AVR35, "__AVR_ATmega16U2__" },
++ { "atmega32u2", ARCH_AVR35, "__AVR_ATmega32U2__" },
++ { "attiny167", ARCH_AVR35, "__AVR_ATtiny167__" },
+ /* Enhanced, <= 8K. */
+ { "avr4", ARCH_AVR4, NULL },
+ { "atmega8", ARCH_AVR4, "__AVR_ATmega8__" },
+ { "atmega48", ARCH_AVR4, "__AVR_ATmega48__" },
++ { "atmega48a", ARCH_AVR4, "__AVR_ATmega48A__" },
+ { "atmega48p", ARCH_AVR4, "__AVR_ATmega48P__" },
+ { "atmega88", ARCH_AVR4, "__AVR_ATmega88__" },
++ { "atmega88a", ARCH_AVR4, "__AVR_ATmega88A__" },
+ { "atmega88p", ARCH_AVR4, "__AVR_ATmega88P__" },
++ { "atmega88pa", ARCH_AVR4, "__AVR_ATmega88PA__" },
+ { "atmega8515", ARCH_AVR4, "__AVR_ATmega8515__" },
+ { "atmega8535", ARCH_AVR4, "__AVR_ATmega8535__" },
+ { "atmega8hva", ARCH_AVR4, "__AVR_ATmega8HVA__" },
++ { "atmega4hvd", ARCH_AVR4, "__AVR_ATmega4HVD__" },
++ { "atmega8hvd", ARCH_AVR4, "__AVR_ATmega8HVD__" },
+ { "at90pwm1", ARCH_AVR4, "__AVR_AT90PWM1__" },
+ { "at90pwm2", ARCH_AVR4, "__AVR_AT90PWM2__" },
+ { "at90pwm2b", ARCH_AVR4, "__AVR_AT90PWM2B__" },
+ { "at90pwm3", ARCH_AVR4, "__AVR_AT90PWM3__" },
+ { "at90pwm3b", ARCH_AVR4, "__AVR_AT90PWM3B__" },
++ { "at90pwm81", ARCH_AVR4, "__AVR_AT90PWM81__" },
+ /* Enhanced, > 8K, <= 64K. */
+ { "avr5", ARCH_AVR5, NULL },
+ { "atmega16", ARCH_AVR5, "__AVR_ATmega16__" },
++ { "atmega16a", ARCH_AVR5, "__AVR_ATmega16A__" },
+ { "atmega161", ARCH_AVR5, "__AVR_ATmega161__" },
+ { "atmega162", ARCH_AVR5, "__AVR_ATmega162__" },
+ { "atmega163", ARCH_AVR5, "__AVR_ATmega163__" },
++ { "atmega164a", ARCH_AVR5, "__AVR_ATmega164A__" },
+ { "atmega164p", ARCH_AVR5, "__AVR_ATmega164P__" },
+ { "atmega165", ARCH_AVR5, "__AVR_ATmega165__" },
++ { "atmega165a", ARCH_AVR5, "__AVR_ATmega165A__" },
+ { "atmega165p", ARCH_AVR5, "__AVR_ATmega165P__" },
+ { "atmega168", ARCH_AVR5, "__AVR_ATmega168__" },
++ { "atmega168a", ARCH_AVR5, "__AVR_ATmega168A__" },
+ { "atmega168p", ARCH_AVR5, "__AVR_ATmega168P__" },
+ { "atmega169", ARCH_AVR5, "__AVR_ATmega169__" },
++ { "atmega169a", ARCH_AVR5, "__AVR_ATmega169A__" },
+ { "atmega169p", ARCH_AVR5, "__AVR_ATmega169P__" },
++ { "atmega169pa", ARCH_AVR5, "__AVR_ATmega169PA__" },
++ { "atmega16c1", ARCH_AVR5, "__AVR_ATmega16C1__" },
++ { "atmega16hva", ARCH_AVR5, "__AVR_ATmega16HVA__" },
++ { "atmega16hva2", ARCH_AVR5, "__AVR_ATmega16HVA2__" },
++ { "atmega16hvb", ARCH_AVR5, "__AVR_ATmega16HVB__" },
++ { "atmega16m1", ARCH_AVR5, "__AVR_ATmega16M1__" },
++ { "atmega16u4", ARCH_AVR5, "__AVR_ATmega16U4__" },
+ { "atmega32", ARCH_AVR5, "__AVR_ATmega32__" },
+ { "atmega323", ARCH_AVR5, "__AVR_ATmega323__" },
++ { "atmega324a", ARCH_AVR5, "__AVR_ATmega324A__" },
+ { "atmega324p", ARCH_AVR5, "__AVR_ATmega324P__" },
++ { "atmega324pa", ARCH_AVR5, "__AVR_ATmega324PA__" },
+ { "atmega325", ARCH_AVR5, "__AVR_ATmega325__" },
+ { "atmega325p", ARCH_AVR5, "__AVR_ATmega325P__" },
+ { "atmega3250", ARCH_AVR5, "__AVR_ATmega3250__" },
+ { "atmega3250p", ARCH_AVR5, "__AVR_ATmega3250P__" },
++ { "atmega328", ARCH_AVR5, "__AVR_ATmega328__" },
+ { "atmega328p", ARCH_AVR5, "__AVR_ATmega328P__" },
+ { "atmega329", ARCH_AVR5, "__AVR_ATmega329__" },
+ { "atmega329p", ARCH_AVR5, "__AVR_ATmega329P__" },
++ { "atmega329pa", ARCH_AVR5, "__AVR_ATmega329PA__" },
+ { "atmega3290", ARCH_AVR5, "__AVR_ATmega3290__" },
+ { "atmega3290p", ARCH_AVR5, "__AVR_ATmega3290P__" },
++ { "atmega32c1", ARCH_AVR5, "__AVR_ATmega32C1__" },
+ { "atmega32hvb", ARCH_AVR5, "__AVR_ATmega32HVB__" },
++ { "atmega32m1", ARCH_AVR5, "__AVR_ATmega32M1__" },
++ { "atmega32u4", ARCH_AVR5, "__AVR_ATmega32U4__" },
++ { "atmega32u6", ARCH_AVR5, "__AVR_ATmega32U6__" },
+ { "atmega406", ARCH_AVR5, "__AVR_ATmega406__" },
+ { "atmega64", ARCH_AVR5, "__AVR_ATmega64__" },
+ { "atmega640", ARCH_AVR5, "__AVR_ATmega640__" },
+ { "atmega644", ARCH_AVR5, "__AVR_ATmega644__" },
++ { "atmega644a", ARCH_AVR5, "__AVR_ATmega644A__" },
+ { "atmega644p", ARCH_AVR5, "__AVR_ATmega644P__" },
++ { "atmega644pa", ARCH_AVR5, "__AVR_ATmega644PA__" },
+ { "atmega645", ARCH_AVR5, "__AVR_ATmega645__" },
++ { "atmega645a", ARCH_AVR5, "__AVR_ATmega645A__" },
++ { "atmega645p", ARCH_AVR5, "__AVR_ATmega645P__" },
+ { "atmega6450", ARCH_AVR5, "__AVR_ATmega6450__" },
++ { "atmega6450a", ARCH_AVR5, "__AVR_ATmega6450A__" },
++ { "atmega6450p", ARCH_AVR5, "__AVR_ATmega6450P__" },
+ { "atmega649", ARCH_AVR5, "__AVR_ATmega649__" },
++ { "atmega649a", ARCH_AVR5, "__AVR_ATmega649A__" },
++ { "atmega649p", ARCH_AVR5, "__AVR_ATmega649P__" },
+ { "atmega6490", ARCH_AVR5, "__AVR_ATmega6490__" },
+- { "atmega16hva", ARCH_AVR5, "__AVR_ATmega16HVA__" },
++ { "atmega6490a", ARCH_AVR5, "__AVR_ATmega6490A__" },
++ { "atmega6490p", ARCH_AVR5, "__AVR_ATmega6490P__" },
++ { "atmega64c1", ARCH_AVR5, "__AVR_ATmega64C1__" },
++ { "atmega64m1", ARCH_AVR5, "__AVR_ATmega64M1__" },
++ { "atmega64hve", ARCH_AVR5, "__AVR_ATmega64HVE__" },
+ { "at90can32", ARCH_AVR5, "__AVR_AT90CAN32__" },
+ { "at90can64", ARCH_AVR5, "__AVR_AT90CAN64__" },
+ { "at90pwm216", ARCH_AVR5, "__AVR_AT90PWM216__" },
+ { "at90pwm316", ARCH_AVR5, "__AVR_AT90PWM316__" },
++ { "at90scr100", ARCH_AVR5, "__AVR_AT90SCR100__" },
+ { "at90usb646", ARCH_AVR5, "__AVR_AT90USB646__" },
+ { "at90usb647", ARCH_AVR5, "__AVR_AT90USB647__" },
+ { "at94k", ARCH_AVR5, "__AVR_AT94K__" },
+@@ -284,9 +337,13 @@
+ { "atmega1280", ARCH_AVR51, "__AVR_ATmega1280__" },
+ { "atmega1281", ARCH_AVR51, "__AVR_ATmega1281__" },
+ { "atmega1284p", ARCH_AVR51, "__AVR_ATmega1284P__" },
++ { "atmega128rfa1", ARCH_AVR51, "__AVR_ATmega128RFA1__" },
+ { "at90can128", ARCH_AVR51, "__AVR_AT90CAN128__" },
+ { "at90usb1286", ARCH_AVR51, "__AVR_AT90USB1286__" },
+ { "at90usb1287", ARCH_AVR51, "__AVR_AT90USB1287__" },
++ { "m3000f", ARCH_AVR51, "__AVR_M3000F__" },
++ { "m3000s", ARCH_AVR51, "__AVR_M3000S__" },
++ { "m3001b", ARCH_AVR51, "__AVR_M3001B__" },
+ /* 3-Byte PC. */
+ { "avr6", ARCH_AVR6, NULL },
+ { "atmega2560", ARCH_AVR6, "__AVR_ATmega2560__" },
+--- ./gcc/config/avr/avr.h~ 2010-03-05 17:15:55.000000000 +0100
++++ ./gcc/config/avr/avr.h 2010-03-05 17:19:53.000000000 +0100
+@@ -803,67 +803,221 @@
+ mmcu=at90s8*|\
+ mmcu=at90c8*|\
+ mmcu=at86rf401|\
+- mmcu=attiny13|\
++ mmcu=ata6289|\
++ mmcu=attiny13*|\
+ mmcu=attiny2313|\
++ mmcu=attiny2313a|\
+ mmcu=attiny24|\
++ mmcu=attiny24a|\
+ mmcu=attiny25|\
+ mmcu=attiny261|\
+- mmcu=attiny4*|\
+- mmcu=attiny8*: -m avr2}\
++ mmcu=attiny261a|\
++ mmcu=attiny4313|\
++ mmcu=attiny43u|\
++ mmcu=attiny44|\
++ mmcu=attiny44a|\
++ mmcu=attiny45|\
++ mmcu=attiny461|\
++ mmcu=attiny461a|\
++ mmcu=attiny48|\
++ mmcu=attiny84|\
++ mmcu=attiny85|\
++ mmcu=attiny861|\
++ mmcu=attiny861a|\
++ mmcu=attiny87|\
++ mmcu=attiny88: -m avr2}\
+ %{mmcu=atmega103|\
+- mmcu=at43*|\
+- mmcu=at76*|\
++ mmcu=at43usb320|\
++ mmcu=at43usb355|\
++ mmcu=at76c711|\
+ mmcu=at90usb82|\
+- mmcu=at90usb162: -m avr3}\
+-%{mmcu=atmega8*|\
+- mmcu=atmega48*|\
++ mmcu=at90usb162|\
++ mmcu=atmega8u2|\
++ mmcu=atmega16u2|\
++ mmcu=atmega32u2|\
++ mmcu=attiny167: -m avr3}\
++%{mmcu=atmega8|\
++ mmcu=atmega88|\
++ mmcu=atmega88a|\
++ mmcu=atmega88p|\
++ mmcu=atmega88pa|\
++ mmcu=atmega8515|\
++ mmcu=atmega8535|\
++ mmcu=atmega8hva|\
++ mmcu=atmega8hvd|\
++ mmcu=atmega48|\
++ mmcu=atmega48a|\
++ mmcu=atmega48p|\
++ mmcu=atmega4hvd|\
+ mmcu=at90pwm1|\
+ mmcu=at90pwm2|\
+ mmcu=at90pwm2b|\
+ mmcu=at90pwm3|\
+- mmcu=at90pwm3b: -m avr4}\
+-%{mmcu=atmega16*|\
+- mmcu=atmega32*|\
++ mmcu=at90pwm3b|\
++ mmcu=at90pwm81: -m avr4}\
++%{mmcu=atmega16|\
++ mmcu=atmega16a|\
++ mmcu=atmega161|\
++ mmcu=atmega162|\
++ mmcu=atmega163|\
++ mmcu=atmega164a|\
++ mmcu=atmega164p|\
++ mmcu=atmega165|\
++ mmcu=atmega165a|\
++ mmcu=atmega165p|\
++ mmcu=atmega168|\
++ mmcu=atmega168a|\
++ mmcu=atmega168p|\
++ mmcu=atmega169|\
++ mmcu=atmega169a|\
++ mmcu=atmega169p|\
++ mmcu=atmega169pa|\
++ mmcu=atmega16c1|\
++ mmcu=atmega16hva|\
++ mmcu=atmega16hva2|\
++ mmcu=atmega16hvb|\
++ mmcu=atmega16m1|\
++ mmcu=atmega16u4|\
++ mmcu=atmega32|\
++ mmcu=atmega323|\
++ mmcu=atmega324a|\
++ mmcu=atmega324p|\
++ mmcu=atmega324pa|\
++ mmcu=atmega325|\
++ mmcu=atmega325p|\
++ mmcu=atmega3250|\
++ mmcu=atmega3250p|\
++ mmcu=atmega328|\
++ mmcu=atmega328p|\
++ mmcu=atmega329|\
++ mmcu=atmega329p|\
++ mmcu=atmega329pa|\
++ mmcu=atmega3290|\
++ mmcu=atmega3290p|\
++ mmcu=atmega32c1|\
++ mmcu=atmega32hvb|\
++ mmcu=atmega32m1|\
++ mmcu=atmega32u4|\
++ mmcu=atmega32u6|\
+ mmcu=atmega406|\
+- mmcu=atmega64*|\
++ mmcu=atmega64|\
++ mmcu=atmega640|\
++ mmcu=atmega644|\
++ mmcu=atmega644a|\
++ mmcu=atmega644p|\
++ mmcu=atmega644pa|\
++ mmcu=atmega645|\
++ mmcu=atmega645a|\
++ mmcu=atmega645p|\
++ mmcu=atmega6450|\
++ mmcu=atmega6450a|\
++ mmcu=atmega6450p|\
++ mmcu=atmega649|\
++ mmcu=atmega649a|\
++ mmcu=atmega649p|\
++ mmcu=atmega6490|\
++ mmcu=atmega6490a|\
++ mmcu=atmega6490p|\
++ mmcu=atmega64c1|\
++ mmcu=atmega64m1|\
++ mmcu=atmega64hve|\
+ mmcu=atmega128*|\
+ mmcu=at90can*|\
+ mmcu=at90pwm216|\
+ mmcu=at90pwm316|\
++ mmcu=atmega32c1|\
++ mmcu=atmega32m1|\
++ mmcu=atmega32u4|\
++ mmcu=at90scr100|\
+ mmcu=at90usb64*|\
+ mmcu=at90usb128*|\
+- mmcu=at94k: -m avr5}\
++ mmcu=at94k|\
++ mmcu=m3000*|\
++ mmcu=m3001*: -m avr5}\
+ %{mmcu=atmega256*:-m avr6}\
+-%{mmcu=atmega324*|\
++%{mmcu=atmega324a|\
++ mmcu=atmega324p|\
++ mmcu=atmega324pa|\
+ mmcu=atmega325*|\
++ mmcu=atmega328|\
+ mmcu=atmega328p|\
+- mmcu=atmega329*|\
++ mmcu=atmega329|\
++ mmcu=atmega329p|\
++ mmcu=atmega329pa|\
++ mmcu=atmega3290|\
++ mmcu=atmega3290p|\
+ mmcu=atmega406|\
+- mmcu=atmega48*|\
+- mmcu=atmega88*|\
++ mmcu=atmega48|\
++ mmcu=atmega48a|\
++ mmcu=atmega48p|\
++ mmcu=atmega88|\
++ mmcu=atmega88a|\
++ mmcu=atmega88p|\
++ mmcu=atmega88pa|\
+ mmcu=atmega64|\
+- mmcu=atmega644*|\
+- mmcu=atmega645*|\
+- mmcu=atmega649*|\
++ mmcu=atmega644|\
++ mmcu=atmega644a|\
++ mmcu=atmega644p|\
++ mmcu=atmega644pa|\
++ mmcu=atmega645|\
++ mmcu=atmega645p|\
++ mmcu=atmega645a|\
++ mmcu=atmega6450|\
++ mmcu=atmega6450a|\
++ mmcu=atmega6450p|\
++ mmcu=atmega649|\
++ mmcu=atmega649a|\
++ mmcu=atmega649p|\
++ mmcu=atmega6490|\
++ mmcu=atmega6490a|\
++ mmcu=atmega6490p|\
+ mmcu=atmega128|\
+ mmcu=atmega1284p|\
+ mmcu=atmega162|\
+- mmcu=atmega164*|\
+- mmcu=atmega165*|\
+- mmcu=atmega168*|\
+- mmcu=atmega169*|\
+- mmcu=atmega8hva|\
+- mmcu=atmega16hva|\
+- mmcu=atmega32hvb|\
++ mmcu=atmega164a|\
++ mmcu=atmega164p|\
++ mmcu=atmega165|\
++ mmcu=atmega165a|\
++ mmcu=atmega165p|\
++ mmcu=atmega168|\
++ mmcu=atmega168a|\
++ mmcu=atmega168p|\
++ mmcu=atmega169|\
++ mmcu=atmega169a|\
++ mmcu=atmega169p|\
++ mmcu=atmega169pa|\
++ mmcu=atmega4hv*|\
++ mmcu=atmega8hv*|\
++ mmcu=atmega16hv*|\
++ mmcu=atmega32hv*|\
+ mmcu=attiny48|\
+ mmcu=attiny88|\
++ mmcu=attiny87|\
++ mmcu=attiny167|\
+ mmcu=at90can*|\
+ mmcu=at90pwm*|\
++ mmcu=atmega16c1|\
++ mmcu=atmega16m1|\
++ mmcu=atmega32c1|\
++ mmcu=atmega32m1|\
++ mmcu=atmega64c1|\
++ mmcu=atmega64m1|\
++ mmcu=atmega16u4|\
++ mmcu=atmega32u*|\
++ mmcu=at90scr100|\
++ mmcu=ata6289|\
++ mmcu=atmega64hve|\
++ mmcu=atmega8u2|\
++ mmcu=atmega16u2|\
++ mmcu=atmega32u2|\
+ mmcu=at90usb*: -Tdata 0x800100}\
+ %{mmcu=atmega640|\
+ mmcu=atmega1280|\
+ mmcu=atmega1281|\
+- mmcu=atmega256*: -Tdata 0x800200} "
++ mmcu=atmega128rfa1|\
++ mmcu=atmega256*: -Tdata 0x800200}\
++%{mmcu=m3000*|\
++ mmcu=m3001*: -Tdata 0x801000}"
+
+ #define LIB_SPEC \
+ "%{!mmcu=at90s1*:%{!mmcu=attiny11:%{!mmcu=attiny12:%{!mmcu=attiny15:%{!mmcu=attiny28: -lc }}}}}"
+@@ -898,30 +1052,47 @@
+ %{mmcu=at90s8535:crts8535.o%s} \
+ %{mmcu=at86rf401:crt86401.o%s} \
+ %{mmcu=attiny13:crttn13.o%s} \
++%{mmcu=attiny13a:crttn13a.o%s} \
+ %{mmcu=attiny2313|mmcu=avr25:crttn2313.o%s} \
++%{mmcu=attiny2313a:crttn2313a.o%s} \
+ %{mmcu=attiny24:crttn24.o%s} \
++%{mmcu=attiny24a:crttn24a.o%s} \
++%{mmcu=attiny4313:crttn4313.o%s} \
+ %{mmcu=attiny44:crttn44.o%s} \
++%{mmcu=attiny44a:crttn44a.o%s} \
+ %{mmcu=attiny84:crttn84.o%s} \
+ %{mmcu=attiny25:crttn25.o%s} \
+ %{mmcu=attiny45:crttn45.o%s} \
+ %{mmcu=attiny85:crttn85.o%s} \
+ %{mmcu=attiny261:crttn261.o%s} \
++%{mmcu=attiny261a:crttn261a.o%s} \
+ %{mmcu=attiny461:crttn461.o%s} \
++%{mmcu=attiny461a:crttn461a.o%s} \
+ %{mmcu=attiny861:crttn861.o%s} \
++%{mmcu=attiny861a:crttn861a.o%s} \
+ %{mmcu=attiny43u:crttn43u.o%s} \
+ %{mmcu=attiny48:crttn48.o%s} \
+ %{mmcu=attiny88:crttn88.o%s} \
++%{mmcu=attiny87:crttn87.o%s} \
++%{mmcu=ata6289:crta6289.o%s} \
+ %{mmcu=at43usb320|mmcu=avr3:crt43320.o%s} \
+ %{mmcu=at43usb355:crt43355.o%s} \
+ %{mmcu=at76c711:crt76711.o%s} \
+ %{mmcu=atmega103|mmcu=avr31:crtm103.o%s} \
+ %{mmcu=at90usb162|mmcu=avr35:crtusb162.o%s} \
+ %{mmcu=at90usb82:crtusb82.o%s} \
++%{mmcu=atmega8u2:crtm8u2.o%s} \
++%{mmcu=atmega16u2:crtm16u2.o%s} \
++%{mmcu=atmega32u2:crtm32u2.o%s} \
++%{mmcu=attiny167:crttn167.o%s} \
+ %{mmcu=atmega8|mmcu=avr4:crtm8.o%s} \
+ %{mmcu=atmega48:crtm48.o%s} \
++%{mmcu=atmega48a:crtm48a.o%s} \
+ %{mmcu=atmega48p:crtm48p.o%s} \
+ %{mmcu=atmega88:crtm88.o%s} \
++%{mmcu=atmega88a:crtm88a.o%s} \
+ %{mmcu=atmega88p:crtm88p.o%s} \
++%{mmcu=atmega88pa:crtm88pa.o%s} \
+ %{mmcu=atmega8515:crtm8515.o%s} \
+ %{mmcu=atmega8535:crtm8535.o%s} \
+ %{mmcu=at90pwm1:crt90pwm1.o%s} \
+@@ -929,45 +1100,81 @@
+ %{mmcu=at90pwm2b:crt90pwm2b.o%s} \
+ %{mmcu=at90pwm3:crt90pwm3.o%s} \
+ %{mmcu=at90pwm3b:crt90pwm3b.o%s} \
++%{mmcu=at90pwm81:crt90pwm81.o%s} \
+ %{mmcu=atmega16:crtm16.o%s} \
++%{mmcu=atmega16a:crtm16a.o%s} \
+ %{mmcu=atmega161|mmcu=avr5:crtm161.o%s} \
+ %{mmcu=atmega162:crtm162.o%s} \
+ %{mmcu=atmega163:crtm163.o%s} \
++%{mmcu=atmega164a:crtm164a.o%s} \
+ %{mmcu=atmega164p:crtm164p.o%s} \
+ %{mmcu=atmega165:crtm165.o%s} \
++%{mmcu=atmega165a:crtm165a.o%s} \
+ %{mmcu=atmega165p:crtm165p.o%s} \
+ %{mmcu=atmega168:crtm168.o%s} \
++%{mmcu=atmega168a:crtm168a.o%s} \
+ %{mmcu=atmega168p:crtm168p.o%s} \
+ %{mmcu=atmega169:crtm169.o%s} \
++%{mmcu=atmega169a:crtm169a.o%s} \
+ %{mmcu=atmega169p:crtm169p.o%s} \
++%{mmcu=atmega169pa:crtm169pa.o%s} \
+ %{mmcu=atmega32:crtm32.o%s} \
+ %{mmcu=atmega323:crtm323.o%s} \
++%{mmcu=atmega324a:crtm324a.o%s} \
+ %{mmcu=atmega324p:crtm324p.o%s} \
++%{mmcu=atmega324pa:crtm324pa.o%s} \
+ %{mmcu=atmega325:crtm325.o%s} \
+ %{mmcu=atmega325p:crtm325p.o%s} \
+ %{mmcu=atmega3250:crtm3250.o%s} \
+ %{mmcu=atmega3250p:crtm3250p.o%s} \
++%{mmcu=atmega328:crtm328.o%s} \
+ %{mmcu=atmega328p:crtm328p.o%s} \
+ %{mmcu=atmega329:crtm329.o%s} \
+ %{mmcu=atmega329p:crtm329p.o%s} \
++%{mmcu=atmega329pa:crtm329pa.o%s} \
+ %{mmcu=atmega3290:crtm3290.o%s} \
+ %{mmcu=atmega3290p:crtm3290p.o%s} \
+-%{mmcu=atmega32hvb:crtm32hvb.o%s} \
+ %{mmcu=atmega406:crtm406.o%s} \
+ %{mmcu=atmega64:crtm64.o%s} \
+ %{mmcu=atmega640:crtm640.o%s} \
+ %{mmcu=atmega644:crtm644.o%s} \
++%{mmcu=atmega644a:crtm644a.o%s} \
+ %{mmcu=atmega644p:crtm644p.o%s} \
++%{mmcu=atmega644pa:crtm644pa.o%s} \
+ %{mmcu=atmega645:crtm645.o%s} \
++%{mmcu=atmega645a:crtm645a.o%s} \
++%{mmcu=atmega645p:crtm645p.o%s} \
+ %{mmcu=atmega6450:crtm6450.o%s} \
++%{mmcu=atmega6450a:crtm6450a.o%s} \
++%{mmcu=atmega6450p:crtm6450p.o%s} \
+ %{mmcu=atmega649:crtm649.o%s} \
++%{mmcu=atmega649a:crtm649a.o%s} \
++%{mmcu=atmega649p:crtm649p.o%s} \
+ %{mmcu=atmega6490:crtm6490.o%s} \
++%{mmcu=atmega6490a:crtm6490a.o%s} \
++%{mmcu=atmega6490p:crtm6490p.o%s} \
++%{mmcu=atmega64hve:crtm64hve.o%s} \
+ %{mmcu=atmega8hva:crtm8hva.o%s} \
+ %{mmcu=atmega16hva:crtm16hva.o%s} \
++%{mmcu=atmega16hva2:crtm16hva2.o%s} \
++%{mmcu=atmega16hvb:crtm16hvb.o%s} \
++%{mmcu=atmega32hvb:crtm32hvb.o%s} \
++%{mmcu=atmega4hvd:crtm4hvd.o%s} \
++%{mmcu=atmega8hvd:crtm8hvd.o%s} \
+ %{mmcu=at90can32:crtcan32.o%s} \
+ %{mmcu=at90can64:crtcan64.o%s} \
+ %{mmcu=at90pwm216:crt90pwm216.o%s} \
+ %{mmcu=at90pwm316:crt90pwm316.o%s} \
++%{mmcu=atmega16c1:crtm16c1.o%s} \
++%{mmcu=atmega16m1:crtm16m1.o%s} \
++%{mmcu=atmega16u4:crtm16u4.o%s} \
++%{mmcu=atmega32c1:crtm32c1.o%s} \
++%{mmcu=atmega32m1:crtm32m1.o%s} \
++%{mmcu=atmega32u4:crtm32u4.o%s} \
++%{mmcu=atmega32u6:crtm32u6.o%s} \
++%{mmcu=atmega64c1:crtm64c1.o%s} \
++%{mmcu=atmega64m1:crtm64m1.o%s} \
++%{mmcu=at90scr100:crt90scr100.o%s} \
+ %{mmcu=at90usb646:crtusb646.o%s} \
+ %{mmcu=at90usb647:crtusb647.o%s} \
+ %{mmcu=at94k:crtat94k.o%s} \
+@@ -975,11 +1182,15 @@
+ %{mmcu=atmega1280:crtm1280.o%s} \
+ %{mmcu=atmega1281:crtm1281.o%s} \
+ %{mmcu=atmega1284p:crtm1284p.o%s} \
+-%{mmcu=atmega2560:crtm2560.o%s} \
+-%{mmcu=atmega2561:crtm2561.o%s} \
++%{mmcu=atmega128rfa1:crtm128rfa1.o%s} \
+ %{mmcu=at90can128:crtcan128.o%s} \
+ %{mmcu=at90usb1286:crtusb1286.o%s} \
+-%{mmcu=at90usb1287:crtusb1287.o%s}"
++%{mmcu=at90usb1287:crtusb1287.o%s} \
++%{mmcu=m3000f:crtm3000f.o%s} \
++%{mmcu=m3000s:crtm3000s.o%s} \
++%{mmcu=m3001b:crtm3001b.o%s} \
++%{mmcu=atmega2560|mmcu=avr6:crtm2560.o%s} \
++%{mmcu=atmega2561:crtm2561.o%s}"
+
+ #define EXTRA_SPECS {"crt_binutils", CRT_BINUTILS_SPECS},
+
+--- ./gcc/config/avr/t-avr~ 2010-03-05 17:15:38.000000000 +0100
++++ ./gcc/config/avr/t-avr 2010-03-05 17:20:12.000000000 +0100
+@@ -42,19 +42,29 @@
+
+ # The many avr2 matches are not listed here - this is the default.
+ MULTILIB_MATCHES = \
++ mmcu?avr25=mmcu?ata6289 \
+ mmcu?avr25=mmcu?attiny13 \
++ mmcu?avr25=mmcu?attiny13a \
+ mmcu?avr25=mmcu?attiny2313 \
++ mmcu?avr25=mmcu?attiny2313a \
+ mmcu?avr25=mmcu?attiny24 \
+- mmcu?avr25=mmcu?attiny44 \
+- mmcu?avr25=mmcu?attiny84 \
++ mmcu?avr25=mmcu?attiny24a \
+ mmcu?avr25=mmcu?attiny25 \
+- mmcu?avr25=mmcu?attiny45 \
+- mmcu?avr25=mmcu?attiny85 \
+ mmcu?avr25=mmcu?attiny261 \
+- mmcu?avr25=mmcu?attiny461 \
+- mmcu?avr25=mmcu?attiny861 \
++ mmcu?avr25=mmcu?attiny261a \
++ mmcu?avr25=mmcu?attiny4313 \
+ mmcu?avr25=mmcu?attiny43u \
++ mmcu?avr25=mmcu?attiny44 \
++ mmcu?avr25=mmcu?attiny44a \
++ mmcu?avr25=mmcu?attiny45 \
++ mmcu?avr25=mmcu?attiny461 \
++ mmcu?avr25=mmcu?attiny461a \
+ mmcu?avr25=mmcu?attiny48 \
++ mmcu?avr25=mmcu?attiny84 \
++ mmcu?avr25=mmcu?attiny85 \
++ mmcu?avr25=mmcu?attiny861 \
++ mmcu?avr25=mmcu?attiny861a \
++ mmcu?avr25=mmcu?attiny87 \
+ mmcu?avr25=mmcu?attiny88 \
+ mmcu?avr25=mmcu?at86rf401 \
+ mmcu?avr3=mmcu?at43usb320 \
+@@ -63,57 +73,100 @@
+ mmcu?avr31=mmcu?atmega103 \
+ mmcu?avr35=mmcu?at90usb82 \
+ mmcu?avr35=mmcu?at90usb162 \
++ mmcu?avr35=mmcu?atmega8u2 \
++ mmcu?avr35=mmcu?atmega16u2 \
++ mmcu?avr35=mmcu?atmega32u2 \
++ mmcu?avr35=mmcu?attiny167 \
+ mmcu?avr4=mmcu?atmega48 \
++ mmcu?avr4=mmcu?atmega48a \
+ mmcu?avr4=mmcu?atmega48p \
+ mmcu?avr4=mmcu?atmega8 \
+ mmcu?avr4=mmcu?atmega8515 \
+ mmcu?avr4=mmcu?atmega8535 \
+ mmcu?avr4=mmcu?atmega88 \
++ mmcu?avr4=mmcu?atmega88a \
+ mmcu?avr4=mmcu?atmega88p \
++ mmcu?avr4=mmcu?atmega88pa \
+ mmcu?avr4=mmcu?atmega8hva \
++ mmcu?avr4=mmcu?atmega4hvd \
++ mmcu?avr4=mmcu?atmega8hvd \
+ mmcu?avr4=mmcu?at90pwm1 \
+ mmcu?avr4=mmcu?at90pwm2 \
+ mmcu?avr4=mmcu?at90pwm2b \
+ mmcu?avr4=mmcu?at90pwm3 \
+ mmcu?avr4=mmcu?at90pwm3b \
++ mmcu?avr4=mmcu?at90pwm81 \
+ mmcu?avr5=mmcu?atmega16 \
++ mmcu?avr5=mmcu?atmega16a \
+ mmcu?avr5=mmcu?atmega161 \
+ mmcu?avr5=mmcu?atmega162 \
+ mmcu?avr5=mmcu?atmega163 \
++ mmcu?avr5=mmcu?atmega164a \
+ mmcu?avr5=mmcu?atmega164p \
+ mmcu?avr5=mmcu?atmega165 \
++ mmcu?avr5=mmcu?atmega165a \
+ mmcu?avr5=mmcu?atmega165p \
+ mmcu?avr5=mmcu?atmega168 \
++ mmcu?avr5=mmcu?atmega168a \
+ mmcu?avr5=mmcu?atmega168p \
+ mmcu?avr5=mmcu?atmega169 \
++ mmcu?avr5=mmcu?atmega169a \
+ mmcu?avr5=mmcu?atmega169p \
++ mmcu?avr5=mmcu?atmega169pa \
+ mmcu?avr5=mmcu?atmega32 \
+ mmcu?avr5=mmcu?atmega323 \
++ mmcu?avr5=mmcu?atmega324a \
+ mmcu?avr5=mmcu?atmega324p \
++ mmcu?avr5=mmcu?atmega324pa \
+ mmcu?avr5=mmcu?atmega325 \
+ mmcu?avr5=mmcu?atmega325p \
+ mmcu?avr5=mmcu?atmega3250 \
+ mmcu?avr5=mmcu?atmega3250p \
++ mmcu?avr5=mmcu?atmega328 \
+ mmcu?avr5=mmcu?atmega328p \
+ mmcu?avr5=mmcu?atmega329 \
+ mmcu?avr5=mmcu?atmega329p \
++ mmcu?avr5=mmcu?atmega329pa \
+ mmcu?avr5=mmcu?atmega3290 \
+ mmcu?avr5=mmcu?atmega3290p \
+- mmcu?avr5=mmcu?atmega32hvb \
+ mmcu?avr5=mmcu?atmega406 \
+ mmcu?avr5=mmcu?atmega64 \
+ mmcu?avr5=mmcu?atmega640 \
+ mmcu?avr5=mmcu?atmega644 \
++ mmcu?avr5=mmcu?atmega644a \
+ mmcu?avr5=mmcu?atmega644p \
++ mmcu?avr5=mmcu?atmega644pa \
+ mmcu?avr5=mmcu?atmega645 \
++ mmcu?avr5=mmcu?atmega645a \
++ mmcu?avr5=mmcu?atmega645p \
+ mmcu?avr5=mmcu?atmega6450 \
++ mmcu?avr5=mmcu?atmega6450a \
++ mmcu?avr5=mmcu?atmega6450p \
+ mmcu?avr5=mmcu?atmega649 \
++ mmcu?avr5=mmcu?atmega649a \
++ mmcu?avr5=mmcu?atmega649p \
+ mmcu?avr5=mmcu?atmega6490 \
++ mmcu?avr5=mmcu?atmega6490a \
++ mmcu?avr5=mmcu?atmega6490p \
+ mmcu?avr5=mmcu?atmega16hva \
++ mmcu?avr5=mmcu?atmega16hva2 \
++ mmcu?avr5=mmcu?atmega16hvb \
++ mmcu?avr5=mmcu?atmega32hvb \
+ mmcu?avr5=mmcu?at90can32 \
+ mmcu?avr5=mmcu?at90can64 \
+ mmcu?avr5=mmcu?at90pwm216 \
+ mmcu?avr5=mmcu?at90pwm316 \
++ mmcu?avr5=mmcu?atmega16c1 \
++ mmcu?avr5=mmcu?atmega16m1 \
++ mmcu?avr5=mmcu?atmega16u4 \
++ mmcu?avr5=mmcu?atmega32c1 \
++ mmcu?avr5=mmcu?atmega32m1 \
++ mmcu?avr5=mmcu?atmega32u4 \
++ mmcu?avr5=mmcu?atmega32u6 \
++ mmcu?avr5=mmcu?atmega64c1 \
++ mmcu?avr5=mmcu?atmega64m1 \
++ mmcu?avr5=mmcu?atmega64hve \
++ mmcu?avr5=mmcu?at90scr100 \
+ mmcu?avr5=mmcu?at90usb646 \
+ mmcu?avr5=mmcu?at90usb647 \
+ mmcu?avr5=mmcu?at94k \
+@@ -121,12 +174,15 @@
+ mmcu?avr51=mmcu?atmega1280 \
+ mmcu?avr51=mmcu?atmega1281 \
+ mmcu?avr51=mmcu?atmega1284p \
++ mmcu?avr51=mmcu?atmega128rfa1 \
+ mmcu?avr51=mmcu?at90can128 \
+ mmcu?avr51=mmcu?at90usb1286 \
+ mmcu?avr51=mmcu?at90usb1287 \
+- mmcu?avr6=mmcu?atmega2560 \
+- mmcu?avr6=mmcu?atmega2561
+-
++ mmcu?avr51=mmcu?m3000f \
++ mmcu?avr51=mmcu?m3000s \
++ mmcu?avr51=mmcu?m3001b \
++ mmcu?avr6=mmcu?atmega2560 \
++ mmcu?avr6=mmcu?atmega2561
+ MULTILIB_EXCEPTIONS =
+
+ LIBGCC = stmp-multilib
-Not committed
-Adds OS_main attribute feature.
-Written by Anatoly Sokolov.
-Apply patch after XMEGA patch.
---------------------------------------------------------------------------------
-Index: gcc/function.c
-===================================================================
---- gcc/function.c (revision 133747)
-+++ gcc/function.c (working copy)
-@@ -4756,6 +4756,14 @@
- }
-
- int
-+prologue_contains (const_rtx insn)
-+{
-+ if (contains (insn, &prologue))
-+ return 1;
-+ return 0;
-+}
-+
-+int
- prologue_epilogue_contains (const_rtx insn)
- {
- if (contains (insn, &prologue))
-Index: gcc/rtl.h
-===================================================================
---- gcc/rtl.h (revision 133747)
-+++ gcc/rtl.h (working copy)
-@@ -2128,6 +2128,7 @@
-
- /* In function.c */
- extern void reposition_prologue_and_epilogue_notes (void);
-+extern int prologue_contains (const_rtx);
- extern int prologue_epilogue_contains (const_rtx);
- extern int sibcall_epilogue_contains (const_rtx);
- extern void mark_temp_addr_taken (rtx);
---- gcc/config/avr/avr.h.orig 2008-03-31 16:48:03.477537900 -0600
-+++ gcc/config/avr/avr.h 2008-03-31 17:07:51.442457900 -0600
-@@ -1095,4 +1095,8 @@ struct machine_function GTY(())
- /* 'true' - if current function is a task function
- as specified by the "OS_task" attribute. */
- int is_OS_task;
-+
-+ /* 'true' - if current function is a 'main' function
-+ as specified by the "OS_main" attribute. */
-+ int is_OS_main;
- };
---- gcc/config/avr/avr.c.orig Mon Mar 31 19:47:54 2008
-+++ gcc/config/avr/avr.c Mon Mar 31 20:50:08 2008
-@@ -53,6 +53,7 @@ static int interrupt_function_p (tree);
+--- ./gcc/config/avr/avr.c.orig 2010-03-05 18:01:20.000000000 +0100
++++ ./gcc/config/avr/avr.c 2010-03-05 18:01:51.000000000 +0100
+@@ -57,6 +57,7 @@
static int signal_function_p (tree);
static int nmi_function_p (tree);
static int avr_OS_task_function_p (tree);
+static int avr_OS_main_function_p (tree);
static int avr_regs_to_save (HARD_REG_SET *);
- static void avr_args (HARD_REG_SET *);
- static int sequent_regs_live (HARD_REG_SET *);
-@@ -509,6 +513,19 @@ avr_OS_task_function_p (tree func)
+ static int sequent_regs_live (void);
+ static const char *ptrreg_to_str (int);
+@@ -603,6 +604,19 @@
return a != NULL_TREE;
}
/* Return the number of hard registers to push/pop in the prologue/epilogue
of the current function, and optionally store these registers in SET. */
-@@ -527,9 +544,10 @@ avr_regs_to_save (HARD_REG_SET *set)
+@@ -621,9 +635,10 @@
count = 0;
/* No need to save any registers if the function never returns or
return 0;
for (reg = 0; reg < 32; reg++)
-@@ -646,6 +664,8 @@ expand_prologue (void)
+@@ -742,6 +757,8 @@
rtx pushword = gen_rtx_MEM (HImode,
gen_rtx_POST_DEC (HImode, stack_pointer_rtx));
rtx insn;
last_insn_address = 0;
-@@ -655,6 +675,7 @@ expand_prologue (void)
+@@ -751,6 +768,7 @@
cfun->machine->is_signal = signal_function_p (current_function_decl);
cfun->machine->is_nmi = nmi_function_p (current_function_decl);
cfun->machine->is_OS_task = avr_OS_task_function_p (current_function_decl);
/* Prologue: naked. */
if (cfun->machine->is_naked)
-@@ -669,6 +690,7 @@ expand_prologue (void)
+@@ -764,6 +782,7 @@
&& !cfun->machine->is_interrupt
&& !cfun->machine->is_signal
&& !cfun->machine->is_OS_task
&& live_seq);
if (cfun->machine->is_interrupt || cfun->machine->is_signal)
-@@ -738,7 +760,7 @@ expand_prologue (void)
+@@ -903,7 +922,7 @@
}
if (frame_pointer_needed)
{
{
/* Push frame pointer. */
insn = emit_move_insn (pushword, frame_pointer_rtx);
-@@ -768,7 +790,7 @@ expand_prologue (void)
+@@ -933,7 +952,7 @@
if (TARGET_TINY_STACK)
{
if (size < -63 || size > 63)
/* The high byte (r29) doesn't change - prefer 'subi' (1 cycle)
over 'sbiw' (2 cycles, same size). */
-@@ -780,7 +802,6 @@ expand_prologue (void)
+@@ -945,7 +964,6 @@
myfp = frame_pointer_rtx;
}
/* Calculate length. */
method1_length =
get_attr_length (gen_move_insn (frame_pointer_rtx, stack_pointer_rtx));
method1_length +=
-@@ -878,6 +899,7 @@ expand_epilogue (void)
+@@ -1043,6 +1061,7 @@
HARD_REG_SET set;
int minimize;
HOST_WIDE_INT size = get_frame_size();
/* epilogue: naked */
if (cfun->machine->is_naked)
-@@ -893,6 +915,7 @@ expand_epilogue (void)
+@@ -1057,6 +1076,7 @@
&& !cfun->machine->is_interrupt
&& !cfun->machine->is_signal
&& !cfun->machine->is_OS_task
&& live_seq);
if (minimize && (frame_pointer_needed || live_seq > 4))
-@@ -955,7 +978,7 @@ expand_epilogue (void)
+@@ -1119,7 +1139,7 @@
emit_move_insn (stack_pointer_rtx, frame_pointer_rtx);
}
}
{
/* Restore previous frame_pointer. */
emit_insn (gen_pophi (frame_pointer_rtx));
-@@ -1787,10 +1810,18 @@ output_movhi (rtx insn, rtx operands[],
+@@ -1939,10 +1959,18 @@
}
/* Use simple load of stack pointer if no interrupts are used
or inside main or signal function prologue where they disabled. */
&& prologue_epilogue_contains (insn)))
{
*l = 2;
-@@ -4821,6 +4852,7 @@ const struct attribute_spec avr_attribut
+@@ -4969,6 +4997,7 @@
{ "nmi", 0, 0, true, false, false, avr_handle_fndecl_attribute },
{ "naked", 0, 0, false, true, true, avr_handle_fntype_attribute },
{ "OS_task", 0, 0, false, true, true, avr_handle_fntype_attribute },
{ NULL, 0, 0, false, false, false, NULL }
};
+--- ./gcc/config/avr/avr.h.orig 2010-03-05 18:01:20.000000000 +0100
++++ ./gcc/config/avr/avr.h 2010-03-05 18:01:51.000000000 +0100
+@@ -1320,4 +1320,8 @@
+ /* 'true' - if current function is a task function
+ as specified by the "OS_task" attribute. */
+ int is_OS_task;
++
++ /* 'true' - if current function is a 'main' function
++ as specified by the "OS_main" attribute. */
++ int is_OS_main;
+ };
+--- ./gcc/function.c.orig 2009-06-19 23:44:24.000000000 +0200
++++ ./gcc/function.c 2010-03-05 18:01:51.000000000 +0100
+@@ -4757,6 +4757,14 @@
+ }
+
+ int
++prologue_contains (const_rtx insn)
++{
++ if (contains (insn, &prologue))
++ return 1;
++ return 0;
++}
++
++int
+ prologue_epilogue_contains (const_rtx insn)
+ {
+ if (contains (insn, &prologue))
+--- ./gcc/rtl.h.orig 2009-07-14 11:32:55.000000000 +0200
++++ ./gcc/rtl.h 2010-03-05 18:01:51.000000000 +0100
+@@ -2145,6 +2145,7 @@
+
+ /* In function.c */
+ extern void reposition_prologue_and_epilogue_notes (void);
++extern int prologue_contains (const_rtx);
+ extern int prologue_epilogue_contains (const_rtx);
+ extern int sibcall_epilogue_contains (const_rtx);
+ extern void mark_temp_addr_taken (rtx);
--- /dev/null
+--- gcc/config/avr/avr.c.orig 2010-03-05 17:21:19.000000000 +0100
++++ gcc/config/avr/avr.c 2010-03-05 17:22:02.000000000 +0100
+@@ -46,6 +46,7 @@
+ #include "tm_p.h"
+ #include "target.h"
+ #include "target-def.h"
++#include "params.h"
+ #include "df.h"
+
+ /* Maximal allowed offset for an address in the LD command */
+@@ -419,6 +420,9 @@
+
+ flag_delete_null_pointer_checks = 0;
+
++ if (!PARAM_SET_P (PARAM_INLINE_CALL_COST))
++ set_param_value ("inline-call-cost", 5);
++
+ for (t = avr_mcu_types; t->name; t++)
+ if (strcmp (t->name, avr_mcu_name) == 0)
+ break;
---- gcc/config/avr/avr.c.orig 2008-06-08 10:24:28.171355800 -0600
-+++ gcc/config/avr/avr.c 2008-06-08 10:29:42.276013800 -0600
-@@ -51,6 +51,7 @@
+--- ./gcc/config/avr/avr.c.orig 2010-03-08 12:55:13.000000000 +0100
++++ ./gcc/config/avr/avr.c 2010-03-08 12:55:36.000000000 +0100
+@@ -55,6 +55,7 @@
static int avr_naked_function_p (tree);
static int interrupt_function_p (tree);
static int signal_function_p (tree);
static int avr_OS_task_function_p (tree);
static int avr_regs_to_save (HARD_REG_SET *);
static int sequent_regs_live (void);
-@@ -118,17 +119,24 @@ int avr_asm_only_p = 0;
+@@ -131,17 +132,24 @@
int avr_have_movw_lpmx_p = 0;
static const struct base_arch_s avr_arch_types[] = {
};
/* These names are used as the index into the avr_arch_types[] table
-@@ -146,7 +154,14 @@ enum avr_arch
+@@ -159,7 +167,14 @@
ARCH_AVR4,
ARCH_AVR5,
ARCH_AVR51,
};
struct mcu_type_s {
-@@ -279,6 +294,18 @@ static const struct mcu_type_s avr_mcu_t
+@@ -349,6 +364,35 @@
{ "avr6", ARCH_AVR6, NULL },
{ "atmega2560", ARCH_AVR6, "__AVR_ATmega2560__" },
{ "atmega2561", ARCH_AVR6, "__AVR_ATmega2561__" },
+ /* Enhanced, == 256K. */
+ /* Xmega, <= 8K FLASH. */
+ /* Xmega, > 8K, <= 64K FLASH, <= 64K RAM. */
++ { "avrxmega2", ARCH_AVRXMEGA2, NULL },
++ { "atxmega16a4", ARCH_AVRXMEGA2, "__AVR_ATxmega16A4__" },
++ { "atxmega16d4", ARCH_AVRXMEGA2, "__AVR_ATxmega16D4__" },
++ { "atxmega32d4", ARCH_AVRXMEGA2, "__AVR_ATxmega32D4__" },
+ /* Xmega, > 8K, <= 64K FLASH, > 64K RAM. */
++ { "avrxmega3", ARCH_AVRXMEGA3, NULL },
++ { "atxmega32a4", ARCH_AVRXMEGA3, "__AVR_ATxmega32A4__" },
+ /* Xmega, > 64K, <= 128K FLASH, <= 64K RAM. */
++ { "avrxmega4", ARCH_AVRXMEGA4, NULL },
++ { "atxmega64a3", ARCH_AVRXMEGA4, "__AVR_ATxmega64A3__" },
++ { "atxmega64d3", ARCH_AVRXMEGA4, "__AVR_ATxmega64D3__" },
+ /* Xmega, > 64K, <= 128K FLASH, > 64K RAM. */
+ { "avrxmega5", ARCH_AVRXMEGA5, NULL },
+ { "atxmega64a1", ARCH_AVRXMEGA5, "__AVR_ATxmega64A1__" },
+ /* Xmega, > 128K, <= 256K FLASH, <= 64K RAM. */
++ { "avrxmega6", ARCH_AVRXMEGA6, NULL },
++ { "atxmega128a3", ARCH_AVRXMEGA6, "__AVR_ATxmega128A3__" },
++ { "atxmega128d3", ARCH_AVRXMEGA6, "__AVR_ATxmega128D3__" },
++ { "atxmega192a3", ARCH_AVRXMEGA6, "__AVR_ATxmega192A3__" },
++ { "atxmega192d3", ARCH_AVRXMEGA6, "__AVR_ATxmega192D3__" },
++ { "atxmega256a3", ARCH_AVRXMEGA6, "__AVR_ATxmega256A3__" },
++ { "atxmega256a3b",ARCH_AVRXMEGA6, "__AVR_ATxmega256A3B__" },
++ { "atxmega256d3", ARCH_AVRXMEGA6, "__AVR_ATxmega256D3__" },
+ /* Xmega, > 128K, <= 256K FLASH, > 64K RAM. */
+ { "avrxmega7", ARCH_AVRXMEGA7, NULL },
+ { "atxmega128a1", ARCH_AVRXMEGA7, "__AVR_ATxmega128A1__" },
/* Assembler only. */
{ "avr1", ARCH_AVR1, NULL },
{ "at90s1200", ARCH_AVR1, "__AVR_AT90S1200__" },
-@@ -452,6 +479,21 @@ signal_function_p (tree func)
+@@ -531,6 +575,21 @@
return a != NULL_TREE;
}
/* Return nonzero if FUNC is a OS_task function. */
static int
-@@ -611,6 +653,7 @@ expand_prologue (void)
+@@ -690,6 +749,7 @@
cfun->machine->is_naked = avr_naked_function_p (current_function_decl);
cfun->machine->is_interrupt = interrupt_function_p (current_function_decl);
cfun->machine->is_signal = signal_function_p (current_function_decl);
cfun->machine->is_OS_task = avr_OS_task_function_p (current_function_decl);
/* Prologue: naked. */
-@@ -646,7 +689,7 @@ expand_prologue (void)
+@@ -725,17 +785,48 @@
/* Push SREG. */
insn = emit_move_insn (tmp_reg_rtx,
RTX_FRAME_RELATED_P (insn) = 1;
insn = emit_move_insn (pushbyte, tmp_reg_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
-@@ -656,7 +699,7 @@ expand_prologue (void)
+
++ /* Push RAMPD, RAMPX, RAMPY. */
++ if (AVR_HAVE_RAMPX_Y_D)
++ {
++ /* Push RAMPD. */
++ insn = emit_move_insn (tmp_reg_rtx,
++ gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPD_ADDR)));
++ RTX_FRAME_RELATED_P (insn) = 1;
++ insn = emit_move_insn (pushbyte, tmp_reg_rtx);
++ RTX_FRAME_RELATED_P (insn) = 1;
++
++ /* Push RAMPX. */
++ if (TEST_HARD_REG_BIT (set, REG_X) && TEST_HARD_REG_BIT (set, REG_X + 1))
++ {
++ insn = emit_move_insn (tmp_reg_rtx,
++ gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPX_ADDR)));
++ RTX_FRAME_RELATED_P (insn) = 1;
++ insn = emit_move_insn (pushbyte, tmp_reg_rtx);
++ RTX_FRAME_RELATED_P (insn) = 1;
++ }
++
++ /* Push RAMPY. */
++ if (TEST_HARD_REG_BIT (set, REG_Y) && TEST_HARD_REG_BIT (set, REG_Y + 1))
++ {
++ insn = emit_move_insn (tmp_reg_rtx,
++ gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPY_ADDR)));
++ RTX_FRAME_RELATED_P (insn) = 1;
++ insn = emit_move_insn (pushbyte, tmp_reg_rtx);
++ RTX_FRAME_RELATED_P (insn) = 1;
++ }
++ }
++
+ /* Push RAMPZ. */
+ if(AVR_HAVE_RAMPZ
&& (TEST_HARD_REG_BIT (set, REG_Z) && TEST_HARD_REG_BIT (set, REG_Z + 1)))
{
insn = emit_move_insn (tmp_reg_rtx,
RTX_FRAME_RELATED_P (insn) = 1;
insn = emit_move_insn (pushbyte, tmp_reg_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
-@@ -929,14 +972,14 @@ expand_epilogue (void)
+@@ -744,9 +835,46 @@
+ /* Clear zero reg. */
+ insn = emit_move_insn (zero_reg_rtx, const0_rtx);
+ RTX_FRAME_RELATED_P (insn) = 1;
+-
++
+ /* Prevent any attempt to delete the setting of ZERO_REG! */
+ emit_insn (gen_rtx_USE (VOIDmode, zero_reg_rtx));
++
++ /*
++ Clear RAMP? registers if used for data access in the interrupt/signal
++ context. Do this after the zero register has been explictly cleared.
++ */
++ if (AVR_HAVE_RAMPX_Y_D)
++ {
++ /* Set RAMPD to 0. */
++ insn = emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPD_ADDR)),
++ const0_rtx);
++ RTX_FRAME_RELATED_P (insn) = 1;
++
++ if (TEST_HARD_REG_BIT (set, REG_X) && TEST_HARD_REG_BIT (set, REG_X + 1))
++ {
++ /* Set RAMPX to 0. */
++ insn = emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPX_ADDR)),
++ const0_rtx);
++ RTX_FRAME_RELATED_P (insn) = 1;
++ }
++
++ if (TEST_HARD_REG_BIT (set, REG_Y) && TEST_HARD_REG_BIT (set, REG_Y + 1))
++ {
++ /* Set RAMPY to 0. */
++ insn = emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPY_ADDR)),
++ const0_rtx);
++ RTX_FRAME_RELATED_P (insn) = 1;
++ }
++
++ if(AVR_HAVE_RAMPZ
++ && (TEST_HARD_REG_BIT (set, REG_Z) && TEST_HARD_REG_BIT (set, REG_Z + 1)))
++ {
++ /* Set RAMPZ to 0. */
++ insn = emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPZ_ADDR)),
++ const0_rtx);
++ RTX_FRAME_RELATED_P (insn) = 1;
++ }
++ }
+ }
+ if (minimize && (frame_pointer_needed
+ || (AVR_2_BYTE_PC && live_seq > 6)
+@@ -1010,14 +1138,39 @@
&& (TEST_HARD_REG_BIT (set, REG_Z) && TEST_HARD_REG_BIT (set, REG_Z + 1)))
{
emit_insn (gen_popqi (tmp_reg_rtx));
tmp_reg_rtx);
}
++ /* Restore RAMPY, RAMPX, RAMPD using tmp reg as scratch. */
++ if (AVR_HAVE_RAMPX_Y_D)
++ {
++ /* Pop RAMPY. */
++ if (TEST_HARD_REG_BIT (set, REG_Y) && TEST_HARD_REG_BIT (set, REG_Y + 1))
++ {
++ emit_insn (gen_popqi (tmp_reg_rtx));
++ emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPY_ADDR)),
++ tmp_reg_rtx);
++ }
++
++ /* Pop RAMPX. */
++ if (TEST_HARD_REG_BIT (set, REG_X) && TEST_HARD_REG_BIT (set, REG_X + 1))
++ {
++ emit_insn (gen_popqi (tmp_reg_rtx));
++ emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPX_ADDR)),
++ tmp_reg_rtx);
++ }
++
++ /* Pop RAMPD. */
++ emit_insn (gen_popqi (tmp_reg_rtx));
++ emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPD_ADDR)),
++ tmp_reg_rtx);
++ }
++
/* Restore SREG using tmp reg as scratch. */
emit_insn (gen_popqi (tmp_reg_rtx));
tmp_reg_rtx);
/* Restore tmp REG. */
-@@ -1705,8 +1748,9 @@ output_movhi (rtx insn, rtx operands[],
+@@ -1786,8 +1939,9 @@
}
/* Use simple load of stack pointer if no interrupts are used
or inside main or signal function prologue where they disabled. */
&& cfun->machine->is_signal
&& prologue_epilogue_contains (insn)))
{
-@@ -1715,7 +1759,8 @@ output_movhi (rtx insn, rtx operands[],
+@@ -1796,7 +1950,8 @@
AS2 (out,__SP_L__,%A1));
}
/* In interrupt prolog we know interrupts are enabled. */
&& cfun->machine->is_interrupt
&& prologue_epilogue_contains (insn))
{
-@@ -1725,12 +1770,25 @@ output_movhi (rtx insn, rtx operands[],
+@@ -1806,12 +1961,21 @@
"sei" CR_TAB
AS2 (out,__SP_L__,%A1));
}
- AS2 (out,__SP_L__,%A1));
+ if(AVR_XMEGA)
+ {
-+ *l = 6;
-+ return (AS2 (mov,__tmp_reg__,r24) CR_TAB
-+ AS2 (ldi,r24,0xD8) CR_TAB
-+ AS2 (out,__CCP__,r24) CR_TAB
-+ AS2 (out,__SP_H__,%B1) CR_TAB
-+ AS2 (out,__SP_L__,%A1) CR_TAB
-+ AS2 (mov,r24,__tmp_reg__));
++ *l = 2;
++ return (AS2 (out,__SP_L__,%A1) CR_TAB
++ AS2 (out,__SP_H__,%B1));
+ }
+ else
+ {
}
else if (test_hard_reg_class (STACK_REG, src))
{
-@@ -1865,7 +1923,7 @@ out_movqi_r_mr (rtx insn, rtx op[], int
+@@ -1946,7 +2110,7 @@
if (CONSTANT_ADDRESS_P (x))
{
{
*l = 1;
return AS2 (in,%0,__SREG__);
-@@ -1873,7 +1931,8 @@ out_movqi_r_mr (rtx insn, rtx op[], int
+@@ -1954,7 +2118,8 @@
if (avr_io_address_p (x, 1))
{
*l = 1;
}
*l = 2;
return AS2 (lds,%0,%1);
-@@ -2061,8 +2120,9 @@ out_movhi_r_mr (rtx insn, rtx op[], int
+@@ -2142,8 +2307,9 @@
if (avr_io_address_p (base, 2))
{
*l = 2;
}
*l = 4;
return (AS2 (lds,%A0,%A1) CR_TAB
-@@ -2553,7 +2613,7 @@ out_movqi_mr_r (rtx insn, rtx op[], int
+@@ -2634,7 +2800,7 @@
if (CONSTANT_ADDRESS_P (x))
{
{
*l = 1;
return AS2 (out,__SREG__,%1);
-@@ -2561,7 +2621,8 @@ out_movqi_mr_r (rtx insn, rtx op[], int
+@@ -2642,7 +2808,8 @@
if (avr_io_address_p (x, 1))
{
*l = 1;
}
*l = 2;
return AS2 (sts,%0,%1);
-@@ -2640,11 +2701,20 @@ out_movhi_mr_r (rtx insn, rtx op[], int
+@@ -2721,11 +2888,20 @@
if (avr_io_address_p (base, 2))
{
*l = 2;
- AS2 (out,%A0-0x20,%A1));
+ op[2] = GEN_INT(AVR_IO_OFFSET);
+ if (AVR_XMEGA)
-+ return (AS2 (out,%A0-%2,%B1) CR_TAB
-+ AS2 (out,%B0-%2,%A1));
++ return (AS2 (out,%A0-%2,%A1) CR_TAB
++ AS2 (out,%B0-%2,%B1));
+ else
+ return (AS2 (out,%B0-%2,%B1) CR_TAB
+ AS2 (out,%A0-%2,%A1));
}
if (reg_base > 0)
{
-@@ -2659,11 +2729,20 @@ out_movhi_mr_r (rtx insn, rtx op[], int
+@@ -2740,11 +2916,20 @@
AS2 (adiw,r26,1) CR_TAB
AS2 (st,X,__tmp_reg__));
else
}
else
{
-@@ -2671,14 +2750,27 @@ out_movhi_mr_r (rtx insn, rtx op[], int
+@@ -2752,14 +2937,27 @@
return *l=2, (AS2 (st,X+,%A1) CR_TAB
AS2 (st,X,%B1));
else
}
else if (GET_CODE (base) == PLUS)
{
-@@ -2689,48 +2781,104 @@ out_movhi_mr_r (rtx insn, rtx op[], int
+@@ -2770,48 +2968,104 @@
if (reg_base != REG_Y)
fatal_insn ("incorrect insn:",insn);
{
if (REGNO (XEXP (base, 0)) == REG_X)
{
-@@ -2751,7 +2899,7 @@ out_movhi_mr_r (rtx insn, rtx op[], int
+@@ -2832,7 +3086,7 @@
*l = 2;
return (AS2 (st,%0,%A1) CR_TAB
}
fatal_insn ("unknown move insn:",insn);
return "";
-@@ -4631,6 +4779,7 @@ const struct attribute_spec avr_attribut
+@@ -4712,6 +4966,7 @@
{ "progmem", 0, 0, false, false, false, avr_handle_progmem_attribute },
{ "signal", 0, 0, true, false, false, avr_handle_fndecl_attribute },
{ "interrupt", 0, 0, true, false, false, avr_handle_fndecl_attribute },
{ "naked", 0, 0, false, true, true, avr_handle_fntype_attribute },
{ "OS_task", 0, 0, false, true, true, avr_handle_fntype_attribute },
{ NULL, 0, 0, false, false, false, NULL }
-@@ -4719,6 +4868,14 @@ avr_handle_fndecl_attribute (tree *node,
+@@ -4800,6 +5055,14 @@
func_name);
}
}
}
return NULL_TREE;
-@@ -4844,7 +5001,8 @@ avr_file_start (void)
+@@ -4994,7 +5257,8 @@
/* fprintf (asm_out_file, "\t.arch %s\n", avr_mcu_name);*/
fputs ("__SREG__ = 0x3f\n"
"__SP_H__ = 0x3e\n"
fputs ("__tmp_reg__ = 0\n"
"__zero_reg__ = 1\n", asm_out_file);
-@@ -5708,15 +5866,18 @@ avr_hard_regno_mode_ok (int regno, enum
+@@ -5888,15 +6152,18 @@
return !(regno & 1);
}
}
const char *
-@@ -5877,16 +6038,17 @@ avr_out_sbxx_branch (rtx insn, rtx opera
+@@ -6074,16 +6341,17 @@
if (GET_CODE (operands[1]) == CONST_INT)
{
if (comp == EQ)
output_asm_insn (AS2 (sbrs,__tmp_reg__,%2), operands);
else
---- gcc/config/avr/avr.h.orig 2008-06-08 10:24:28.186941800 -0600
-+++ gcc/config/avr/avr.h 2008-06-08 10:28:40.274905800 -0600
-@@ -44,8 +44,11 @@ struct base_arch_s {
+--- ./gcc/config/avr/avr.h.orig 2010-03-08 12:55:09.000000000 +0100
++++ ./gcc/config/avr/avr.h 2010-03-08 12:55:36.000000000 +0100
+@@ -44,8 +44,11 @@
/* Core have 'EICALL' and 'EIJMP' instructions. */
int have_eijmp_eicall;
const char *const macro;
};
-@@ -68,6 +71,13 @@ extern const struct base_arch_s *avr_cur
+@@ -68,6 +71,13 @@
builtin_define ("__AVR_HAVE_ELPMX__"); \
if (avr_have_movw_lpmx_p) \
builtin_define ("__AVR_HAVE_MOVW__"); \
if (avr_have_movw_lpmx_p) \
builtin_define ("__AVR_HAVE_LPMX__"); \
if (avr_asm_only_p) \
-@@ -88,6 +98,17 @@ extern const struct base_arch_s *avr_cur
+@@ -88,6 +98,17 @@
builtin_define ("__AVR_HAVE_EIJMP_EICALL__"); \
if (TARGET_NO_INTERRUPTS) \
builtin_define ("__NO_INTERRUPTS__"); \
} \
while (0)
-@@ -107,10 +128,15 @@ extern GTY(()) section *progmem_section;
+@@ -107,10 +128,19 @@
#define AVR_HAVE_LPMX (avr_have_movw_lpmx_p)
#define AVR_HAVE_RAMPZ (avr_current_arch->have_elpm)
#define AVR_HAVE_EIJMP_EICALL (avr_current_arch->have_eijmp_eicall)
+#define AVR_XMEGA (avr_current_arch->xmega)
++#define AVR_HAVE_RAMPX_Y_D (avr_current_arch->have_rampx_y_d)
#define AVR_2_BYTE_PC (!AVR_HAVE_EIJMP_EICALL)
#define AVR_3_BYTE_PC (AVR_HAVE_EIJMP_EICALL)
+#define AVR_IO_OFFSET (AVR_XMEGA ? 0 : 0x20)
++#define AVR_RAMPD_ADDR (AVR_XMEGA ? 0x38 : 0)
++#define AVR_RAMPX_ADDR (AVR_XMEGA ? 0x39 : 0)
++#define AVR_RAMPY_ADDR (AVR_XMEGA ? 0x3A : 0)
+#define AVR_RAMPZ_ADDR (AVR_XMEGA ? 0x3B : 0x5B)
+#define AVR_SREG_ADDR (AVR_XMEGA ? 0x3F: 0x5F)
+
#define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)");
#define OVERRIDE_OPTIONS avr_override_options ()
-@@ -849,6 +875,8 @@ mmcu=*:-mmcu=%*}"
- mmcu=at90usb128*|\
- mmcu=at94k: -m avr5}\
+@@ -935,6 +965,20 @@
+ mmcu=m3000*|\
+ mmcu=m3001*: -m avr5}\
%{mmcu=atmega256*:-m avr6}\
++%{mmcu=atxmega16a4|\
++ mmcu=atxmega16d4|\
++ mmcu=atxmega32d4:-m avrxmega2}\
++%{mmcu=atxmega32a4:-m avrxmega3} \
++%{mmcu=atxmega64a3|\
++ mmcu=atxmega64d3:-m avrxmega4} \
+%{mmcu=atxmega64a1:-m avrxmega5} \
++%{mmcu=atxmega128a3|\
++ mmcu=atxmega128d3|\
++ mmcu=atxmega192a3|\
++ mmcu=atxmega192d3|\
++ mmcu=atxmega256a3*|\
++ mmcu=atxmega256d3:-m avrxmega6} \
+%{mmcu=atxmega128a1:-m avrxmega7} \
- %{mmcu=atmega324*|\
- mmcu=atmega325*|\
- mmcu=atmega328p|\
-@@ -994,7 +1022,9 @@ mmcu=*:-mmcu=%*}"
- %{mmcu=atmega2561:crtm2561.o%s} \
- %{mmcu=at90can128:crtcan128.o%s} \
- %{mmcu=at90usb1286:crtusb1286.o%s} \
--%{mmcu=at90usb1287:crtusb1287.o%s}"
-+%{mmcu=at90usb1287:crtusb1287.o%s} \
+ %{mmcu=atmega324a|\
+ mmcu=atmega324p|\
+ mmcu=atmega324pa|\
+@@ -1190,7 +1234,22 @@
+ %{mmcu=m3000s:crtm3000s.o%s} \
+ %{mmcu=m3001b:crtm3001b.o%s} \
+ %{mmcu=atmega2560|mmcu=avr6:crtm2560.o%s} \
+-%{mmcu=atmega2561:crtm2561.o%s}"
++%{mmcu=atmega2561:crtm2561.o%s} \
++%{mmcu=avrxmega2|mmcu=atxmega32d4:crtx32d4.o%s} \
++%{mmcu=atxmega16a4:crtx16a4.o%s} \
++%{mmcu=atxmega16d4:crtx16d4.o%s} \
++%{mmcu=atxmega3|mmcu=atxmega32a4:crtx32a4.o%s} \
++%{mmcu=atxmega4|mmcu=atxmega64a3:crtx64a3.o%s} \
++%{mmcu=atxmega64d3:crtx64d3.o%s} \
+%{mmcu=atxmega5|mmcu=atxmega64a1:crtx64a1.o%s} \
++%{mmcu=atxmega6|mmcu=atxmega128a3:crtx128a3.o%s} \
++%{mmcu=atxmega128d3:crtx128d3.o%s}\
++%{mmcu=atxmega192a3:crtx192a3.o%s}\
++%{mmcu=atxmega192d3:crtx192d3.o%s}\
++%{mmcu=atxmega256a3:crtx256a3.o%s} \
++%{mmcu=atxmega256a3b:crtx256a3b.o%s} \
++%{mmcu=atxmega256d3:crtx256d3.o%s} \
+%{mmcu=atxmega7|mmcu=atxmega128a1:crtx128a1.o%s}"
#define EXTRA_SPECS {"crt_binutils", CRT_BINUTILS_SPECS},
-@@ -1050,8 +1080,12 @@ struct machine_function GTY(())
+@@ -1252,8 +1311,12 @@
/* 'true' - if current function is a signal function
as specified by the "signal" attribute. */
int is_signal;
as specified by the "OS_task" attribute. */
int is_OS_task;
};
---- gcc/config/avr/avr.md.orig 2008-06-08 10:24:28.171355800 -0600
-+++ gcc/config/avr/avr.md 2008-06-08 10:29:58.610141800 -0600
+--- ./gcc/config/avr/t-avr.orig 2010-03-08 12:55:09.000000000 +0100
++++ ./gcc/config/avr/t-avr 2010-03-08 12:55:36.000000000 +0100
+@@ -37,8 +37,8 @@
+
+ FPBIT = fp-bit.c
+
+-MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6
+-MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6
++MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega2/mmcu=avrxmega3/mmcu=avrxmega4/mmcu=avrxmega5/mmcu=avrxmega6/mmcu=avrxmega7
++MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7
+
+ # The many avr2 matches are not listed here - this is the default.
+ MULTILIB_MATCHES = \
+@@ -182,7 +182,22 @@
+ mmcu?avr51=mmcu?m3000s \
+ mmcu?avr51=mmcu?m3001b \
+ mmcu?avr6=mmcu?atmega2560 \
+- mmcu?avr6=mmcu?atmega2561
++ mmcu?avr6=mmcu?atmega2561 \
++ mmcu?avrxmega2=mmcu?atxmega16a4 \
++ mmcu?avrxmega2=mmcu?atxmega16d4 \
++ mmcu?avrxmega2=mmcu?atxmega32d4 \
++ mmcu?avrxmega3=mmcu?atxmega32a4 \
++ mmcu?avrxmega4=mmcu?atxmega64a3 \
++ mmcu?avrxmega4=mmcu?atxmega64d3 \
++ mmcu?avrxmega5=mmcu?atxmega64a1 \
++ mmcu?avrxmega6=mmcu?atxmega128a3 \
++ mmcu?avrxmega6=mmcu?atxmega128d3 \
++ mmcu?avrxmega6=mmcu?atxmega192a3 \
++ mmcu?avrxmega6=mmcu?atxmega192d3 \
++ mmcu?avrxmega6=mmcu?atxmega256a3 \
++ mmcu?avrxmega6=mmcu?atxmega256a3b \
++ mmcu?avrxmega6=mmcu?atxmega256d3 \
++ mmcu?avrxmega7=mmcu?atxmega128a1
+ MULTILIB_EXCEPTIONS =
+
+ LIBGCC = stmp-multilib
+--- ./gcc/config/avr/avr.md.orig 2010-03-08 12:54:57.000000000 +0100
++++ ./gcc/config/avr/avr.md 2010-03-08 12:55:36.000000000 +0100
@@ -47,9 +47,6 @@
(TMP_REGNO 0) ; temporary register r0
(ZERO_REGNO 1) ; zero register r1
-
(UNSPEC_STRLEN 0)
(UNSPEC_INDEX_JMP 1)
- (UNSPEC_SEI 2)
-@@ -2681,7 +2678,8 @@
+ (UNSPEC_SWAP 2)
+@@ -2677,7 +2674,8 @@
"(optimize > 0)"
{
operands[2] = GEN_INT (exact_log2 (~INTVAL (operands[1]) & 0xff));
}
[(set_attr "length" "1")
(set_attr "cc" "none")])
-@@ -2693,7 +2691,8 @@
+@@ -2689,7 +2687,8 @@
"(optimize > 0)"
{
operands[2] = GEN_INT (exact_log2 (INTVAL (operands[1]) & 0xff));
}
[(set_attr "length" "1")
(set_attr "cc" "none")])
-Index: gcc/config/avr/predicates.md
-===================================================================
---- gcc/config/avr/predicates.md (revision 132445)
-+++ gcc/config/avr/predicates.md (working copy)
-@@ -45,12 +45,16 @@
+--- ./gcc/config/avr/predicates.md.orig 2010-03-08 12:54:57.000000000 +0100
++++ ./gcc/config/avr/predicates.md 2010-03-08 12:55:36.000000000 +0100
+@@ -50,12 +50,16 @@
;; Return true if OP is a valid address for lower half of I/O space.
(define_predicate "low_io_address_operand"
(and (match_code "const_int")
;; Return 1 if OP is the zero constant for MODE.
(define_predicate "const0_operand"
---- gcc/config/avr/t-avr.orig 2008-02-19 17:25:31.546827500 -0700
-+++ gcc/config/avr/t-avr 2008-02-20 09:22:51.709554900 -0700
-@@ -37,8 +37,8 @@ fp-bit.c: $(srcdir)/config/fp-bit.c $(sr
-
- FPBIT = fp-bit.c
-
--MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6
--MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6
-+MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega5/mmcu=avrxmega7
-+MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega5 avrxmega7
-
- # The many avr2 matches are not listed here - this is the default.
- MULTILIB_MATCHES = \
-@@ -125,7 +125,9 @@ MULTILIB_MATCHES = \
- mmcu?avr51=mmcu?at90usb1286 \
- mmcu?avr51=mmcu?at90usb1287 \
- mmcu?avr6=mmcu?atmega2560 \
-- mmcu?avr6=mmcu?atmega2561
-+ mmcu?avr6=mmcu?atmega2561 \
-+ mmcu?avrxmega5=mmcu?atxmega64a1 \
-+ mmcu?avrxmega7=mmcu?atxmega128a1
-
- MULTILIB_EXCEPTIONS =
-
+++ /dev/null
---- gcc/config/avr/avr.c.orig 2008-10-29 12:46:40.110056200 -0600
-+++ gcc/config/avr/avr.c 2008-10-29 15:38:35.031795900 -0600
-@@ -299,10 +299,16 @@ static const struct mcu_type_s avr_mcu_t
- /* Xmega, > 8K, <= 64K FLASH, <= 64K RAM. */
- /* Xmega, > 8K, <= 64K FLASH, > 64K RAM. */
- /* Xmega, > 64K, <= 128K FLASH, <= 64K RAM. */
-+ { "avrxmega4", ARCH_AVRXMEGA4, NULL },
-+ { "atxmega64a3", ARCH_AVRXMEGA4, "__AVR_ATxmega64A3__" },
- /* Xmega, > 64K, <= 128K FLASH, > 64K RAM. */
- { "avrxmega5", ARCH_AVRXMEGA5, NULL },
- { "atxmega64a1", ARCH_AVRXMEGA5, "__AVR_ATxmega64A1__" },
- /* Xmega, > 128K, <= 256K FLASH, <= 64K RAM. */
-+ { "avrxmega6", ARCH_AVRXMEGA6, NULL },
-+ { "atxmega128a3", ARCH_AVRXMEGA6, "__AVR_ATxmega128A3__" },
-+ { "atxmega256a3", ARCH_AVRXMEGA6, "__AVR_ATxmega256A3__" },
-+ { "atxmega256a3b",ARCH_AVRXMEGA6, "__AVR_ATxmega256A3B__" },
- /* Xmega, > 128K, <= 256K FLASH, > 64K RAM. */
- { "avrxmega7", ARCH_AVRXMEGA7, NULL },
- { "atxmega128a1", ARCH_AVRXMEGA7, "__AVR_ATxmega128A1__" },
-@@ -694,6 +700,37 @@ expand_prologue (void)
- insn = emit_move_insn (pushbyte, tmp_reg_rtx);
- RTX_FRAME_RELATED_P (insn) = 1;
-
-+ /* Push RAMPD, RAMPX, RAMPY. */
-+ if (AVR_HAVE_RAMPX_Y_D)
-+ {
-+ /* Push RAMPD. */
-+ insn = emit_move_insn (tmp_reg_rtx,
-+ gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPD_ADDR)));
-+ RTX_FRAME_RELATED_P (insn) = 1;
-+ insn = emit_move_insn (pushbyte, tmp_reg_rtx);
-+ RTX_FRAME_RELATED_P (insn) = 1;
-+
-+ /* Push RAMPX. */
-+ if (TEST_HARD_REG_BIT (set, REG_X) && TEST_HARD_REG_BIT (set, REG_X + 1))
-+ {
-+ insn = emit_move_insn (tmp_reg_rtx,
-+ gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPX_ADDR)));
-+ RTX_FRAME_RELATED_P (insn) = 1;
-+ insn = emit_move_insn (pushbyte, tmp_reg_rtx);
-+ RTX_FRAME_RELATED_P (insn) = 1;
-+ }
-+
-+ /* Push RAMPY. */
-+ if (TEST_HARD_REG_BIT (set, REG_Y) && TEST_HARD_REG_BIT (set, REG_Y + 1))
-+ {
-+ insn = emit_move_insn (tmp_reg_rtx,
-+ gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPY_ADDR)));
-+ RTX_FRAME_RELATED_P (insn) = 1;
-+ insn = emit_move_insn (pushbyte, tmp_reg_rtx);
-+ RTX_FRAME_RELATED_P (insn) = 1;
-+ }
-+ }
-+
- /* Push RAMPZ. */
- if(AVR_HAVE_RAMPZ
- && (TEST_HARD_REG_BIT (set, REG_Z) && TEST_HARD_REG_BIT (set, REG_Z + 1)))
-@@ -978,6 +1015,31 @@ expand_epilogue (void)
- tmp_reg_rtx);
- }
-
-+ /* Restore RAMPY, RAMPX, RAMPD using tmp reg as scratch. */
-+ if (AVR_HAVE_RAMPX_Y_D)
-+ {
-+ /* Pop RAMPY. */
-+ if (TEST_HARD_REG_BIT (set, REG_Y) && TEST_HARD_REG_BIT (set, REG_Y + 1))
-+ {
-+ emit_insn (gen_popqi (tmp_reg_rtx));
-+ emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPY_ADDR)),
-+ tmp_reg_rtx);
-+ }
-+
-+ /* Pop RAMPX. */
-+ if (TEST_HARD_REG_BIT (set, REG_X) && TEST_HARD_REG_BIT (set, REG_X + 1))
-+ {
-+ emit_insn (gen_popqi (tmp_reg_rtx));
-+ emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPX_ADDR)),
-+ tmp_reg_rtx);
-+ }
-+
-+ /* Pop RAMPD. */
-+ emit_insn (gen_popqi (tmp_reg_rtx));
-+ emit_move_insn (gen_rtx_MEM (QImode, GEN_INT (AVR_RAMPD_ADDR)),
-+ tmp_reg_rtx);
-+ }
-+
- /* Restore SREG using tmp reg as scratch. */
- emit_insn (gen_popqi (tmp_reg_rtx));
-
---- gcc/config/avr/avr.h.orig 2008-10-29 12:46:40.125681500 -0600
-+++ gcc/config/avr/avr.h 2008-10-29 15:37:15.120431900 -0600
-@@ -129,11 +129,15 @@ extern GTY(()) section *progmem_section;
- #define AVR_HAVE_RAMPZ (avr_current_arch->have_elpm)
- #define AVR_HAVE_EIJMP_EICALL (avr_current_arch->have_eijmp_eicall)
- #define AVR_XMEGA (avr_current_arch->xmega)
-+#define AVR_HAVE_RAMPX_Y_D (avr_current_arch->have_rampx_y_d)
-
- #define AVR_2_BYTE_PC (!AVR_HAVE_EIJMP_EICALL)
- #define AVR_3_BYTE_PC (AVR_HAVE_EIJMP_EICALL)
-
- #define AVR_IO_OFFSET (AVR_XMEGA ? 0 : 0x20)
-+#define AVR_RAMPD_ADDR (AVR_XMEGA ? 0x38 : 0)
-+#define AVR_RAMPX_ADDR (AVR_XMEGA ? 0x39 : 0)
-+#define AVR_RAMPY_ADDR (AVR_XMEGA ? 0x3A : 0)
- #define AVR_RAMPZ_ADDR (AVR_XMEGA ? 0x3B : 0x5B)
- #define AVR_SREG_ADDR (AVR_XMEGA ? 0x3F: 0x5F)
-
-@@ -868,7 +872,10 @@ mmcu=*:-mmcu=%*}"
- mmcu=at90usb128*|\
- mmcu=at94k: -m avr5}\
- %{mmcu=atmega256*:-m avr6}\
-+%{mmcu=atxmega64a3:-m avrxmega4} \
- %{mmcu=atxmega64a1:-m avrxmega5} \
-+%{mmcu=atxmega128a3| \
-+ mmcu=atxmega256a3*:-m avrxmega6} \
- %{mmcu=atxmega128a1:-m avrxmega7} \
- %{mmcu=atmega324*|\
- mmcu=atmega325*|\
-@@ -1016,7 +1023,11 @@ mmcu=*:-mmcu=%*}"
- %{mmcu=at90can128:crtcan128.o%s} \
- %{mmcu=at90usb1286:crtusb1286.o%s} \
- %{mmcu=at90usb1287:crtusb1287.o%s} \
-+%{mmcu=atxmega4|mmcu=atxmega64a3:crtx64a3.o%s} \
- %{mmcu=atxmega5|mmcu=atxmega64a1:crtx64a1.o%s} \
-+%{mmcu=atxmega6|mmcu=atxmega128a3:crtx128a3.o%s} \
-+%{mmcu=atxmega256a3:crtx256a3.o%s} \
-+%{mmcu=atxmega256a3b:crtx256a3b.o%s} \
- %{mmcu=atxmega7|mmcu=atxmega128a1:crtx128a1.o%s}"
-
- #define EXTRA_SPECS {"crt_binutils", CRT_BINUTILS_SPECS},
---- gcc/config/avr/t-avr.orig 2008-10-29 12:46:40.156932100 -0600
-+++ gcc/config/avr/t-avr 2008-10-29 14:26:00.176563300 -0600
-@@ -37,8 +37,8 @@ fp-bit.c: $(srcdir)/config/fp-bit.c $(sr
-
- FPBIT = fp-bit.c
-
--MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega5/mmcu=avrxmega7
--MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega5 avrxmega7
-+MULTILIB_OPTIONS = mmcu=avr2/mmcu=avr25/mmcu=avr3/mmcu=avr31/mmcu=avr35/mmcu=avr4/mmcu=avr5/mmcu=avr51/mmcu=avr6/mmcu=avrxmega4/mmcu=avrxmega5/mmcu=avrxmega6/mmcu=avrxmega7
-+MULTILIB_DIRNAMES = avr2 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega4 avrxmega5 avrxmega6 avrxmega7
-
- # The many avr2 matches are not listed here - this is the default.
- MULTILIB_MATCHES = \
-@@ -124,10 +124,14 @@ MULTILIB_MATCHES = \
- mmcu?avr51=mmcu?at90can128 \
- mmcu?avr51=mmcu?at90usb1286 \
- mmcu?avr51=mmcu?at90usb1287 \
-- mmcu?avr6=mmcu?atmega2560 \
-- mmcu?avr6=mmcu?atmega2561 \
-- mmcu?avrxmega5=mmcu?atxmega64a1 \
-- mmcu?avrxmega7=mmcu?atxmega128a1
-+ mmcu?avr6=mmcu?atmega2560 \
-+ mmcu?avr6=mmcu?atmega2561 \
-+ mmcu?avrxmega4=mmcu?atxmega64a3 \
-+ mmcu?avrxmega5=mmcu?atxmega64a1 \
-+ mmcu?avrxmega6=mmcu?atxmega128a3 \
-+ mmcu?avrxmega6=mmcu?atxmega256a3 \
-+ mmcu?avrxmega6=mmcu?atxmega256a3b \
-+ mmcu?avrxmega7=mmcu?atxmega128a1
-
- MULTILIB_EXCEPTIONS =
-
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.3.3
+Version: 4.3.5
Release: 1
-Patch0: %{name}-attribute_alias.patch
-Patch1: %{name}-dwarf.patch
-Patch2: %{name}-libiberty-Makefile.in.patch
-Patch3: %{name}-bug-11259-v3.patch
-Patch4: %{name}-bug-spill-v4.patch
-Patch5: %{name}-bug-35013.patch
-Patch6: %{name}-libgcc16.patch
-Patch7: %{name}-bug-33009.patch
-Patch8: %{name}-mega256.patch
-Patch9: %{name}-mega256-additional.patch
-Patch10: %{name}-xmega-v9.patch
-Patch11: %{name}-xmega2.patch
-Patch12: %{name}-atmega32m1.patch
-Patch13: %{name}-atmega32c1.patch
-Patch14: %{name}-atmega32u4.patch
-Patch15: %{name}-attiny167.patch
-Patch16: %{name}-attiny13a.patch
-Patch17: %{name}-atmega32u6.patch
-Patch18: %{name}-osmain.patch
-Patch19: %{name}-builtins-v6.patch
+Patch0: crossavr-gcc-bug-11259-v3.patch
+Patch1: crossavr-gcc-bug-18145.patch
+Patch2: crossavr-gcc-bug-19636-24894-31644-31786.patch
+Patch3: crossavr-gcc-bug-33009.patch
+Patch4: crossavr-gcc-bug-34210-35508.patch
+Patch5: crossavr-gcc-bug-35013.patch
+Patch6: crossavr-gcc-builtins-v6.patch
+Patch7: crossavr-gcc-libgcc.patch
+Patch8: crossavr-gcc-libiberty-Makefile.in.patch
+Patch9: crossavr-gcc-new-devices.patch
+Patch10: crossavr-gcc-param-inline-call-cost.patch
+Patch11: crossavr-gcc-xmega.patch
+Patch12: crossavr-gcc-osmain.patch
Epoch: 1
License: GPL
Group: Development/Languages
Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2
-# Source0-md5: cc3c5565fdb9ab87a05ddb106ba0bd1f
+# Source0-md5: e588cfde3bf323f82918589b94f14a15
BuildRequires: /bin/bash
BuildRequires: autoconf
BuildRequires: bison
%patch10 -p0
%patch11 -p0
%patch12 -p0
-%patch13 -p0
-%patch14 -p0
-%patch15 -p0
-%patch16 -p0
-%patch17 -p0
-%patch18 -p0
-%patch19 -p0
%build
rm -rf obj-%{target}