summaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-28 18:08:56 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-28 18:08:56 +0000
commitec0457a896817b692d7b51959296de3955098435 (patch)
tree2f6fbc07999c9923c492e499429bdd22d90f295a /gcc/cse.c
parent87647325f990fda8bd1c04de8d1097537c6091b7 (diff)
downloadgcc-ec0457a896817b692d7b51959296de3955098435.tar.gz
* target.h (targetm.address_cost): New.
* target-def.h (TARGET_ADDRESS_COST): New. (TARGET_RTX_COSTS): Uncomment. Oops. * cse.c (address_cost): Use new target hook. (default_address_cost): New. * output.h (default_address_cost): Declare. * hooks.c (hook_int_rtx_0): New. * hooks.h (hook_int_rtx_0): Declare. * loop.c (combine_givs_p): Remove if 0 code. * system.h (ADDRESS_COST): Poison. * config/alpha/alpha.c, config/alpha/alpha.h, config/d30v/d30v.c, config/d30v/d30v.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (TARGET_ADDRESS_COST): Define as hook_int_rtx_0. (ADDRESS_COST): Remove. * config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960-protos.h, config/i960/i960.c, config/i960/i960.h, config/ip2k/ip2k-protos.h, config/ip2k/ip2k.c, config/ip2k/ip2k.h, config/mips/mips-protos.h, config/mips/mips.c, config/mips/mips.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/ns32k/ns32k-protos.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa-protos.h, config/pa/pa.c, config/pa/pa.h, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/vax/vax-protos.h, config/vax/vax.c, config/vax/vax.h (foo_address_cost): Make static. (TARGET_ADDRESS_COST): New. (ADDRESS_COST): Remove. * config/arm/arm.h, config/arm/arm.c, config/m88k/m88k.h, config/m88k/m88k.c, config/romp/romp.h, config/romp/romp.c, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h (ADDRESS_COST): Move code ... (foo_address_cost): ... here. (TARGET_ADDRESS_COST): New. * config/m32r/m32r.c (m32r_address_cost): Remove. * config/m32r/m32r-protos.h: Update. * config/mmix/mmix.c (mmix_address_cost): Remove. * config/mmix/mmix-protos.h: Update. * config/mn10300/mn10300.c (mn10300_address_cost_1): Rename from mn10300_address_cost; move unsig allocation ... (mn10300_address_cost): ... here. (TARGET_ADDRESS_COST): New. * config/mn10300/mn10300-protos.h: Update. * config/mn10300/mn10300.h (ADDRESS_COST): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61988 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index e396042111e..59253a9a28b 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -896,7 +896,7 @@ address_cost (x, mode)
rtx x;
enum machine_mode mode;
{
- /* The ADDRESS_COST macro does not deal with ADDRESSOF nodes. But,
+ /* The address_cost target hook does not deal with ADDRESSOF nodes. But,
during CSE, such nodes are present. Using an ADDRESSOF node which
refers to the address of a REG is a good thing because we can then
turn (MEM (ADDRESSSOF (REG))) into just plain REG. */
@@ -906,17 +906,22 @@ address_cost (x, mode)
/* We may be asked for cost of various unusual addresses, such as operands
of push instruction. It is not worthwhile to complicate writing
- of ADDRESS_COST macro by such cases. */
+ of the target hook by such cases. */
if (!memory_address_p (mode, x))
return 1000;
-#ifdef ADDRESS_COST
- return ADDRESS_COST (x);
-#else
- return rtx_cost (x, MEM);
-#endif
+
+ return (*targetm.address_cost) (x);
}
+/* If the target doesn't override, compute the cost as with arithmetic. */
+
+int
+default_address_cost (x)
+ rtx x;
+{
+ return rtx_cost (x, MEM);
+}
static struct cse_reg_info *
get_cse_reg_info (regno)