[Bug middle-end/22067] Inconsistent multiply by immediate
dje at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sat Sep 17 03:49:00 GMT 2005
------- Additional Comments From dje at gcc dot gnu dot org 2005-09-17 03:49 -------
The mult_cost argument to choose_mult_variant() and the cost of the best
shift/add sequence are not always representing the same operation, so the
comparison is not always correct. The synth_mult cost is just the cost of the
multiplication by a constant, but the mult_cost argument includes the full
rtx_cost of the insn, including address cost. For example
(mult:SI (mem/c/i:SI (reg/f:SI 123) [5 y+0 S4 A32])
(const_int 24 [0x18]))
rtx_cost will include the cost of the MEM. This artificially inflates the cost
of the MULT, making the shift/add sequence seem more efficient.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22067
More information about the Gcc-bugs
mailing list