This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/22067] Inconsistent multiply by immediate
- From: "dje at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Sep 2005 03:49:29 -0000
- Subject: [Bug middle-end/22067] Inconsistent multiply by immediate
- References: <20050614211850.22067.pthaugen@us.ibm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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