aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/avr
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/avr')
-rw-r--r--gcc/config/avr/avr-protos.h1
-rw-r--r--gcc/config/avr/avr.c5
-rw-r--r--gcc/config/avr/avr.h43
3 files changed, 4 insertions, 45 deletions
diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h
index b721b3e..35ac232 100644
--- a/gcc/config/avr/avr-protos.h
+++ b/gcc/config/avr/avr-protos.h
@@ -104,7 +104,6 @@ extern const char *avr_out_sbxx_branch PARAMS ((rtx insn, rtx operands[]));
extern enum reg_class preferred_reload_class PARAMS ((rtx x,
enum reg_class class));
-extern int avr_address_cost PARAMS ((rtx x));
extern int extra_constraint PARAMS ((rtx x, int c));
extern rtx legitimize_address PARAMS ((rtx x, rtx oldx,
enum machine_mode mode));
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 0378012..017308b 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -73,6 +73,7 @@ static void avr_asm_out_ctor PARAMS ((rtx, int));
static void avr_asm_out_dtor PARAMS ((rtx, int));
static int default_rtx_costs PARAMS ((rtx, enum rtx_code, enum rtx_code));
static bool avr_rtx_costs PARAMS ((rtx, int, int, int *));
+static int avr_address_cost PARAMS ((rtx));
/* Allocate registers from r25 to r8 for parameters for function calls */
#define FIRST_CUM_REG 26
@@ -231,6 +232,8 @@ int avr_case_values_threshold = 30000;
#define TARGET_SECTION_TYPE_FLAGS avr_section_type_flags
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS avr_rtx_costs
+#undef TARGET_ADDRESS_COST
+#define TARGET_ADDRESS_COST avr_address_cost
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -5093,7 +5096,7 @@ avr_rtx_costs (x, code, outer_code, total)
/* Calculate the cost of a memory address */
-int
+static int
avr_address_cost (x)
rtx x;
{
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 126a6fd..6b3d677 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -1521,49 +1521,6 @@ do { \
is a suitable definition for this macro on machines where anything
`CONSTANT_P' is valid. */
-#define ADDRESS_COST(ADDRESS) avr_address_cost (ADDRESS)
-
-/* An expression giving the cost of an addressing mode that contains
- ADDRESS. If not defined, the cost is computed from the ADDRESS
- expression and the `CONST_COSTS' values.
-
- For most CISC machines, the default cost is a good approximation
- of the true cost of the addressing mode. However, on RISC
- machines, all instructions normally have the same length and
- execution time. Hence all addresses will have equal costs.
-
- In cases where more than one form of an address is known, the form
- with the lowest cost will be used. If multiple forms have the
- same, lowest, cost, the one that is the most complex will be used.
-
- For example, suppose an address that is equal to the sum of a
- register and a constant is used twice in the same basic block.
- When this macro is not defined, the address will be computed in a
- register and memory references will be indirect through that
- register. On machines where the cost of the addressing mode
- containing the sum is no higher than that of a simple indirect
- reference, this will produce an additional instruction and
- possibly require an additional register. Proper specification of
- this macro eliminates this overhead for such machines.
-
- Similar use of this macro is made in strength reduction of loops.
-
- ADDRESS need not be valid as an address. In such a case, the cost
- is not relevant and can be any value; invalid addresses need not be
- assigned a different cost.
-
- On machines where an address involving more than one register is as
- cheap as an address computation involving only one register,
- defining `ADDRESS_COST' to reflect this can cause two registers to
- be live over a region of code where only one would have been if
- `ADDRESS_COST' were not defined in that manner. This effect should
- be considered in the definition of this macro. Equivalent costs
- should probably only be given to addresses with different numbers
- of registers on machines with lots of registers.
-
- This macro will normally either not be defined or be defined as a
- constant. */
-
#define REGISTER_MOVE_COST(MODE, FROM, TO) ((FROM) == STACK_REG ? 6 \
: (TO) == STACK_REG ? 12 \
: 2)