1 diff -Naurp gcc/config/avr/avr.c gcc/config/avr/avr.c
2 --- gcc/config/avr/avr.c 2012-12-06 19:22:10.000000000 +0530
3 +++ gcc/config/avr/avr.c 2012-12-06 19:23:44.000000000 +0530
4 @@ -169,7 +169,7 @@ static bool avr_rtx_costs (rtx, int, int
5 #define FIRST_CUM_REG 26
7 /* Last call saved register */
8 -#define LAST_CALLEE_SAVED_REG (AVR_TINY ? 21 : 17)
9 +#define LAST_CALLEE_SAVED_REG (AVR_TINY ? 19 : 17)
11 /* Implicit target register of LPM instruction (R0) */
12 extern GTY(()) rtx lpm_reg_rtx;
13 @@ -7451,7 +7451,8 @@ avr_assemble_integer (rtx x, unsigned in
15 avr_class_likely_spilled_p (reg_class_t c)
17 - return (c != ALL_REGS && c != ADDW_REGS);
18 + return (c != ALL_REGS &&
19 + (AVR_TINY ? 1 : c != ADDW_REGS));
23 @@ -8168,12 +8169,13 @@ order_regs_for_local_alloc (void)
26 static const int tiny_order_0[] = {
38 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
39 @@ -8220,7 +8222,7 @@ order_regs_for_local_alloc (void)
40 devices has only 16 registers, so different allocation order should be used
42 const int *order = (TARGET_ORDER_1 ? (AVR_TINY ? tiny_order_1 : order_1) :
43 - TARGET_ORDER_2 ? (AVR_TINY ? tiny_order_1 : order_2) :
44 + TARGET_ORDER_2 ? (AVR_TINY ? tiny_order_0 : order_2) :
45 (AVR_TINY ? tiny_order_0 : order_0));
47 for (i=0; i < ARRAY_SIZE (order_0); ++i)
48 @@ -10090,12 +10092,13 @@ avr_conditional_register_usage(void) {
51 const int tiny_reg_alloc_order[] = {
63 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0