From: Hans-Peter Nilsson Date: Sat, 1 Nov 2008 22:16:09 +0000 (+0000) Subject: re PR target/37939 (CRIS port: no addi insn) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa05ad86531fc0170449521eb1dc8a43cfad7d46;p=platform%2Fupstream%2Fgcc.git re PR target/37939 (CRIS port: no addi insn) PR target/37939 * config/cris/cris.c (cris_rtx_costs) : Return 0 for an ADDI operand. From-SVN: r141524 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b811061..9e558d3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-11-01 Hans-Peter Nilsson + + PR target/37939 + * config/cris/cris.c (cris_rtx_costs) : Return 0 for an ADDI + operand. + 2008-11-01 Richard Guenther PR middle-end/37976 diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index 1d0a34b..88d8999 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))