diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 80416fc9df9b..ca81139c8f2f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-09-22 Senthil Kumar Selvaraj + + Backport from 2016-09-22 trunk r240388. + + * config/avr/avr.c (avr_rtx_costs_1): Handle DImode MULT. + (avr_address_cost): Replace 61 with MAX_LD_OFFSET(mode). + 2016-09-21 Segher Boessenkool * doc/rtl.texi (JUMP_LABEL): Document RETURN and SIMPLE_RETURN values. diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 140356cc3ac8..4ffb38c571f5 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -9122,6 +9122,8 @@ avr_eval_addr_attrib (rtx x) if (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_IO) { attr = lookup_attribute ("io", DECL_ATTRIBUTES (decl)); + if (!attr || !TREE_VALUE (attr)) + attr = lookup_attribute ("io_low", DECL_ATTRIBUTES (decl)); gcc_assert (attr); } if (!attr || !TREE_VALUE (attr)) @@ -10235,6 +10237,7 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED, break; case SImode: + case DImode: if (AVR_HAVE_MUL) { if (!speed) @@ -10260,7 +10263,10 @@ avr_rtx_costs_1 (rtx x, int codearg, int outer_code ATTRIBUTE_UNUSED, *total = COSTS_N_INSNS (AVR_HAVE_JMP_CALL ? 5 : 4); } - return true; + if (mode == DImode) + *total *= 2; + + return true; default: return false; @@ -10837,7 +10843,7 @@ avr_address_cost (rtx x, machine_mode mode ATTRIBUTE_UNUSED, && (REG_P (XEXP (x, 0)) || GET_CODE (XEXP (x, 0)) == SUBREG)) { - if (INTVAL (XEXP (x, 1)) >= 61) + if (INTVAL (XEXP (x, 1)) > MAX_LD_OFFSET(mode)) cost = 18; } else if (CONSTANT_ADDRESS_P (x))