summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-01 22:16:09 +0000
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-01 22:16:09 +0000
commit2082fc3b72ee70a95e32e72d11fedcd8dd19b405 (patch)
tree9fb36e6da797fdbdac8da8892b3c2ee0a3206343
parent5e8de854fd85cb6f523526712b50350116750428 (diff)
downloadppe42-gcc-2082fc3b72ee70a95e32e72d11fedcd8dd19b405.tar.gz
ppe42-gcc-2082fc3b72ee70a95e32e72d11fedcd8dd19b405.zip
PR target/37939
* config/cris/cris.c (cris_rtx_costs) <MULT>: Return 0 for an ADDI operand. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141524 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/cris/cris.c15
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b811061b3df..9e558d35b9c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-01 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/37939
+ * config/cris/cris.c (cris_rtx_costs) <MULT>: Return 0 for an ADDI
+ operand.
+
2008-11-01 Richard Guenther <rguenther@suse.de>
PR middle-end/37976
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 1d0a34b9abb..88d89993a9e 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -1796,6 +1796,21 @@ cris_rtx_costs (rtx x, int code, int outer_code, int *total,
return true;
case MULT:
+ /* If we have one arm of an ADDI, make sure it gets the cost of
+ one insn, i.e. zero cost for this operand, and just the cost
+ of the PLUS, as the insn is created by combine from a PLUS
+ and an ASHIFT, and the MULT cost below would make the
+ combined value be larger than the separate insns. The insn
+ validity is checked elsewhere by combine.
+
+ FIXME: this case is a stop-gap for 4.3 and 4.4, this whole
+ function should be rewritten. */
+ if (outer_code == PLUS && BIAP_INDEX_P (x))
+ {
+ *total = 0;
+ return true;
+ }
+
/* Identify values that are no powers of two. Powers of 2 are
taken care of already and those values should not be changed. */
if (!CONST_INT_P (XEXP (x, 1))
OpenPOWER on IntegriCloud